SmakeSmake API Docs
EndpointsOrders

Cancel order

PUT
/orders/{id}/cancel

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
AuthorizationBearer <token>

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

id*integer

The ID of the resource.

Header Parameters

Accept*"application/json"

The API only responds with JSON — this header is mandatory on every request (see Setup → Headers).

Default"application/json"

Value in

  • "application/json"

Response Body

application/json

application/json

application/json

Request example
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"    }  ]}