Skip to content

Document the WooCommerce 11.1.0 wc/v3 refund additions - #287

Merged
samiuelson merged 4 commits into
trunkfrom
add-v3-refund-preview-compute-totals-can-be-refunded
Aug 11, 2026
Merged

Document the WooCommerce 11.1.0 wc/v3 refund additions#287
samiuelson merged 4 commits into
trunkfrom
add-v3-refund-preview-compute-totals-can-be-refunded

Conversation

@samiuelson

@samiuelson samiuelson commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Documents the two additions to the wc/v3 refunds API shipping in WooCommerce 11.1.0. The implementation merged in woocommerce/woocommerce#67042, including the server-computed refund work originally developed in the stacked woocommerce/woocommerce#67043.

  • Preview a refund: documents POST /wc/v3/orders/<id>/refunds/preview, including the request contract, response breakdown, permissions, examples, and controller-generated validation errors.
  • Create a server-computed refund: documents the opt-in compute_totals mode on POST /wc/v3/orders/<id>/refunds, including quantity-only requests, conditional refund_total/refund_tax semantics, amount bounds, duplicate item and tax restrictions, and compatibility detection for stores older than WooCommerce 11.1.0.

The compatibility warning is important because older stores silently discard the unknown compute_totals parameter; a quantity-only request would otherwise create a 0.00 refund. Clients should feature-detect support through OPTIONS or the preview route before using the computed form.

The previously proposed can_be_refunded field is intentionally not documented because it was removed from the implementation.

Validation

  • Compared the documentation with the merged controller, calculation engine, public schema, and integration tests.
  • Ran markdownlint --fix and markdownlint using the legacy Slate repository's heading, HTML, and table conventions.
  • Parsed all five JSON response examples and all three cURL JSON payloads.
  • Syntax-checked all six JavaScript examples.
  • Ran git diff --check.

Adds the refund preview endpoint section (request/response tables, curl
and JS examples, error codes), the compute_totals property on refund
creation, and the read-only can_be_refunded fields on orders and their
product, shipping, and fee lines.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…rning

The per-line can_be_refunded field was dropped from the WooCommerce stack
(woocommerce/woocommerce#67044 closed), so its four property rows are removed.
The refund creation docs gain a warning that stores below 11.1.0 silently drop
the unknown compute_totals parameter, where a quantity-only request creates a
0.00 refund, with the OPTIONS and preview-probe capability checks clients must
use.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the WooCommerce REST API v3 order refunds documentation to cover new WooCommerce 11.1.0 capabilities around server-computed refunds and a refund preview endpoint, helping API consumers safely adopt the new behavior.

Changes:

  • Documents compute_totals on POST /wc/v3/orders/<id>/refunds, including parameter rules, validation errors, and an upgrade/compatibility warning.
  • Adds documentation for POST /wc/v3/orders/<id>/refunds/preview, including request/response schema and error codes.
  • Fixes/improves the existing create-refund cURL example formatting/completeness.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread source/includes/wp-api-v3/_order-refunds.md Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@samiuelson
samiuelson merged commit 09431ca into trunk Aug 11, 2026
@samiuelson
samiuelson deleted the add-v3-refund-preview-compute-totals-can-be-refunded branch August 11, 2026 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants