From ba4a081f8852f8ae762166fc5583b584e6502759 Mon Sep 17 00:00:00 2001 From: Corey McKrill <916023+coreymckrill@users.noreply.github.com> Date: Mon, 20 May 2024 17:10:36 -0700 Subject: [PATCH 1/9] Add missing properties to Order refunds This also removes redundant properties from Orders Fixes https://github.com/woocommerce/woocommerce/issues/43444 --- source/includes/wp-api-v3/_order-refunds.md | 69 +++++++++++++---- source/includes/wp-api-v3/_orders.md | 83 +++++++++------------ 2 files changed, 90 insertions(+), 62 deletions(-) diff --git a/source/includes/wp-api-v3/_order-refunds.md b/source/includes/wp-api-v3/_order-refunds.md index 7ed624b..d2fa0d8 100644 --- a/source/includes/wp-api-v3/_order-refunds.md +++ b/source/includes/wp-api-v3/_order-refunds.md @@ -1,22 +1,25 @@ -# Refunds # +# Order refunds # -The refunds API allows you to create, view, and delete individual refunds. +The order refunds API allows you to create, view, and delete individual refunds, based on an existing order. ## Order refund properties ## -| Attribute | Type | Description | -|--------------------|-----------|--------------------------------------------------------------------------------------------------------------------------------------------------| -| `id` | integer | Unique identifier for the resource. read-only | -| `date_created` | date-time | The date the order refund was created, in the site's timezone. read-only | -| `date_created_gmt` | date-time | The date the order refund was created, as GMT. read-only | +| Attribute | Type | Description | +|--------------------|-----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `id` | integer | Unique identifier for the resource. read-only | +| `date_created` | date-time | The date the order refund was created, in the site's timezone. read-only | +| `date_created_gmt` | date-time | The date the order refund was created, as GMT. read-only | | `amount` | string | Total refund amount. Optional. If this parameter is provided, it will take precedence over line item totals, even when total of line items does not matches with this amount. | -| `reason` | string | Reason for refund. | -| `refunded_by` | integer | User ID of user who created the refund. | -| `refunded_payment` | boolean | If the payment was refunded via the API. See `api_refund`. read-only | -| `meta_data` | array | Meta data. See [Order refund - Meta data properties](#order-refund-meta-data-properties) | -| `line_items` | array | Line items data. See [Order refund - Line items properties](#order-refund-line-items-properties) | -| `api_refund` | boolean | When true, the payment gateway API is used to generate the refund. Default is `true`. write-only | -| `api_restock` | boolean | When true, the selected line items are restocked Default is `true`. write-only | +| `reason` | string | Reason for refund. | +| `refunded_by` | integer | User ID of user who created the refund. | +| `refunded_payment` | boolean | If the payment was refunded via the API. See `api_refund`. read-only | +| `meta_data` | array | Meta data. See [Order refund - Meta data properties](#order-refund-meta-data-properties) | +| `line_items` | array | Line items data. See [Order refund - Line items properties](#order-refund-line-items-properties) | +| `tax_lines` | array | Tax lines data. See [Order refund - Tax lines properties](#order-refund-tax-lines-properties) read-only | +| `shipping_lines` | array | Shipping lines data. See [Order refund - Shipping lines properties](#order-refund-shipping-lines-properties) | +| `fee_lines` | array | Fee lines data. See [Order refund - Fee lines properties](#order-refund-fee-lines-properties) | +| `api_refund` | boolean | When true, the payment gateway API is used to generate the refund. Default is `true`. write-only | +| `api_restock` | boolean | When true, the selected line items are restocked Default is `true`. write-only | ### Order refund - Meta data properties ### @@ -55,6 +58,44 @@ The refunds API allows you to create, view, and delete individual refunds. | `subtotal` | string | Tax subtotal. read-only | | `refund_total` | number | The amount to refund for this tax. write-only | +### Order refund - Tax lines properties ### + +| Attribute | Type | Description | +|----------------------|---------|------------------------------------------------------------------------------------------| +| `id` | integer | Item ID. read-only | +| `rate_code` | string | Tax rate code. read-only | +| `rate_id` | string | Tax rate ID. read-only | +| `label` | string | Tax rate label. read-only | +| `compound` | boolean | Show if is a compound tax rate. read-only | +| `tax_total` | string | Tax total (not including shipping taxes). read-only | +| `shipping_tax_total` | string | Shipping tax total. read-only | +| `meta_data` | array | Meta data. See [Order refund - Meta data properties](#order-refund-meta-data-properties) | + +### Order refund - Shipping lines properties ### + +| Attribute | Type | Description | +|----------------|---------|-------------------------------------------------------------------------------------------------------------------------------------| +| `id` | integer | Item ID. read-only | +| `method_title` | string | Shipping method name. | +| `method_id` | string | Shipping method ID. | +| `total` | string | Line total (after discounts). | +| `total_tax` | string | Line total tax (after discounts). read-only | +| `taxes` | array | Line taxes. See [Order refund - Tax lines properties](#order-refund-tax-lines-properties) read-only | +| `meta_data` | array | Meta data. See [Order refund - Meta data properties](#order-refund-meta-data-properties) | + +### Order refund - Fee lines properties ### + +| Attribute | Type | Description | +|--------------|---------|-------------------------------------------------------------------------------------------------------------------------------------| +| `id` | integer | Item ID. read-only | +| `name` | string | Fee name. | +| `tax_class` | string | Tax class of fee. | +| `tax_status` | string | Tax status of fee. Options: `taxable` and `none`. | +| `total` | string | Line total (after discounts). | +| `total_tax` | string | Line total tax (after discounts). read-only | +| `taxes` | array | Line taxes. See [Order refund - Tax lines properties](#order-refund-tax-lines-properties) read-only | +| `meta_data` | array | Meta data. See [Order refund - Meta data properties](#order-refund-meta-data-properties) | + ## Create a refund ## This API helps you to create a new refund for an order. diff --git a/source/includes/wp-api-v3/_orders.md b/source/includes/wp-api-v3/_orders.md index 600de23..55fa0a6 100644 --- a/source/includes/wp-api-v3/_orders.md +++ b/source/includes/wp-api-v3/_orders.md @@ -89,22 +89,22 @@ The orders API allows you to create, view, update, and delete individual, or a b ### Order - Line items properties ### -| Attribute | Type | Description | -|----------------|---------|---------------------------------------------------------------------------------------------------------------| -| `id` | integer | Item ID. read-only | -| `name` | string | Product name. | -| `product_id` | integer | Product ID. | -| `variation_id` | integer | Variation ID, if applicable. | -| `quantity` | integer | Quantity ordered. | -| `tax_class` | string | Slug of the tax class of product. | -| `subtotal` | string | Line subtotal (before discounts). | -| `subtotal_tax` | string | Line subtotal tax (before discounts). read-only | -| `total` | string | Line total (after discounts). | -| `total_tax` | string | Line total tax (after discounts). read-only | -| `taxes` | array | Line taxes. See [Order - Taxes properties](#order-taxes-properties) read-only | -| `meta_data` | array | Meta data. See [Order - Meta data properties](#order-meta-data-properties) | -| `sku` | string | Product SKU. read-only | -| `price` | string | Product price. read-only | +| Attribute | Type | Description | +|----------------|---------|-----------------------------------------------------------------------------------------------------------------------| +| `id` | integer | Item ID. read-only | +| `name` | string | Product name. | +| `product_id` | integer | Product ID. | +| `variation_id` | integer | Variation ID, if applicable. | +| `quantity` | integer | Quantity ordered. | +| `tax_class` | string | Slug of the tax class of product. | +| `subtotal` | string | Line subtotal (before discounts). | +| `subtotal_tax` | string | Line subtotal tax (before discounts). read-only | +| `total` | string | Line total (after discounts). | +| `total_tax` | string | Line total tax (after discounts). read-only | +| `taxes` | array | Line taxes. See [Order - Tax lines properties](#order-tax-lines-properties) read-only | +| `meta_data` | array | Meta data. See [Order - Meta data properties](#order-meta-data-properties) | +| `sku` | string | Product SKU. read-only | +| `price` | string | Product price. read-only | ### Order - Tax lines properties ### @@ -121,28 +121,28 @@ The orders API allows you to create, view, update, and delete individual, or a b ### Order - Shipping lines properties ### -| Attribute | Type | Description | -|----------------|---------|---------------------------------------------------------------------------------------------------------------| -| `id` | integer | Item ID. read-only | -| `method_title` | string | Shipping method name. | -| `method_id` | string | Shipping method ID. | -| `total` | string | Line total (after discounts). | -| `total_tax` | string | Line total tax (after discounts). read-only | -| `taxes` | array | Line taxes. See [Order - Taxes properties](#order-taxes-properties) read-only | -| `meta_data` | array | Meta data. See [Order - Meta data properties](#order-meta-data-properties) | +| Attribute | Type | Description | +|----------------|---------|-----------------------------------------------------------------------------------------------------------------------| +| `id` | integer | Item ID. read-only | +| `method_title` | string | Shipping method name. | +| `method_id` | string | Shipping method ID. | +| `total` | string | Line total (after discounts). | +| `total_tax` | string | Line total tax (after discounts). read-only | +| `taxes` | array | Line taxes. See [Order - Tax lines properties](#order-tax-lines-properties) read-only | +| `meta_data` | array | Meta data. See [Order - Meta data properties](#order-meta-data-properties) | ### Order - Fee lines properties ### -| Attribute | Type | Description | -|--------------|---------|---------------------------------------------------------------------------------------------------------------| -| `id` | integer | Item ID. read-only | -| `name` | string | Fee name. | -| `tax_class` | string | Tax class of fee. | -| `tax_status` | string | Tax status of fee. Options: `taxable` and `none`. | -| `total` | string | Line total (after discounts). | -| `total_tax` | string | Line total tax (after discounts). read-only | -| `taxes` | array | Line taxes. See [Order - Taxes properties](#order-taxes-properties) read-only | -| `meta_data` | array | Meta data. See [Order - Meta data properties](#order-meta-data-properties) | +| Attribute | Type | Description | +|--------------|---------|-----------------------------------------------------------------------------------------------------------------------| +| `id` | integer | Item ID. read-only | +| `name` | string | Fee name. | +| `tax_class` | string | Tax class of fee. | +| `tax_status` | string | Tax status of fee. Options: `taxable` and `none`. | +| `total` | string | Line total (after discounts). | +| `total_tax` | string | Line total tax (after discounts). read-only | +| `taxes` | array | Line taxes. See [Order - Tax lines properties](#order-tax-lines-properties) read-only | +| `meta_data` | array | Meta data. See [Order - Meta data properties](#order-meta-data-properties) | ### Order - Coupon lines properties ### @@ -162,19 +162,6 @@ The orders API allows you to create, view, update, and delete individual, or a b | `reason` | string | Refund reason. read-only | | `total` | string | Refund total. read-only | -### Order - Taxes properties ### - -| Attribute | Type | Description | -|----------------------|---------|-------------------------------------------------------------------------------------| -| `id` | integer | Item ID. read-only | -| `rate_code` | string | Tax rate code. read-only | -| `rate_id` | string | Tax rate ID. read-only | -| `label` | string | Tax rate label. read-only | -| `compound` | boolean | Show if is a compound tax rate. read-only | -| `tax_total` | string | Tax total (not including shipping taxes). read-only | -| `shipping_tax_total` | string | Shipping tax total. read-only | -| `meta_data` | array | Meta data. See [Order - Meta data properties](#order-meta-data-properties) | - ## Create an order ## This API helps you to create a new order. From c65de566c8809050494f03b4398f56bb4687d6ae Mon Sep 17 00:00:00 2001 From: Corey McKrill <916023+coreymckrill@users.noreply.github.com> Date: Wed, 22 May 2024 16:20:21 -0700 Subject: [PATCH 2/9] Add docs for the new refunds endpoint Refs #46895 --- source/includes/wp-api-v3/_order-refunds.md | 2 + source/includes/wp-api-v3/_refunds.md | 158 ++++++++++++++++++++ source/index.html.md | 1 + 3 files changed, 161 insertions(+) create mode 100644 source/includes/wp-api-v3/_refunds.md diff --git a/source/includes/wp-api-v3/_order-refunds.md b/source/includes/wp-api-v3/_order-refunds.md index d2fa0d8..19a0ac3 100644 --- a/source/includes/wp-api-v3/_order-refunds.md +++ b/source/includes/wp-api-v3/_order-refunds.md @@ -333,6 +333,8 @@ woocommerce.get("orders/723/refunds/726").parsed_response This API helps you to view all the refunds from an order. +Note: To view a list of refunds from your store, regardless of order, check out the [refunds endpoint](#refunds). + ### HTTP request ###
diff --git a/source/includes/wp-api-v3/_refunds.md b/source/includes/wp-api-v3/_refunds.md new file mode 100644 index 0000000..a68644a --- /dev/null +++ b/source/includes/wp-api-v3/_refunds.md @@ -0,0 +1,158 @@ +# Refunds # + +The refunds API is a simple, read-only endpoint that allows you to retrieve a list of refunds outside the context of an existing order. To create, view, and delete individual refunds, check out the [order refunds API](#order-refunds). + +## Refund properties ## + +All properties are the same as those in the [order refunds endpoint](#order-refund-properties), but with one additional property: + +| Attribute | Type | Description | +|-------------|---------|----------------------------------------------------| +| `parent_id` | integer | The ID of the order the refund is associated with. | + +## Retrieve a list of refunds ## + +This API lets you retrieve and view refunds from your store, regardless of which order they are associated with. + +### HTTP request ### + +
+
+ GET +
/wp-json/wc/v3/refunds
+
+
+ +```shell +curl https://example.com/wp-json/wc/v3/refunds \ + -u consumer_key:consumer_secret +``` + +```javascript +WooCommerce.get("refunds") + .then((response) => { + console.log(response.data); + }) + .catch((error) => { + console.log(error.response.data); + }); +``` + +```php +get('refunds')); ?> +``` + +```python +print(wcapi.get("refunds").json()) +``` + +```ruby +woocommerce.get("refunds").parsed_response +``` + +> JSON response example: + +```json +[ + { + "id": 726, + "parent_id": 124, + "date_created": "2017-03-21T17:07:11", + "date_created_gmt": "2017-03-21T20:07:11", + "amount": "10.00", + "reason": "", + "refunded_by": 1, + "refunded_payment": false, + "meta_data": [], + "line_items": [], + "_links": { + "self": [ + { + "href": "https://example.com/wp-json/wc/v3/orders/723/refunds/726" + } + ], + "collection": [ + { + "href": "https://example.com/wp-json/wc/v3/orders/723/refunds" + } + ], + "up": [ + { + "href": "https://example.com/wp-json/wc/v3/orders/723" + } + ] + } + }, + { + "id": 724, + "parent_id": 63, + "date_created": "2017-03-21T16:55:37", + "date_created_gmt": "2017-03-21T19:55:37", + "amount": "9.00", + "reason": "", + "refunded_by": 1, + "refunded_payment": false, + "meta_data": [], + "line_items": [ + { + "id": 314, + "name": "Woo Album #2", + "product_id": 87, + "variation_id": 0, + "quantity": -1, + "tax_class": "", + "subtotal": "-9.00", + "subtotal_tax": "0.00", + "total": "-9.00", + "total_tax": "0.00", + "taxes": [], + "meta_data": [ + { + "id": 2076, + "key": "_refunded_item_id", + "value": "311" + } + ], + "sku": "", + "price": -9 + } + ], + "_links": { + "self": [ + { + "href": "https://example.com/wp-json/wc/v3/orders/723/refunds/724" + } + ], + "collection": [ + { + "href": "https://example.com/wp-json/wc/v3/orders/723/refunds" + } + ], + "up": [ + { + "href": "https://example.com/wp-json/wc/v3/orders/723" + } + ] + } + } +] +``` + +#### Available parameters #### + +| Parameter | Type | Description | +|------------------|---------|------------------------------------------------------------------------------------------------------------------------------| +| `context` | string | Scope under which the request is made; determines fields present in response. Options: `view` and `edit`. Default is `view`. | +| `page` | integer | Current page of the collection. Default is `1`. | +| `per_page` | integer | Maximum number of items to be returned in result set. Default is `10`. | +| `search` | string | Limit results to those matching a string. | +| `after` | string | Limit response to resources published after a given ISO8601 compliant date. | +| `before` | string | Limit response to resources published before a given ISO8601 compliant date. | +| `exclude` | array | Ensure result set excludes specific IDs. | +| `include` | array | Limit result set to specific ids. | +| `offset` | integer | Offset the result set by a specific number of items. | +| `order` | string | Order sort attribute ascending or descending. Options: `asc` and `desc`. Default is `desc`. | +| `orderby` | string | Sort collection by object attribute. Options: `date`, `id`, `include`, `title` and `slug`. Default is `date`. | +| `parent` | array | Limit result set to those of particular parent IDs. | +| `parent_exclude` | array | Limit result set to all items except those of a particular parent ID. | +| `dp` | integer | Number of decimal points to use in each resource. Default is `2`. | diff --git a/source/index.html.md b/source/index.html.md index 7f4914a..92e5a03 100644 --- a/source/index.html.md +++ b/source/index.html.md @@ -35,6 +35,7 @@ includes: - wp-api-v3/product-tags - wp-api-v3/product-reviews - wp-api-v3/reports + - wp-api-v3/refunds - wp-api-v3/taxes - wp-api-v3/tax-classes - wp-api-v3/webhooks From bb9b2135c83ab4a6a354318f9bb7b6db09333671 Mon Sep 17 00:00:00 2001 From: Corey McKrill <916023+coreymckrill@users.noreply.github.com> Date: Wed, 22 May 2024 16:24:24 -0700 Subject: [PATCH 3/9] Update order refund > line item > tax_class Property type set to string to match schema Fixes https://github.com/woocommerce/woocommerce/issues/28474 --- source/includes/wp-api-v3/_order-refunds.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/includes/wp-api-v3/_order-refunds.md b/source/includes/wp-api-v3/_order-refunds.md index 19a0ac3..4fb136e 100644 --- a/source/includes/wp-api-v3/_order-refunds.md +++ b/source/includes/wp-api-v3/_order-refunds.md @@ -38,7 +38,7 @@ The order refunds API allows you to create, view, and delete individual refunds, | `product_id` | integer | Product ID. | | `variation_id` | integer | Variation ID, if applicable. | | `quantity` | integer | Quantity ordered. | -| `tax_class` | integer | Tax class of product. | +| `tax_class` | string | Tax class of product. | | `subtotal` | string | Line subtotal (before discounts). | | `subtotal_tax` | string | Line subtotal tax (before discounts). read-only | | `total` | string | Line total (after discounts). | From f10322326cc0f9d2d7c3538a7afeae39f53dfd88 Mon Sep 17 00:00:00 2001 From: Corey McKrill <916023+coreymckrill@users.noreply.github.com> Date: Thu, 23 May 2024 10:38:05 -0700 Subject: [PATCH 4/9] Change wc_version to version in system_status Fixes https://github.com/woocommerce/woocommerce/issues/45836 --- source/includes/wp-api-v3/_system-status.md | 62 ++++++++++----------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/source/includes/wp-api-v3/_system-status.md b/source/includes/wp-api-v3/_system-status.md index 0a787f1..1ff3f7e 100644 --- a/source/includes/wp-api-v3/_system-status.md +++ b/source/includes/wp-api-v3/_system-status.md @@ -16,38 +16,38 @@ The system status API allows you to view all system status items. ### System status - Environment properties ### -| Attribute | Type | Description | -| --------------------------- | ------- | -------------------------------------------------------------------------- | -| `home_url` | string | Home URL. read-only | -| `site_url` | string | Site URL. read-only | -| `wc_version` | string | WooCommerce version. read-only | -| `log_directory` | string | Log directory. read-only | -| `log_directory_writable` | boolean | Is log directory writable? read-only | -| `wp_version` | string | WordPress version. read-only | -| `wp_multisite` | boolean | Is WordPress multisite? read-only | -| `wp_memory_limit` | integer | WordPress memory limit. read-only | -| `wp_debug_mode` | boolean | Is WordPress debug mode active? read-only | -| `wp_cron` | boolean | Are WordPress cron jobs enabled? read-only | -| `language` | string | WordPress language. read-only | -| `server_info` | string | Server info. read-only | -| `php_version` | string | PHP version. read-only | -| `php_post_max_size` | integer | PHP post max size. read-only | -| `php_max_execution_time` | integer | PHP max execution time. read-only | -| `php_max_input_vars` | integer | PHP max input vars. read-only | -| `curl_version` | string | cURL version. read-only | -| `suhosin_installed` | boolean | Is SUHOSIN installed? read-only | -| `max_upload_size` | integer | Max upload size. read-only | -| `mysql_version` | string | MySQL version. read-only | -| `default_timezone` | string | Default timezone. read-only | +| Attribute | Type | Description | +| ------------------------ | ------- | -------------------------------------------------------------------------- | +| `home_url` | string | Home URL. read-only | +| `site_url` | string | Site URL. read-only | +| `version` | string | WooCommerce version. read-only | +| `log_directory` | string | Log directory. read-only | +| `log_directory_writable` | boolean | Is log directory writable? read-only | +| `wp_version` | string | WordPress version. read-only | +| `wp_multisite` | boolean | Is WordPress multisite? read-only | +| `wp_memory_limit` | integer | WordPress memory limit. read-only | +| `wp_debug_mode` | boolean | Is WordPress debug mode active? read-only | +| `wp_cron` | boolean | Are WordPress cron jobs enabled? read-only | +| `language` | string | WordPress language. read-only | +| `server_info` | string | Server info. read-only | +| `php_version` | string | PHP version. read-only | +| `php_post_max_size` | integer | PHP post max size. read-only | +| `php_max_execution_time` | integer | PHP max execution time. read-only | +| `php_max_input_vars` | integer | PHP max input vars. read-only | +| `curl_version` | string | cURL version. read-only | +| `suhosin_installed` | boolean | Is SUHOSIN installed? read-only | +| `max_upload_size` | integer | Max upload size. read-only | +| `mysql_version` | string | MySQL version. read-only | +| `default_timezone` | string | Default timezone. read-only | | `fsockopen_or_curl_enabled` | boolean | Is fsockopen/cURL enabled? read-only | -| `soapclient_enabled` | boolean | Is SoapClient class enabled? read-only | -| `domdocument_enabled` | boolean | Is DomDocument class enabled? read-only | -| `gzip_enabled` | boolean | Is GZip enabled? read-only | -| `mbstring_enabled` | boolean | Is mbstring enabled? read-only | -| `remote_post_successful` | boolean | Remote POST successful? read-only | -| `remote_post_response` | string | Remote POST response. read-only | -| `remote_get_successful` | boolean | Remote GET successful? read-only | -| `remote_get_response` | string | Remote GET response. read-only | +| `soapclient_enabled` | boolean | Is SoapClient class enabled? read-only | +| `domdocument_enabled` | boolean | Is DomDocument class enabled? read-only | +| `gzip_enabled` | boolean | Is GZip enabled? read-only | +| `mbstring_enabled` | boolean | Is mbstring enabled? read-only | +| `remote_post_successful` | boolean | Remote POST successful? read-only | +| `remote_post_response` | string | Remote POST response. read-only | +| `remote_get_successful` | boolean | Remote GET successful? read-only | +| `remote_get_response` | string | Remote GET response. read-only | ### System status - Database properties ### From b3924347f026a0486e10b836db526f039c843d7a Mon Sep 17 00:00:00 2001 From: Corey McKrill <916023+coreymckrill@users.noreply.github.com> Date: Thu, 23 May 2024 10:52:44 -0700 Subject: [PATCH 5/9] Update rate_id type in tax_lines to integer Fixes https://github.com/woocommerce/woocommerce/issues/32037 --- source/includes/wp-api-v3/_order-refunds.md | 2 +- source/includes/wp-api-v3/_orders.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/includes/wp-api-v3/_order-refunds.md b/source/includes/wp-api-v3/_order-refunds.md index 4fb136e..bd840ab 100644 --- a/source/includes/wp-api-v3/_order-refunds.md +++ b/source/includes/wp-api-v3/_order-refunds.md @@ -64,7 +64,7 @@ The order refunds API allows you to create, view, and delete individual refunds, |----------------------|---------|------------------------------------------------------------------------------------------| | `id` | integer | Item ID. read-only | | `rate_code` | string | Tax rate code. read-only | -| `rate_id` | string | Tax rate ID. read-only | +| `rate_id` | integer | Tax rate ID. read-only | | `label` | string | Tax rate label. read-only | | `compound` | boolean | Show if is a compound tax rate. read-only | | `tax_total` | string | Tax total (not including shipping taxes). read-only | diff --git a/source/includes/wp-api-v3/_orders.md b/source/includes/wp-api-v3/_orders.md index 55fa0a6..93a7ac8 100644 --- a/source/includes/wp-api-v3/_orders.md +++ b/source/includes/wp-api-v3/_orders.md @@ -112,7 +112,7 @@ The orders API allows you to create, view, update, and delete individual, or a b |----------------------|---------|-------------------------------------------------------------------------------------| | `id` | integer | Item ID. read-only | | `rate_code` | string | Tax rate code. read-only | -| `rate_id` | string | Tax rate ID. read-only | +| `rate_id` | integer | Tax rate ID. read-only | | `label` | string | Tax rate label. read-only | | `compound` | boolean | Show if is a compound tax rate. read-only | | `tax_total` | string | Tax total (not including shipping taxes). read-only | From 8421caa4f227bbd1f8e86c9eebe2eb407f7afac6 Mon Sep 17 00:00:00 2001 From: Corey McKrill <916023+coreymckrill@users.noreply.github.com> Date: Tue, 4 Jun 2024 16:39:37 -0700 Subject: [PATCH 6/9] Add line item parameters for "Create a refund" Fixes https://github.com/woocommerce/woocommerce/issues/45924 --- source/includes/wp-api-v3/_order-refunds.md | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/source/includes/wp-api-v3/_order-refunds.md b/source/includes/wp-api-v3/_order-refunds.md index bd840ab..b6bfae1 100644 --- a/source/includes/wp-api-v3/_order-refunds.md +++ b/source/includes/wp-api-v3/_order-refunds.md @@ -47,7 +47,6 @@ The order refunds API allows you to create, view, and delete individual refunds, | `meta_data` | array | Meta data. See [Order refund - Meta data properties](#order-refund-meta-data-properties) | | `sku` | string | Product SKU. read-only | | `price` | string | Product price. read-only | -| `refund_total` | number | The amount to refund for this line item, excluding taxes. write-only | #### Order refund line item - Taxes properties #### @@ -56,7 +55,6 @@ The order refunds API allows you to create, view, and delete individual refunds, | `id` | integer | Tax rate ID. read-only | | `total` | string | Tax total. read-only | | `subtotal` | string | Tax subtotal. read-only | -| `refund_total` | number | The amount to refund for this tax. write-only | ### Order refund - Tax lines properties ### @@ -250,6 +248,21 @@ woocommerce.post("orders/723/refunds", data).parsed_response } ``` +#### Line item parameters #### + +| Parameter | Type | Description | +|----------------|---------|----------------------------------------------------------------------------| +| `id` | integer | The ID of the line item in the order. | +| `refund_total` | number | The amount to refund for this line item, excluding taxes. | +| `refund_tax` | array | Refunds for tax rates. See [Refund tax parameters](#refund-tax-parameters) | + +#### Refund tax parameters #### + +| Parameter | Type | Description | +|----------------|---------|----------------------------------------------------------------| +| `id` | integer | The ID of the tax rate. | +| `refund_total` | number | The amount of tax to refund for this line item. | + ## Retrieve a refund ## This API lets you retrieve and view a specific refund from an order. From 9288ae089a6ef4329bf570164fdc70aa86693540 Mon Sep 17 00:00:00 2001 From: Corey McKrill <916023+coreymckrill@users.noreply.github.com> Date: Tue, 9 Jul 2024 14:57:00 -0700 Subject: [PATCH 7/9] Clarifications about adding images to products Fixes https://github.com/woocommerce/woocommerce/issues/43647 --- source/includes/wp-api-v3/_products.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/source/includes/wp-api-v3/_products.md b/source/includes/wp-api-v3/_products.md index ad6ef11..6a61083 100644 --- a/source/includes/wp-api-v3/_products.md +++ b/source/includes/wp-api-v3/_products.md @@ -108,7 +108,7 @@ The products API allows you to create, view, update, and delete individual, or a | Attribute | Type | Description | |---------------------|-----------|---------------------------------------------------------------------------------------------------------| -| `id` | integer | Image ID. | +| `id` | integer | The attachment ID from the Media Library. | | `date_created` | date-time | The date the image was created, in the site's timezone. read-only | | `date_created_gmt` | date-time | The date the image was created, as GMT. read-only | | `date_modified` | date-time | The date the image was last modified, in the site's timezone. read-only | @@ -157,7 +157,7 @@ This API helps you to create a new product.
-> Example of how to create a `simple` product: +> Example of how to create a `simple` product with one existing image and one new image: ```shell curl -X POST https://example.com/wp-json/wc/v3/products \ @@ -179,7 +179,7 @@ curl -X POST https://example.com/wp-json/wc/v3/products \ ], "images": [ { - "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg" + "id": 42 }, { "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_back.jpg" @@ -205,7 +205,7 @@ const data = { ], images: [ { - src: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg" + id: 42 }, { src: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_back.jpg" @@ -240,7 +240,7 @@ $data = [ ], 'images' => [ [ - 'src' => 'http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg' + 'id': 42 ], [ 'src' => 'http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_back.jpg' @@ -269,7 +269,7 @@ data = { ], "images": [ { - "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg" + "id": 42 }, { "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_back.jpg" @@ -297,7 +297,7 @@ data = { ], images: [ { - src: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg" + id: 42 }, { src: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_back.jpg", @@ -393,11 +393,11 @@ woocommerce.post("products", data).parsed_response "tags": [], "images": [ { - "id": 792, - "date_created": "2017-03-23T14:01:13", - "date_created_gmt": "2017-03-23T20:01:13", - "date_modified": "2017-03-23T14:01:13", - "date_modified_gmt": "2017-03-23T20:01:13", + "id": 42, + "date_created": "2017-03-22T14:01:13", + "date_created_gmt": "2017-03-22T20:01:13", + "date_modified": "2017-03-22T14:01:13", + "date_modified_gmt": "2017-03-22T20:01:13", "src": "https://example.com/wp-content/uploads/2017/03/T_2_front-4.jpg", "name": "", "alt": "" From 1a81bbbd0a79eba5f0c92b7391ad116497a6aebb Mon Sep 17 00:00:00 2001 From: Corey McKrill <916023+coreymckrill@users.noreply.github.com> Date: Tue, 9 Jul 2024 15:08:59 -0700 Subject: [PATCH 8/9] Update enums for orderby params Fixes https://github.com/woocommerce/woocommerce/issues/35619 --- source/includes/wp-api-v3/_coupons.md | 4 +- source/includes/wp-api-v3/_order-refunds.md | 2 +- source/includes/wp-api-v3/_orders.md | 42 ++++++------ .../includes/wp-api-v3/_product-variations.md | 2 +- source/includes/wp-api-v3/_products.md | 66 +++++++++---------- source/includes/wp-api-v3/_refunds.md | 2 +- source/includes/wp-api-v3/_webhooks.md | 26 ++++---- 7 files changed, 72 insertions(+), 72 deletions(-) diff --git a/source/includes/wp-api-v3/_coupons.md b/source/includes/wp-api-v3/_coupons.md index 1eadbf0..50777b1 100644 --- a/source/includes/wp-api-v3/_coupons.md +++ b/source/includes/wp-api-v3/_coupons.md @@ -393,7 +393,7 @@ woocommerce.get("coupons").parsed_response #### Available parameters #### | Parameter | Type | Description | -| ----------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------- | +| ----------------- | ------- |------------------------------------------------------------------------------------------------------------------------------| | `context` | string | Scope under which the request is made; determines fields present in response. Options: `view` and `edit`. Default is `view`. | | `page` | integer | Current page of the collection. Default is `1`. | | `per_page` | integer | Maximum number of items to be returned in result set. Default is `10`. | @@ -407,7 +407,7 @@ woocommerce.get("coupons").parsed_response | `include` | array | Limit result set to specific ids. | | `offset` | integer | Offset the result set by a specific number of items. | | `order` | string | Order sort attribute ascending or descending. Options: `asc` and `desc`. Default is `desc`. | -| `orderby` | string | Sort collection by object attribute. Options: `date`, `id`, `include`, `title` and `slug`. Default is `date`. | +| `orderby` | string | Sort collection by object attribute. Options: `date`, `modified`, `id`, `include`, `title` and `slug`. Default is `date`. | | `code` | string | Limit result set to resources with a specific code. | ## Update a coupon ## diff --git a/source/includes/wp-api-v3/_order-refunds.md b/source/includes/wp-api-v3/_order-refunds.md index b6bfae1..fcdaf81 100644 --- a/source/includes/wp-api-v3/_order-refunds.md +++ b/source/includes/wp-api-v3/_order-refunds.md @@ -484,7 +484,7 @@ woocommerce.get("orders/723/refunds").parsed_response | `include` | array | Limit result set to specific ids. | | `offset` | integer | Offset the result set by a specific number of items. | | `order` | string | Order sort attribute ascending or descending. Options: `asc` and `desc`. Default is `desc`. | -| `orderby` | string | Sort collection by object attribute. Options: `date`, `id`, `include`, `title` and `slug`. Default is `date`. | +| `orderby` | string | Sort collection by object attribute. Options: `date`, `modified`, `id`, `include`, `title` and `slug`. Default is `date`. | | `parent` | array | Limit result set to those of particular parent IDs. | | `parent_exclude` | array | Limit result set to all items except those of a particular parent ID. | | `dp` | integer | Number of decimal points to use in each resource. Default is `2`. | diff --git a/source/includes/wp-api-v3/_orders.md b/source/includes/wp-api-v3/_orders.md index 93a7ac8..e94b51e 100644 --- a/source/includes/wp-api-v3/_orders.md +++ b/source/includes/wp-api-v3/_orders.md @@ -1174,28 +1174,28 @@ woocommerce.get("orders").parsed_response #### Available parameters #### -| Parameter | Type | Description | -|-------------------|---------|------------------------------------------------------------------------------------------------------------------------------------------| -| `context` | string | Scope under which the request is made; determines fields present in response. Options: `view` and `edit`. Default is `view`. | -| `page` | integer | Current page of the collection. Default is `1`. | -| `per_page` | integer | Maximum number of items to be returned in result set. Default is `10`. | -| `search` | string | Limit results to those matching a string. | -| `after` | string | Limit response to resources published after a given ISO8601 compliant date. | -| `before` | string | Limit response to resources published before a given ISO8601 compliant date. | -| `modified_after` | string | Limit response to resources modified after a given ISO8601 compliant date. | -| `modified_before` | string | Limit response to resources modified after a given ISO8601 compliant date. | -| `dates_are_gmt` | boolean | Whether to consider GMT post dates when limiting response by published or modified date. | -| `exclude` | array | Ensure result set excludes specific IDs. | -| `include` | array | Limit result set to specific ids. | -| `offset` | integer | Offset the result set by a specific number of items. | -| `order` | string | Order sort attribute ascending or descending. Options: `asc` and `desc`. Default is `desc`. | -| `orderby` | string | Sort collection by object attribute. Options: `date`, `id`, `include`, `title` and `slug`. Default is `date`. | -| `parent` | array | Limit result set to those of particular parent IDs. | -| `parent_exclude` | array | Limit result set to all items except those of a particular parent ID. | +| Parameter | Type | Description | +|-------------------|---------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `context` | string | Scope under which the request is made; determines fields present in response. Options: `view` and `edit`. Default is `view`. | +| `page` | integer | Current page of the collection. Default is `1`. | +| `per_page` | integer | Maximum number of items to be returned in result set. Default is `10`. | +| `search` | string | Limit results to those matching a string. | +| `after` | string | Limit response to resources published after a given ISO8601 compliant date. | +| `before` | string | Limit response to resources published before a given ISO8601 compliant date. | +| `modified_after` | string | Limit response to resources modified after a given ISO8601 compliant date. | +| `modified_before` | string | Limit response to resources modified after a given ISO8601 compliant date. | +| `dates_are_gmt` | boolean | Whether to consider GMT post dates when limiting response by published or modified date. | +| `exclude` | array | Ensure result set excludes specific IDs. | +| `include` | array | Limit result set to specific ids. | +| `offset` | integer | Offset the result set by a specific number of items. | +| `order` | string | Order sort attribute ascending or descending. Options: `asc` and `desc`. Default is `desc`. | +| `orderby` | string | Sort collection by object attribute. Options: `date`, `modified`, `id`, `include`, `title` and `slug`. Default is `date`. | +| `parent` | array | Limit result set to those of particular parent IDs. | +| `parent_exclude` | array | Limit result set to all items except those of a particular parent ID. | | `status` | array | Limit result set to orders assigned a specific status. Options: `any`, `pending`, `processing`, `on-hold`, `completed`, `cancelled`, `refunded`, `failed` and `trash`. Default is `any`. | -| `customer` | integer | Limit result set to orders assigned a specific customer. | -| `product` | integer | Limit result set to orders assigned a specific product. | -| `dp` | integer | Number of decimal points to use in each resource. Default is `2`. | +| `customer` | integer | Limit result set to orders assigned a specific customer. | +| `product` | integer | Limit result set to orders assigned a specific product. | +| `dp` | integer | Number of decimal points to use in each resource. Default is `2`. | ## Update an Order ## diff --git a/source/includes/wp-api-v3/_product-variations.md b/source/includes/wp-api-v3/_product-variations.md index 84ec850..1cdf5e3 100644 --- a/source/includes/wp-api-v3/_product-variations.md +++ b/source/includes/wp-api-v3/_product-variations.md @@ -619,7 +619,7 @@ woocommerce.get("products/22/variations").parsed_response | `include` | array | Limit result set to specific ids. | | `offset` | integer | Offset the result set by a specific number of items. | | `order` | string | Order sort attribute ascending or descending. Options: `asc` and `desc`. Default is `desc`. | -| `orderby` | string | Sort collection by object attribute. Options: `date`, `id`, `include`, `title` and `slug`. Default is `date`. | +| `orderby` | string | Sort collection by object attribute. Options: `date`, `modified`, `id`, `include`, `title` and `slug`. Default is `date`. | | `parent` | array | Limit result set to those of particular parent IDs. | | `parent_exclude` | array | Limit result set to all items except those of a particular parent ID. | | `slug` | string | Limit result set to products with a specific slug. | diff --git a/source/includes/wp-api-v3/_products.md b/source/includes/wp-api-v3/_products.md index 6a61083..326123a 100644 --- a/source/includes/wp-api-v3/_products.md +++ b/source/includes/wp-api-v3/_products.md @@ -1461,39 +1461,39 @@ woocommerce.get("products").parsed_response #### Available parameters #### -| Parameter | Type | Description | -|-------------------|---------|-----------------------------------------------------------------------------------------------------------------------------------------| -| `context` | string | Scope under which the request is made; determines fields present in response. Options: `view` and `edit`. Default is `view`. | -| `page` | integer | Current page of the collection. Default is `1`. | -| `per_page` | integer | Maximum number of items to be returned in result set. Default is `10`. | -| `search` | string | Limit results to those matching a string. | -| `after` | string | Limit response to resources published after a given ISO8601 compliant date. | -| `before` | string | Limit response to resources published before a given ISO8601 compliant date. | -| `modified_after` | string | Limit response to resources modified after a given ISO8601 compliant date. | -| `modified_before` | string | Limit response to resources modified after a given ISO8601 compliant date. | -| `dates_are_gmt` | boolean | Whether to consider GMT post dates when limiting response by published or modified date. | -| `exclude` | array | Ensure result set excludes specific IDs. | -| `include` | array | Limit result set to specific ids. | -| `offset` | integer | Offset the result set by a specific number of items. | -| `order` | string | Order sort attribute ascending or descending. Options: `asc` and `desc`. Default is `desc`. | -| `orderby` | string | Sort collection by object attribute. Options: `date`, `id`, `include`, `title`, `slug`, `price`, `popularity` and `rating`. Default is `date`. | -| `parent` | array | Limit result set to those of particular parent IDs. | -| `parent_exclude` | array | Limit result set to all items except those of a particular parent ID. | -| `slug` | string | Limit result set to products with a specific slug. | -| `status` | string | Limit result set to products assigned a specific status. Options: `any`, `draft`, `pending`, `private` and `publish`. Default is `any`. | -| `type` | string | Limit result set to products assigned a specific type. Options: `simple`, `grouped`, `external` and `variable`. | -| `sku` | string | Limit result set to products with a specific SKU. | -| `featured` | boolean | Limit result set to featured products. | -| `category` | string | Limit result set to products assigned a specific category ID. | -| `tag` | string | Limit result set to products assigned a specific tag ID. | -| `shipping_class` | string | Limit result set to products assigned a specific shipping class ID. | -| `attribute` | string | Limit result set to products with a specific attribute. | -| `attribute_term` | string | Limit result set to products with a specific attribute term ID (required an assigned attribute). | -| `tax_class` | string | Limit result set to products with a specific tax class. Default options: `standard`, `reduced-rate` and `zero-rate`. | -| `on_sale` | boolean | Limit result set to products on sale. | -| `min_price` | string | Limit result set to products based on a minimum price. | -| `max_price` | string | Limit result set to products based on a maximum price. | -| `stock_status` | string | Limit result set to products with specified stock status. Options: `instock`, `outofstock` and `onbackorder`. | +| Parameter | Type | Description | +|-------------------|---------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `context` | string | Scope under which the request is made; determines fields present in response. Options: `view` and `edit`. Default is `view`. | +| `page` | integer | Current page of the collection. Default is `1`. | +| `per_page` | integer | Maximum number of items to be returned in result set. Default is `10`. | +| `search` | string | Limit results to those matching a string. | +| `after` | string | Limit response to resources published after a given ISO8601 compliant date. | +| `before` | string | Limit response to resources published before a given ISO8601 compliant date. | +| `modified_after` | string | Limit response to resources modified after a given ISO8601 compliant date. | +| `modified_before` | string | Limit response to resources modified after a given ISO8601 compliant date. | +| `dates_are_gmt` | boolean | Whether to consider GMT post dates when limiting response by published or modified date. | +| `exclude` | array | Ensure result set excludes specific IDs. | +| `include` | array | Limit result set to specific ids. | +| `offset` | integer | Offset the result set by a specific number of items. | +| `order` | string | Order sort attribute ascending or descending. Options: `asc` and `desc`. Default is `desc`. | +| `orderby` | string | Sort collection by object attribute. Options: `date`, `modified`, `id`, `include`, `title`, `slug`, `price`, `popularity`, `rating`, and `menu_order`. Default is `date`. | +| `parent` | array | Limit result set to those of particular parent IDs. | +| `parent_exclude` | array | Limit result set to all items except those of a particular parent ID. | +| `slug` | string | Limit result set to products with a specific slug. | +| `status` | string | Limit result set to products assigned a specific status. Options: `any`, `draft`, `pending`, `private` and `publish`. Default is `any`. | +| `type` | string | Limit result set to products assigned a specific type. Options: `simple`, `grouped`, `external` and `variable`. | +| `sku` | string | Limit result set to products with a specific SKU. | +| `featured` | boolean | Limit result set to featured products. | +| `category` | string | Limit result set to products assigned a specific category ID. | +| `tag` | string | Limit result set to products assigned a specific tag ID. | +| `shipping_class` | string | Limit result set to products assigned a specific shipping class ID. | +| `attribute` | string | Limit result set to products with a specific attribute. | +| `attribute_term` | string | Limit result set to products with a specific attribute term ID (required an assigned attribute). | +| `tax_class` | string | Limit result set to products with a specific tax class. Default options: `standard`, `reduced-rate` and `zero-rate`. | +| `on_sale` | boolean | Limit result set to products on sale. | +| `min_price` | string | Limit result set to products based on a minimum price. | +| `max_price` | string | Limit result set to products based on a maximum price. | +| `stock_status` | string | Limit result set to products with specified stock status. Options: `instock`, `outofstock` and `onbackorder`. | ## Update a product ## diff --git a/source/includes/wp-api-v3/_refunds.md b/source/includes/wp-api-v3/_refunds.md index a68644a..a4cd2b4 100644 --- a/source/includes/wp-api-v3/_refunds.md +++ b/source/includes/wp-api-v3/_refunds.md @@ -152,7 +152,7 @@ woocommerce.get("refunds").parsed_response | `include` | array | Limit result set to specific ids. | | `offset` | integer | Offset the result set by a specific number of items. | | `order` | string | Order sort attribute ascending or descending. Options: `asc` and `desc`. Default is `desc`. | -| `orderby` | string | Sort collection by object attribute. Options: `date`, `id`, `include`, `title` and `slug`. Default is `date`. | +| `orderby` | string | Sort collection by object attribute. Options: `date`, `modified`, `id`, `include`, `title` and `slug`. Default is `date`. | | `parent` | array | Limit result set to those of particular parent IDs. | | `parent_exclude` | array | Limit result set to all items except those of a particular parent ID. | | `dp` | integer | Number of decimal points to use in each resource. Default is `2`. | diff --git a/source/includes/wp-api-v3/_webhooks.md b/source/includes/wp-api-v3/_webhooks.md index 57d1d39..69ab75f 100644 --- a/source/includes/wp-api-v3/_webhooks.md +++ b/source/includes/wp-api-v3/_webhooks.md @@ -366,19 +366,19 @@ woocommerce.get("webhooks").parsed_response #### Available parameters #### -| Parameter | Type | Description | -| ---------- | ------- | ----------------------------------------------------------------------------------------------------------------------------- | -| `context` | string | Scope under which the request is made; determines fields present in response. Options: `view` and `edit`. Default is `view`. | -| `page` | integer | Current page of the collection. Default is `1`. | -| `per_page` | integer | Maximum number of items to be returned in result set. Default is `10`. | -| `search` | string | Limit results to those matching a string. | -| `after` | string | Limit response to resources published after a given ISO8601 compliant date. | -| `before` | string | Limit response to resources published before a given ISO8601 compliant date. | -| `exclude` | array | Ensure result set excludes specific IDs. | -| `include` | array | Limit result set to specific ids. | -| `offset` | integer | Offset the result set by a specific number of items. | -| `order` | string | Order sort attribute ascending or descending. Options: `asc` and `desc`. Default is `desc`. | -| `orderby` | string | Sort collection by object attribute. Options: `date`, `id`, `include`, `title` and `slug`. Default is `date`. | +| Parameter | Type | Description | +| ---------- | ------- |------------------------------------------------------------------------------------------------------------------------------| +| `context` | string | Scope under which the request is made; determines fields present in response. Options: `view` and `edit`. Default is `view`. | +| `page` | integer | Current page of the collection. Default is `1`. | +| `per_page` | integer | Maximum number of items to be returned in result set. Default is `10`. | +| `search` | string | Limit results to those matching a string. | +| `after` | string | Limit response to resources published after a given ISO8601 compliant date. | +| `before` | string | Limit response to resources published before a given ISO8601 compliant date. | +| `exclude` | array | Ensure result set excludes specific IDs. | +| `include` | array | Limit result set to specific ids. | +| `offset` | integer | Offset the result set by a specific number of items. | +| `order` | string | Order sort attribute ascending or descending. Options: `asc` and `desc`. Default is `desc`. | +| `orderby` | string | Sort collection by object attribute. Options: `date`, `id`, and `title`. Default is `date`. | | `status` | string | Limit result set to webhooks assigned a specific status. Options: `all`, `active`, `paused` and `disabled`. Default is `all`. | ## Update a webhook ## From 849b30665e07a60e51e16d8d3b3fd297c14460bf Mon Sep 17 00:00:00 2001 From: Corey McKrill <916023+coreymckrill@users.noreply.github.com> Date: Thu, 11 Jul 2024 09:41:42 -0700 Subject: [PATCH 9/9] Fix grammar in compound tax rate descriptions --- source/includes/wp-api-v3/_order-refunds.md | 2 +- source/includes/wp-api-v3/_orders.md | 2 +- source/includes/wp-api-v3/_taxes.md | 30 ++++++++++----------- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/source/includes/wp-api-v3/_order-refunds.md b/source/includes/wp-api-v3/_order-refunds.md index fcdaf81..57a8b65 100644 --- a/source/includes/wp-api-v3/_order-refunds.md +++ b/source/includes/wp-api-v3/_order-refunds.md @@ -64,7 +64,7 @@ The order refunds API allows you to create, view, and delete individual refunds, | `rate_code` | string | Tax rate code. read-only | | `rate_id` | integer | Tax rate ID. read-only | | `label` | string | Tax rate label. read-only | -| `compound` | boolean | Show if is a compound tax rate. read-only | +| `compound` | boolean | Whether or not this is a compound tax rate. read-only | | `tax_total` | string | Tax total (not including shipping taxes). read-only | | `shipping_tax_total` | string | Shipping tax total. read-only | | `meta_data` | array | Meta data. See [Order refund - Meta data properties](#order-refund-meta-data-properties) | diff --git a/source/includes/wp-api-v3/_orders.md b/source/includes/wp-api-v3/_orders.md index e94b51e..e3dc650 100644 --- a/source/includes/wp-api-v3/_orders.md +++ b/source/includes/wp-api-v3/_orders.md @@ -114,7 +114,7 @@ The orders API allows you to create, view, update, and delete individual, or a b | `rate_code` | string | Tax rate code. read-only | | `rate_id` | integer | Tax rate ID. read-only | | `label` | string | Tax rate label. read-only | -| `compound` | boolean | Show if is a compound tax rate. read-only | +| `compound` | boolean | Whether or not this is a compound tax rate. read-only | | `tax_total` | string | Tax total (not including shipping taxes). read-only | | `shipping_tax_total` | string | Shipping tax total. read-only | | `meta_data` | array | Meta data. See [Order - Meta data properties](#order-meta-data-properties) | diff --git a/source/includes/wp-api-v3/_taxes.md b/source/includes/wp-api-v3/_taxes.md index 7990049..ade4672 100644 --- a/source/includes/wp-api-v3/_taxes.md +++ b/source/includes/wp-api-v3/_taxes.md @@ -4,22 +4,22 @@ The taxes API allows you to create, view, update, and delete individual tax rate ## Tax rate properties ## -| Attribute | Type | Description | -|------------|---------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `id` | integer | Unique identifier for the resource. read-only | -| `country` | string | Country ISO 3166 code. See [ISO 3166 Codes (Countries)](http://www.chemie.fu-berlin.de/diverse/doc/ISO_3166.html) for more details | -| `state` | string | State code. | -| `postcode` | string | Postcode/ZIP, it doesn't support multiple values. Deprecated as of WooCommerce 5.3, `postcodes` should be used instead. | -| `city` | string | City name, it doesn't support multiple values. Deprecated as of WooCommerce 5.3, `postcodes` should be used instead. | -| `postcodes`| string[] | Postcodes/ZIPs. Introduced in WooCommerce 5.3. | -| `cities` | string[] | City names. Introduced in WooCommerce 5.3. | -| `rate` | string | Tax rate. | -| `name` | string | Tax rate name. | +| Attribute | Type | Description | +|------------|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `id` | integer | Unique identifier for the resource. read-only | +| `country` | string | Country ISO 3166 code. See [ISO 3166 Codes (Countries)](http://www.chemie.fu-berlin.de/diverse/doc/ISO_3166.html) for more details | +| `state` | string | State code. | +| `postcode` | string | Postcode/ZIP, it doesn't support multiple values. Deprecated as of WooCommerce 5.3, `postcodes` should be used instead. | +| `city` | string | City name, it doesn't support multiple values. Deprecated as of WooCommerce 5.3, `postcodes` should be used instead. | +| `postcodes`| string[] | Postcodes/ZIPs. Introduced in WooCommerce 5.3. | +| `cities` | string[] | City names. Introduced in WooCommerce 5.3. | +| `rate` | string | Tax rate. | +| `name` | string | Tax rate name. | | `priority` | integer | Tax priority. Only 1 matching rate per priority will be used. To define multiple tax rates for a single area you need to specify a different priority per rate. Default is `1`. | -| `compound` | boolean | Whether or not this is a compound rate. Compound tax rates are applied on top of other tax rates. Default is `false`. | -| `shipping` | boolean | Whether or not this tax rate also gets applied to shipping. Default is `true`. | -| `order` | integer | Indicates the order that will appear in queries. | -| `class` | string | Tax class. Default is `standard`. | +| `compound` | boolean | Whether or not this is a compound tax rate. Compound rates are applied on top of other tax rates. Default is `false`. | +| `shipping` | boolean | Whether or not this tax rate also gets applied to shipping. Default is `true`. | +| `order` | integer | Indicates the order that will appear in queries. | +| `class` | string | Tax class. Default is `standard`. | ## Create a tax rate ##