Cancel an order
PUT /stores/{storeResourceId}/orders/{resourceId}/actions/cancel_order
/stores/{storeResourceId}/orders/{resourceId}/actions/cancel_orderSets the order to cancelled and stores the cancelled_at date you send (empty if you omit it).
When to use: When the shopper or the shop cancels the order before delivery. Pair it with an automation with an order cancelled trigger to tell the customer.
When not to use: If the money was returned after payment, use refund_order.
Side effects: Starts the automations with an order cancelled trigger (create_trigger_order_cancelled) and adds an entry to the activity of the member. The API does not check the current status of the order: calling it on an order in another status is accepted and fires the order cancelled automations and the activity entry again. It does not stop the abandoned-cart or payment-reminder automations already waiting on the order.
Permissions: Requires the manager role or higher, or the marketing.audiences.write capability.
Value for the X-Auth-Token header parameter.
In: header
Path Parameters
Identifier (resource_id) of the store the order belongs to.
Identifier (resource_id) of the order: the one you chose when you created it.
The updated OrderResource resource
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/problem+json
application/problem+json
application/problem+json
application/problem+json
curl -X PUT "https://api.easymailing.com/stores/acme-shop/orders/order-5001/actions/cancel_order" \ -H "X-Auth-Token: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "cancelled_at": "2019-08-24T14:15:22Z" }'{ "resource_id": "string", "currency": "string", "currency_exchange_rate": 0.1, "order_total": 0, "tax_total": 0, "discount_total": 0, "shipping_total": 0, "checkout_url": "http://example.com", "status": "cart", "order_number": "string", "tracking_number": "string", "tracking_carrier": "string", "tracking_url": "http://example.com", "abandoned_cart_at": "2019-08-24T14:15:22Z", "processed_at": "2019-08-24T14:15:22Z", "paid_at": "2019-08-24T14:15:22Z", "cancelled_at": "2019-08-24T14:15:22Z", "campaign_hash": "string", "order_items": [ { "quantity": 1, "price": 0, "discount": 0, "variant": "/entity/1" } ], "customer": "/entity/1", "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z"}