https://shopify.com/admin/api/2020-10/orders/{order_id}/refunds/calculate.jsonhttps://shopify.dev/docs/admin-api/rest/reference/orders/refund#calculate-2020-10
order_id
Specify how much shipping to refund. It has the following properties: full_refund: Whether to refund all remaining shipping. amount: Set a specific amount to refund for shipping. Takes precedence over full_refund.
A list of line item IDs, quantities to refund, and restock instructions. Each entry has the following properties: line_item_id: The ID of a line item to refund. quantity: The quantity to refund. restock_type: How this refund line item affects inventory levels. Valid values: no_restock: Refunding these items won't affect inventory. cancel: The items have not yet been fulfilled. The canceled quantity will be added back to the available count. The number of fulfillable units for this line item will decrease. return: The items were already delivered but will be returned to the merchant. The returned quantity will be added back to the available count. The number of fulfillable units for this line item will remain unchanged. location_id: The ID of the location where the items should be restocked. If location_id is not provided and the value of restock_type is return or cancel, then the endpoint returns a suitable location ID. already_stocked: Whether the item is already stocked at the location. If this is false, then creating the refund will connect the item to the location and start stocking it there.
The three-letter code (ISO 4217 format) for the currency used for the refund. Note: Required whenever the shipping amount property is provided.
{
"success": true,
"data": {
"id": "abc123",
"created_at": "2025-01-01T00:00:00Z"
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid request parameters"
}
}1curl --request POST \2 --url 'https://shopify.com/admin/api/2020-10/orders/{order_id}/refunds/calculate.json' \3 --header 'accept: application/json' \4 --header 'content-type: application/json'1{2 "success": true,3 "data": {4 "id": "abc123",5 "created_at": "2025-01-01T00:00:00Z"6 }7}https://shopify.com/admin/api/2020-10/orders/{order_id}/refunds/calculate.jsonhttps://shopify.dev/docs/admin-api/rest/reference/orders/refund#calculate-2020-10
order_id
Specify how much shipping to refund. It has the following properties: full_refund: Whether to refund all remaining shipping. amount: Set a specific amount to refund for shipping. Takes precedence over full_refund.
A list of line item IDs, quantities to refund, and restock instructions. Each entry has the following properties: line_item_id: The ID of a line item to refund. quantity: The quantity to refund. restock_type: How this refund line item affects inventory levels. Valid values: no_restock: Refunding these items won't affect inventory. cancel: The items have not yet been fulfilled. The canceled quantity will be added back to the available count. The number of fulfillable units for this line item will decrease. return: The items were already delivered but will be returned to the merchant. The returned quantity will be added back to the available count. The number of fulfillable units for this line item will remain unchanged. location_id: The ID of the location where the items should be restocked. If location_id is not provided and the value of restock_type is return or cancel, then the endpoint returns a suitable location ID. already_stocked: Whether the item is already stocked at the location. If this is false, then creating the refund will connect the item to the location and start stocking it there.
The three-letter code (ISO 4217 format) for the currency used for the refund. Note: Required whenever the shipping amount property is provided.
{
"success": true,
"data": {
"id": "abc123",
"created_at": "2025-01-01T00:00:00Z"
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid request parameters"
}
}1curl --request POST \2 --url 'https://shopify.com/admin/api/2020-10/orders/{order_id}/refunds/calculate.json' \3 --header 'accept: application/json' \4 --header 'content-type: application/json'1{2 "success": true,3 "data": {4 "id": "abc123",5 "created_at": "2025-01-01T00:00:00Z"6 }7}