POST /admin/api/{api_version}/orders/{order_id}/refunds/calculate.json
Caution
For multi-currency orders, the currency
property is required whenever the amount
property is provided. For more information, see Migrating to support multiple currencies.
Calculates refund transactions based on line items and shipping. When you want to create a refund, you should first use the calculate endpoint to generate accurate refund transactions. Specify the line items that are being refunded, their quantity and restock instructions, and whether you intend to refund shipping costs. If the restock instructions can't be met—for example, because you try to return more items than have been fulfilled—then the endpoint returns modified restock instructions. You can then use the response in the body of the request to create the actual refund.
The response includes a transactions
object with "kind": "suggested_refund"
, which must to be changed to "kind" : "refund"
for the refund to be accepted.
Servers
- https://{store_name}.myshopify.com
- {store_name}.myshopify.com
Path parameters
Name | Type | Required | Description |
---|---|---|---|
order_id |
String | Yes | |
api_version |
String | Yes |
Request headers
Name | Type | Required | Description |
---|---|---|---|
Content-Type |
String | Yes |
The media type of the request body.
Default value: "application/json" |
x-shopify-access-token |
String | No |
Request body fields
Name | Type | Required | Description |
---|---|---|---|
refund |
Object | No | |
refund.refund_line_items[] |
Array | No | |
refund.refund_line_items[].restock_type |
String | No | |
refund.refund_line_items[].quantity |
Number | No | |
refund.refund_line_items[].line_item_id |
Number | No | |
refund.shipping |
Object | No | |
refund.shipping.full_refund |
Boolean | No |
How to start integrating
- Add HTTP Task to your workflow definition.
- Search for the API you want to integrate with and click on the name.
- This loads the API reference documentation and prepares the Http request settings.
- Click Test request to test run your request to the API and see the API's response.