SmakeSmake API Docs
EndpointsOrders

Get order

GET
/orders/{id}

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.

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.

Query Parameters

expand?string

Expand related objects inline. Several objects can be expanded at once by separating them with a comma; nested objects are addressed with a dot — see Expanding Objects. Allowed values:

  • order_typeExpand order type. You can show order type details here. /orders/1?expand=order_type
  • items.id_tagsExpand ID Tags for order item. You can show ID Tag details for order items here. /orders/1?expand=items.id_tags
  • items.variantExpand the variant details for order items. You can show the content of the variant for an order item. /orders/1?expand=items.variant
  • items.variant.views.customizations.resourceExpand variants customization resource. You can show the content customizations' resource of a variant for an order item. /orders/1?expand=items.variant.views.customizations.resource
  • disposition_orderExpand disposition order resource. You can show the content of the disposition order for an order. /orders/1?expand=disposition_order
  • disposition_order.production_ordersExpand production orders resource. You can show the content of the production orders for the disposition order. /orders/1?expand=disposition_order.production_orders
  • disposition_order.production_orders.productionExpand production resource. You can show the production details of a production order for the disposition order. /orders/1?expand=disposition_order.production_orders.production

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 GET "https://example.com/orders/0?expand=order_type" \  -H "Accept: application/json"

GET /orders/1 HTTP/1.1

{  "id": 1,  "order_type": 1,  "is_test": true,  "has_pending_preparation_logo": false,  "external_identifier": null,  "external_reference": "et",  "number": null,  "cost_centre": "lorem 12345",  "state": "completed",  "failure_message": null,  "customer_locale": "en",  "currency": "EUR",  "total": 57.2,  "subtotal": 52,  "total_tax": 5.2,  "total_items_price": 52.8,  "shipping_total": 4.4,  "discount_total": 0,  "created_at": "2017-09-27T10:10:59+00:00",  "updated_at": "2017-09-27T10:11:03+00:00",  "ordered_at": "2017-09-27T10:11:03+00:00",  "cancelled_at": null,  "items": [    {      "id": 1,      "is_test": 1,      "external_identifier": null,      "quantity": 4,      "total": 52.8,      "price": 12,      "total_tax": 4.8,      "tax_rate": 10,      "created_at": "2017-09-27T10:10:59+00:00",      "updated_at": "2017-09-27T10:11:03+00:00",      "cancelled_at": null,      "variant": 27,      "id_tags": [        1      ]    }  ],  "disposition_order": 54,  "customer": {    "id": 40,    "is_test": 1,    "email": "[email protected]",    "created_at": "2017-09-27T10:10:59+00:00",    "updated_at": "2017-09-27T10:11:03+00:00"  },  "shipping_address": {    "id": 45,    "is_test": 1,    "company": "MyCompany",    "first_name": "John",    "last_name": "John",    "city": "Anytown",    "street1": "123 Main St",    "street2": null,    "zip": "12345",    "phone": "12345 67890",    "email": "[email protected]",    "province_code": "NW",    "country_code": "DE",    "vat_in": null,    "created_at": "2017-09-27T10:10:59+00:00",    "updated_at": "2017-09-27T10:10:59+00:00"  },  "billing_address": {    "id": 44,    "is_test": 1,    "company": "MyCompany",    "first_name": "John",    "last_name": "Doe",    "city": "Anytown",    "street1": "123 Main St",    "street2": null,    "zip": "12345",    "phone": "12345 67890",    "email": "[email protected]",    "province_code": "NW",    "country_code": "DE",    "vat_in": null,    "created_at": "2017-09-27T10:10:59+00:00",    "updated_at": "2017-09-27T10:10:59+00:00"  },  "whitelabel_address": null,  "payments": [    {      "payment_method": {        "id": 1,        "name": "Rechnung",        "handle": "invoice",        "created_at": "2017-09-27T10:10:59+00:00",        "updated_at": "2017-09-27T10:10:59+00:00"      }    }  ],  "shipments": [    {      "id": 1,      "is_test": 1,      "shipping_method": {        "is_test": 1,        "order_id": 1,        "handle": "pickup",        "title": "Pickup",        "price": 0      },      "tracking_number": "2229446017085",      "media": [],      "order": 1,      "created_at": "2021-02-24T11:04:46+01:00",      "updated_at": "2021-02-25T11:35:50+01:00"    }  ]}

Create order POST

**Background processing** When you create an order, this happens asynchronously. You can use [Polling](/docs/checkout/2022-02-01/basic/polling) or [Webhooks](/docs/checkout/2022-02-01/basic/webhooks) for status updates. In this endpoint, a new product variant is created implicitly for every order item. There is always a reference on the [requested data](/docs/checkout/2022-02-01/basic/requested-data) in the variant object. You can also use all the design features from the design variant endpoint within the variant object within an order item. See [Design Variant](/docs/checkout/2022-02-01/endpoints/variants/designVariant). Therefore, you will already receive the new order `id` in the header for later reference. The current state of the asynchronous process is represented due the following states: | State | Meaning | |-------|---------| | `draft` | The initial state of a new order. | | `checking` | Order is processed automatically in background. For example images will be generated or downloaded or the variant will be designed. | | `failed` | Something went wrong during the checking process. The reason can be found in the `failure_message` attribute. For example, an image could not be downloaded. | | `preparing` | The order is processed manually by the producer. For example, digitalization tasks are in process. | | `prepared` | The manual process is finished and the production process is running. | | `cancelled` | The order is cancelled manually. | | `completed` | The production process is completed. The order will be delivered to the customer. | The response is a `202 Accepted` without a body: the `X-Identifier` header is the new generated order id for later reference, the `Location` header points to the background job. See the **Further post order examples** among the request examples: *Create order with designing a variant with media ids* and *Create order with own shipping documents*.

Cancel order PUT

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.