POST

Cancel Order


Cancels an order. The order.status field changes to CANCELED.

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/orders/{id}/cancel

Path Params
idstringRequired

Order ID.

Body Params
sendOrderCanceledEmailboolean

Whether to send an order canceled email to the buyer.


customMessagestringminLength 1maxLength 1000

Custom note to be added to the email (optional).


restockAllItemsboolean

Whether to restock all items in the order. This will only apply to products in the Wix Stores inventory.

Response Object
orderOrder

Canceled order.

Cancel Order

Cancels an order, sends order cancellation email with custom message, and restocks all items

Request
cURL
curl -X POST \ 'https://www.wixapis.com/ecom/v1/orders/7001d34b-11a6-4a34-8746-dc8ababeca42/cancel' \ -H 'Content-Type: application/json' \ -H 'Authorization: <AUTH>' \ --data-binary '{ "sendOrderCanceledEmail": true, "customMessage": "Canceled due to incorrect quantity ordered", "restockAllItems": true }'
Response
JSON
{ "order": { "id": "7001d34b-11a6-4a34-8746-dc8ababeca42", "number": "10012", "createdDate": "2023-03-07T10:24:03.380Z", "updatedDate": "2023-09-10T11:19:33.792Z", "lineItems": [ { "id": "00000000-0000-0000-0000-000000000001", "productName": { "original": "Shoe", "translated": "Shoe" }, "catalogReference": { "catalogItemId": "df19c1f7-07d8-a265-42f8-e8dfa824cc6e", "appId": "215238eb-22a5-4c36-9e7b-e7c08025e04e", "options": { "options": { "Color": "Brown" }, "variantId": "2f430d69-9b75-4874-bfbd-c5f6fa5aff3d" } }, "quantity": 1, "totalDiscount": { "amount": "0", "formattedAmount": "$0.00" }, "descriptionLines": [ { "name": { "original": "Color", "translated": "Color" }, "colorInfo": { "original": "Brown", "translated": "Brown" } } ], "image": { "id": "3c76e2_bf235c38610f4d2a905db71095b351cf~mv2.jpg", "url": "https://static.wixstatic.com/media/3c76e2_bf235c38610f4d2a905db71095b351cf~mv2.jpg/v1/fit/w_1000,h_1000,q_90/file.jpg", "height": 1000, "width": 1000 }, "physicalProperties": { "sku": "364215376135191", "shippable": true }, "itemType": { "preset": "PHYSICAL" }, "refundQuantity": 0, "restockQuantity": 1, "price": { "amount": "85.00", "formattedAmount": "$85.00" }, "priceBeforeDiscounts": { "amount": "85.00", "formattedAmount": "$85.00" }, "totalPriceBeforeTax": { "amount": "85.00", "formattedAmount": "$85.00" }, "totalPriceAfterTax": { "amount": "85.00", "formattedAmount": "$85.00" }, "paymentOption": "FULL_PAYMENT_ONLINE", "taxDetails": { "taxableAmount": { "amount": "85.00", "formattedAmount": "$85.00" }, "taxRate": "0.0", "totalTax": { "amount": "0.0", "formattedAmount": "$0.00" } } }, { "id": "00000000-0000-0000-0000-000000000002", "productName": { "original": "Watch", "translated": "Watch" }, "catalogReference": { "catalogItemId": "1a2d7e83-4bef-31d5-09e1-3326ee271c09", "appId": "215238eb-22a5-4c36-9e7b-e7c08025e04e", "options": { "options": { "Size": "Large", "Color": "Black" }, "variantId": "63f56c6d-8dcb-491c-8e06-0220b3cd89f2" } }, "quantity": 1, "totalDiscount": { "amount": "0", "formattedAmount": "$0.00" }, "descriptionLines": [ { "name": { "original": "Size", "translated": "Size" }, "plainText": { "original": "Large", "translated": "Large" } }, { "name": { "original": "Color", "translated": "Color" }, "colorInfo": { "original": "Black", "translated": "Black" } } ], "image": { "id": "3c76e2_8891bbe3372a428aac976ac59aa0ac74~mv2.jpg", "url": "https://static.wixstatic.com/media/3c76e2_8891bbe3372a428aac976ac59aa0ac74~mv2.jpg/v1/fit/w_1000,h_1000,q_90/file.jpg", "height": 1000, "width": 1000 }, "physicalProperties": { "sku": "217537123517253", "shippable": true }, "itemType": { "preset": "PHYSICAL" }, "refundQuantity": 0, "restockQuantity": 1, "price": { "amount": "35.00", "formattedAmount": "$35.00" }, "priceBeforeDiscounts": { "amount": "35.00", "formattedAmount": "$35.00" }, "totalPriceBeforeTax": { "amount": "35.00", "formattedAmount": "$35.00" }, "totalPriceAfterTax": { "amount": "35.00", "formattedAmount": "$35.00" }, "paymentOption": "FULL_PAYMENT_ONLINE", "taxDetails": { "taxableAmount": { "amount": "35.00", "formattedAmount": "$35.00" }, "taxRate": "0.0", "totalTax": { "amount": "0.0", "formattedAmount": "$0.00" } } }, { "id": "00000000-0000-0000-0000-000000000003", "productName": { "original": "Shirt", "translated": "Shirt" }, "catalogReference": { "catalogItemId": "c8539b66-7a44-fe18-affc-afec4be8562a", "appId": "215238eb-22a5-4c36-9e7b-e7c08025e04e", "options": { "options": {}, "variantId": "00000000-0000-0000-0000-000000000000" } }, "quantity": 1, "totalDiscount": { "amount": "10.0", "formattedAmount": "$10.00" }, "descriptionLines": [], "image": { "id": "3c76e2_c5331f937348492a97df87b0a3b34ea4~mv2.jpg", "url": "https://static.wixstatic.com/media/3c76e2_c5331f937348492a97df87b0a3b34ea4~mv2.jpg/v1/fit/w_1000,h_1000,q_90/file.jpg", "height": 1000, "width": 1000 }, "physicalProperties": { "sku": "364115376135191", "shippable": true }, "itemType": { "preset": "PHYSICAL" }, "refundQuantity": 0, "restockQuantity": 1, "price": { "amount": "10.00", "formattedAmount": "$10.00" }, "priceBeforeDiscounts": { "amount": "10.00", "formattedAmount": "$10.00" }, "totalPriceBeforeTax": { "amount": "0.00", "formattedAmount": "$0.00" }, "totalPriceAfterTax": { "amount": "0.00", "formattedAmount": "$0.00" }, "paymentOption": "FULL_PAYMENT_ONLINE", "taxDetails": { "taxableAmount": { "amount": "0.0", "formattedAmount": "$0.00" }, "taxRate": "0.0", "totalTax": { "amount": "0.0", "formattedAmount": "$0.00" } } } ], "buyerInfo": { "contactId": "24de6f0b-60ce-4faa-9138-2e39f1415615", "email": "example@email.com", "visitorId": "887f5d8c-133d-413b-b8e7-097e58128bee" }, "paymentStatus": "PARTIALLY_PAID", "fulfillmentStatus": "NOT_FULFILLED", "buyerLanguage": "en", "weightUnit": "KG", "currency": "USD", "taxIncludedInPrices": false, "priceSummary": { "subtotal": { "amount": "130.00", "formattedAmount": "$130.00" }, "shipping": { "amount": "10.0", "formattedAmount": "$10.00" }, "tax": { "amount": "0.0", "formattedAmount": "$0.00" }, "discount": { "amount": "10.0", "formattedAmount": "$10.00" }, "total": { "amount": "130.00", "formattedAmount": "$130.00" }, "totalAdditionalFees": { "amount": "0", "formattedAmount": "$0.00" } }, "billingInfo": { "address": { "country": "US", "subdivision": "US-NY", "city": "New York", "postalCode": "10173", "addressLine": "525 5th Avenue", "countryFullname": "United States", "subdivisionFullname": "New York" }, "contactDetails": { "firstName": "Jane", "lastName": "Doe", "phone": "0555555555" } }, "shippingInfo": { "carrierId": "c8a08776-c095-4dec-8553-8f9698d86adc", "code": "ed5bbce2-9533-dff4-7db0-13702fd139c5", "title": "Standard US Shipping", "logistics": { "deliveryTime": "", "shippingDestination": { "address": { "country": "US", "subdivision": "US-NY", "city": "New York", "postalCode": "10173", "addressLine": "525 5th Avenue", "countryFullname": "United States", "subdivisionFullname": "New York" }, "contactDetails": { "firstName": "Jane", "lastName": "Doe", "phone": "0555555555" } } }, "cost": { "price": { "amount": "10", "formattedAmount": "$10.00" }, "totalPriceBeforeTax": { "amount": "10", "formattedAmount": "$10.00" }, "totalPriceAfterTax": { "amount": "10.0", "formattedAmount": "$10.00" }, "taxDetails": { "taxRate": "0.0", "totalTax": { "amount": "0.0", "formattedAmount": "$0.00" } }, "discount": { "amount": "0", "formattedAmount": "$0.00" } }, "region": { "name": "USA shipping" } }, "buyerNote": "Happy Birthday!", "status": "CANCELED", "archived": false, "taxSummary": { "totalTax": { "amount": "0.0", "formattedAmount": "$0.00" } }, "appliedDiscounts": [ { "discountType": "SPECIFIC_ITEMS", "lineItemIds": ["00000000-0000-0000-0000-000000000003"], "coupon": { "id": "fbb94b06-7447-4161-9c48-59bfcdc39e77", "code": "SUMMERSALE10", "name": "SUMMERSALE10", "amount": { "amount": "10.0", "formattedAmount": "$10.00" } } } ], "activities": [ { "createdDate": "2023-03-07T10:24:03.380Z", "type": "ORDER_PLACED" }, { "createdDate": "2023-03-07T10:24:56.406Z", "type": "TRACKING_NUMBER_ADDED" }, { "createdDate": "2023-03-07T10:24:56.406Z", "type": "TRACKING_LINK_ADDED" }, { "createdDate": "2023-03-07T10:25:22.889Z", "type": "ORDER_PARTIALLY_PAID" }, { "createdDate": "2023-03-07T11:51:48.321Z", "type": "TRACKING_NUMBER_ADDED" }, { "createdDate": "2023-03-07T11:51:48.321Z", "type": "TRACKING_LINK_ADDED" }, { "createdDate": "2023-09-10T11:19:33.792Z", "type": "ORDER_CANCELED" } ], "attributionSource": "UNSPECIFIED", "createdBy": { "visitorId": "887f5d8c-133d-413b-b8e7-097e58128bee" }, "channelInfo": { "type": "WEB" }, "seenByAHuman": true, "checkoutId": "d118aa97-1bcb-462e-9265-3603f6e07df6", "customFields": [], "cartId": "1e61e838-d3a0-4ab7-8348-b37d1d954919", "payNow": { "subtotal": { "amount": "130.00", "formattedAmount": "$130.00" }, "shipping": { "amount": "10.0", "formattedAmount": "$10.00" }, "tax": { "amount": "0.0", "formattedAmount": "$0.00" }, "discount": { "amount": "10.0", "formattedAmount": "$10.00" }, "total": { "amount": "130.00", "formattedAmount": "$130.00" } }, "balanceSummary": { "balance": { "amount": "10.00", "formattedAmount": "$10.00" }, "paid": { "amount": "120.0", "formattedAmount": "$120.00" }, "refunded": { "amount": "0", "formattedAmount": "$0.00" } }, "additionalFees": [] } }
Errors
428Failed Precondition

There are 3 errors with this status code.

This method may also return standard errors. Learn more about standard Wix errors.

Event TriggersThis method triggers the following events:
Did this help?