Cancel order
You can cancel an already placed order by executing the following request.
Warning: Depending on the cancellation setting it may be that an order can no longer be canceled. In this case an API exception is thrown.
AuthorizationbearerAuth
Authorization
bearerAuth API token as bearer token — you receive a test and a live token, there is no switch between them. See Setup → Authentication and Setup → Test mode.
In: header
Path Parameters
The ID of the resource.
Header Parameters
The API only responds with JSON — this header is mandatory on every request (see Setup → Headers).
"application/json"Value in
- "application/json"
Response Body
application/json
application/json
application/json
curl -X PUT "https://example.com/orders/0/cancel" \ -H "Accept: application/json"PUT /orders/1/cancel HTTP/1.1
{ "id": 71, "order_type": 1, "is_test": false, "has_pending_preparation_logo": false, "external_identifier": null, "external_reference": null, "number": null, "cost_centre": null, "state": "cancelled", "failure_message": null, "customer_locale": "en", "currency": "EUR", "total": 0, "subtotal": 0, "total_tax": 0, "total_items_price": 0, "shipping_total": 0, "discount_total": 0, "created_at": "2022-05-02T08:29:06+00:00", "updated_at": "2022-05-02T08:29:23+00:00", "cancelled_at": "2022-05-02T08:29:23+00:00", "ordered_at": "2022-05-02T08:29:06+00:00", "items": [], "customer": { "id": 67, "is_test": 0, "email": "[email protected]", "created_at": "2022-05-02T07:36:07+00:00", "updated_at": "2022-05-02T07:36:07+00:00" }, "shipping_address": { "id": 129, "is_test": 0, "company": null, "first_name": "Max", "last_name": "Mustermann", "city": "Köln1", "street1": "Am Wassermann 361", "street2": null, "zip": "508291", "phone": "0", "email": "[email protected]", "province_code": null, "country_code": "DE", "vat_in": null, "created_at": "2022-05-02T08:29:06+00:00", "updated_at": "2022-05-02T08:29:06+00:00" }, "billing_address": { "id": 130, "is_test": 0, "company": null, "first_name": "Max", "last_name": "Mustermann", "city": "Köln1", "street1": "Am Wassermann 361", "street2": null, "zip": "508291", "phone": "0", "email": "[email protected]", "province_code": null, "country_code": "DE", "vat_in": null, "created_at": "2022-05-02T08:29:06+00:00", "updated_at": "2022-05-02T08:29:06+00:00" }, "whitelabel_address": null, "payments": [ { "payment_method": { "id": 1, "name": "Invoice", "handle": "invoice", "created_at": "2022-04-28T14:31:05+00:00", "updated_at": "2022-04-28T14:31:05+00:00" } } ], "shipments": [ { "id": 73, "is_test": 0, "shipping_method": { "is_test": 0, "order_id": 71, "handle": "dolorem", "title": "neque", "price": 4.8 }, "tracking_number": null, "media": [], "order": 71, "created_at": "2022-05-02T08:29:06+00:00", "updated_at": "2022-05-02T08:29:23+00:00" } ]}Get order GET
Returns the order with `id` = **x**. **Expanding objects** Related objects can be expanded inline with the `expand` query parameter — all allowed values are listed on the parameter. See [Expanding Objects](/docs/checkout/2022-02-01/basic/expanding-objects).
List webhooks GET
You can configure webhook endpoints via the API to be notified about events that happen in Smake (how deliveries, retries and signatures work is described in [Basic Usage → Webhooks](/docs/checkout/2022-02-01/basic/webhooks)). > **Warning:** You can create up to 10 webhooks per event. ## Available Events Currently, these are all events you can listen to: * `order.completed` * `order.prepared` * `order.failed` * `order.cancelled` * `variant.completed` * `variant.failed` * `logo.completed` * `logo.failed` * `shipment.prepared` * `draft-order.checked` — a draft order passed the automatic checks * `draft-order.failed` — a draft order failed the automatic checks, see its `failure_message` * `merchant-variant.designer-condition.created` — the designer configuration of a variant was created * `merchant-variant.designer-condition.changed` — the designer configuration of a variant changed ## List Returns a collection of your webhooks.