POST

Calculate Refund


Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Calculates refund amounts for a given list of an order's line items, shipping, and additional fees.

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage eCommerce - all permissions
Manage Stores - all permissions
Manage Orders
Manage Restaurants - all permissions
Learn more about app permissions.
Endpoint
POST
https://www.wixapis.com/ecom/v1/order-billing/calculate-refund

Body Params
orderIdstringRequiredformat GUID

Order ID.


refundItemsRefundItems

List of line items, shipping and additional fees to be calculated for refund.

Response Object
summarySummary

Aggregated summary of all items provided for refund.

This field is not returned when refund is not available for the given list of items.


calculatedRefundItemsCalculatedRefundItems

Calculated summary of each item provided for refund.


One Of
Choose one of the following parameters

availableboolean

Whether refund is available for the given list of items.


notAvailableNotAvailable

If the calculated refund is not available, this field contains error details and amounts for each item.

Calculate valid refund for 1 line item and 1 additional fee.

Request
cURL
curl -X POST \ 'https://www.wixapis.com/ecom/v1/order-billing/calculate-refund' \ -H 'Content-Type: application/json' \ -H 'Authorization: <AUTH>' \ --data-binary '{ "orderId": "585daa0c-08d2-42ae-bd6b-18fe59c75836", "refundItems": { "lineItems": [ { "lineItemId": "00000000-0000-0000-0000-000000000001", "quantity": 1 } ], "additionalFees": [ { "additionalFeeId": "d3d9cafb-9e2d-4dae-8129-091df0a6c24f", "amount": { "amount": "1" } } ] } }'
Response
JSON
{ "summary": { "total": { "amount": "23.00", "formattedAmount": "$23.00" }, "tax": { "amount": "2.00", "formattedAmount": "$2.00" }, "discount": { "amount": "0.00", "formattedAmount": "$0.00" }, "subtotal": { "amount": "21.00", "formattedAmount": "$21.00" }, "lineItemsSubtotal": { "amount": "20.00", "formattedAmount": "$20.00" }, "additionalFeesTotal": { "amount": "1", "formattedAmount": "$1.00" } }, "calculatedRefundItems": { "lineItems": [ { "item": { "lineItemId": "00000000-0000-0000-0000-000000000001", "quantity": 1 }, "summary": { "total": { "amount": "22.00", "formattedAmount": "$22.00" }, "tax": { "amount": "2.00", "formattedAmount": "$2.00" }, "discount": { "amount": "0.00", "formattedAmount": "$0.00" }, "subtotal": { "amount": "20.00", "formattedAmount": "$20.00" } } } ], "additionalFees": [ { "additionalFee": { "additionalFeeId": "d3d9cafb-9e2d-4dae-8129-091df0a6c24f", "amount": { "amount": "1", "formattedAmount": "" } }, "summary": { "total": { "amount": "1", "formattedAmount": "$1.00" }, "tax": { "amount": "0.00", "formattedAmount": "$0.00" }, "discount": { "amount": "0", "formattedAmount": "$0.00" }, "subtotal": { "amount": "1.00", "formattedAmount": "$1.00" } } } ] }, "available": true }
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?