This is the documentation for 2021-02-23 but the latest version is 2022-02-01. You can switch versions in the menu.

Orders

An order is created when the checkout process is complete.

Expandable Objects

The following ressources can be expanded by adding the mentioned query paramters to your request

Expand Order Type

{endpoint}?expand=orderType

List

Returns a collection of created orders.

Filtering

You can filter your results as follows:

List orders for specified id(s)

  • /orders?filter[id]=1
  • /orders?filter[id]=1,2,3

List orders for specified state

  • /orders?filter[state]=cancelled
  • /orders?filter[state]=delivered

List orders for specified external identifier

  • /orders?filter[external_identifier]=organic

List orders for specified external reference

  • /orders?filter[external_reference]=143000

List orders with an ID greater than the specified ID

  • /orders?filter[since_id]=1
  • /orders?filter[since_id]=2

List orders for a given date, only resources created after the provided date will be returned

  • /orders?filter[created_at_min]=2017-09-27

List orders for a given date, only resources created before the provided date will be returned

  • /orders?filter[created_at_max]=2017-11-15

List orders for a given date, only resources updated after the provided date will be returned

  • /orders?filter[updated_at_min]=2017-09-27

List orders for a given date, only resources updated before the provided date will be returned

  • /orders?filter[updated_at_max]=2017-09-27

Example

Request

GET /orders HTTP/1.1

Response

{
    "data": [
        {
            "id": 1,
            "order_type": 1,
            "is_test": true,
            "external_identifier": null,
            "external_reference": "et",
            "cost_centre": "lorem 12345",
            "state": "delivered",
            "customer_locale": "en",
            "currency": "EUR",
            "total": 57.20,
            "subtotal": 52.00,
            "total_tax": 5.20,
            "total_items_price": 52.80,
            "shipping_total": 4.40,
            "created_at": "2017-09-27T10:10:59+00:00",
            "updated_at": "2017-09-27T10:11:03+00:00",
            "cancelled_at": null,
            "ordered_at": "2017-09-27T10:11:03+00:00",
            "items": [
                {
                    "id": 1,
                    "quantity": 4,
                    "total": 52.80,
                    "price": 12.00,
                    "total_tax": 4.80,
                    "tax_rate": 10,
                    "variant": {
                        "id": 27,
                        "total": 13.20,
                        "price": 12.00,
                        "tax": 1.20,
                        "tax_rate": 10,
                        "attributes": [
                            {
                                "name": "color",
                                "value": "Khaki"
                            },
                            {
                                "name": "size",
                                "value": "XL"
                            }
                        ],
                        "origin": {
                            "code": "4490824589755"
                        },
                        "media_id": 251,
                        "views": [],
                        "created_at": "2017-09-27T10:10:38+00:00",
                        "updated_at": "2017-09-27T10:10:38+00:00"
                    },
                    "created_at": "2017-09-27T10:10:59+00:00",
                    "updated_at": "2017-09-27T10:10:59+00:00",
                    "cancelled_at": null
                }
            ],
            "customer": {
                "id": 40,
                "first_name": "John",
                "last_name": "Doe",
                "email": "John@example.com",
                "phone": "12345 67890",
                "addresses": [],
                "default_address": {
                    "id": 122,
                    "default": true,
                    "company": null,
                    "first_name": "John",
                    "last_name": "Doe",
                    "city": "Anytown",
                    "street1": "123 Main St",
                    "street2": null,
                    "zip": "12345",
                    "phone": "12345 67890",
                    "email": "John@example.com",
                    "province_code": "NW",
                    "country_code": "DE",
                    "vat_in": null,
                    "created_at": "2017-09-27T10:11:01+00:00",
                    "updated_at": "2017-09-27T10:11:01+00:00"
                },
                "created_at": "2017-09-27T10:10:59+00:00",
                "updated_at": "2017-09-27T10:10:59+00:00"
            },
            "shipping_address": {
                "id": 45,
                "default": true,
                "company": "MyCompany",
                "first_name": "John",
                "last_name": "John",
                "city": "Anytown",
                "street1": "123 Main St",
                "street2": null,
                "zip": "12345",
                "phone": "12345 67890",
                "email": "john@example.net",
                "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,
                "default": true,
                "company": "MyCompany",
                "first_name": "John",
                "last_name": "Doe",
                "city": "Anytown",
                "street1": "123 Main St",
                "street2": null,
                "zip": "12345",
                "phone": "12345 67890",
                "email": "john@example.net",
                "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,
            "transactions": [
                {
                    "amount": 57.20,
                    "title": "Invoice"
                }
            ],
            "fulfillments": [
                {
                    "id": 1,
                    "tracking_number": "2229446017085",
                    "order": 1,
                    "parcels": [
                        [
                            1
                        ]
                    ],
                    "created_at": "2021-02-24T11:04:46+01:00",
                    "updated_at": "2021-02-25T11:35:50+01:00"
                }
            ],
            "id_tags": [
                {
                    "id": 1,
                    "order_item_id": 1,
                    "current_state": "Goods booked in",
                    "created_at": "2017-09-27T10:10:59+00:00",
                    "updated_at": "2017-09-27T10:10:59+00:00"
                },
                {
                    "id": 2,
                    "order_item_id": 1,
                    "current_state": "Released to production stage",
                    "created_at": "2017-09-27T10:10:59+00:00",
                    "updated_at": "2017-09-27T10:10:59+00:00"
                },
                {
                    "id": 3,
                    "order_item_id": 1,
                    "current_state": "Shipped",
                    "created_at": "2017-09-27T10:10:59+00:00",
                    "updated_at": "2017-09-27T10:10:59+00:00"
                },
                {
                    "id": 4,
                    "order_item_id": 1,
                    "current_state": "Scanned on machine (DTG)",
                    "created_at": "2017-09-27T10:10:59+00:00",
                    "updated_at": "2017-09-27T10:10:59+00:00"
                }
            ]
        },
        {
            "id": 2,
            "order_type": 1,
            "is_test": true,
            "external_identifier": null,
            "external_reference": "dicta",
            "coste_centre": "ipsum 8765",
            "state": "incompleted",
            "customer_locale": "en",
            "currency": "EUR",
            "total": 28.60,
            "subtotal": 26.00,
            "total_tax": 2.60,
            "total_items_price": 22.00,
            "shipping_total": 6.60,
            "created_at": "2017-09-27T10:10:59+00:00",
            "updated_at": "2017-09-27T10:10:59+00:00",
            "cancelled_at": null,
            "ordered_at": "2017-09-27T10:11:03+00:00",
            "items": [
                {
                    "id": 2,
                    "quantity": 1,
                    "total": 22.00,
                    "price": 20.00,
                    "total_tax": 2.00,
                    "tax_rate": 10,
                    "variant": {
                        "id": 53,
                        "total": 22.00,
                        "price": 20.00,
                        "tax": 2.00,
                        "tax_rate": 10,
                        "attributes": [
                            {
                                "name": "color",
                                "value": "LightCyan"
                            },
                            {
                                "name": "size",
                                "value": "S"
                            }
                        ],
                        "origin": {
                            "code": "0729845433827"
                        },
                        "media_id": 436,
                        "views": [],
                        "created_at": "2017-09-27T10:10:43+00:00",
                        "updated_at": "2017-09-27T10:10:43+00:00"
                    },
                    "created_at": "2017-09-27T10:10:59+00:00",
                    "updated_at": "2017-09-27T10:10:59+00:00",
                    "cancelled_at": null
                }
            ],
            "customer": {
                "id": 41,
                "first_name": "John",
                "last_name": "Doe",
                "email": "john@example.com",
                "phone": "12345 67890",
                "addresses": [],
                "default_address": {
                    "id": 124,
                    "default": true,
                    "company": null,
                    "first_name": "John",
                    "last_name": "Doe",
                    "city": "Anytown",
                    "street1": "123 Main St",
                    "street2": null,
                    "zip": "12345",
                    "phone": "12345 67890",
                    "email": "John@example.org",
                    "province_code": "NW",
                    "country_code": "DE",
                    "vat_in": null,
                    "created_at": "2017-09-27T10:11:01+00:00",
                    "updated_at": "2017-09-27T10:11:01+00:00"
                },
                "created_at": "2017-09-27T10:10:59+00:00",
                "updated_at": "2017-09-27T10:10:59+00:00"
            },
            "shipping_address": {
                "id": 47,
                "default": true,
                "company": "MyComapny",
                "first_name": "John",
                "last_name": "Doe",
                "city": "Anytown",
                "street1": "123 Main St",
                "street2": null,
                "zip": "12345",
                "phone": "12345 67890",
                "email": "John@example.org",
                "province_code": "BW",
                "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": 46,
                "default": true,
                "company": "MyCompany",
                "first_name": "John",
                "last_name": "Doe",
                "city": "Anytown",
                "street1": "123 Main St",
                "street2": null,
                "zip": "12345",
                "phone": "12345 67890",
                "email": "John@example.org",
                "province_code": "BY",
                "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,
            "transactions": [
                {
                    "amount": 28.60,
                    "title": "Invoice"
                }
            ],
            "fulfillments": [
                {
                    "id": 1,
                    "tracking_number": "2229446017085",
                    "order": 1,
                    "parcels": [
                        [
                            1
                        ]
                    ],
                    "created_at": "2021-02-24T11:04:46+01:00",
                    "updated_at": "2021-02-25T11:35:50+01:00"
                }
            ],
            "id_tags": [
                {
                    "id": 5,
                    "order_item_id": 2,
                    "current_state": "Production stages combined (stitching)",
                    "created_at": "2017-09-27T10:10:59+00:00",
                    "updated_at": "2017-09-27T10:10:59+00:00"
                }
            ]
        }
        ...
    ],
    "links": {
        "first": "https://api.smake.io/v2/orders?page=1",
        "last": null,
        "prev": null,
        "next": "https://api.smake.io/v2/orders?page=2"
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "path": "https://api.smake.io/v2/orders",
        "per_page": 25,
        "to": 25
    }
}

Get

Returns the order with id = x.

Example

Request

GET /orders/1 HTTP/1.1

Response

{
    "id": 1,
    "order_type": 1,
    "is_test": true,
    "external_identifier": null,
    "external_reference": "et",
    "cost_centre": "lorem 1234",
    "state": "delivered",
    "customer_locale": "en",
    "currency": "EUR",
    "total": 57.20,
    "subtotal": 52.00,
    "total_tax": 5.20,
    "total_items_price": 52.80,
    "shipping_total": 4.40,
    "created_at": "2017-09-27T10:10:59+00:00",
    "updated_at": "2017-09-27T10:11:03+00:00",
    "cancelled_at": null,
    "ordered_at": "2017-09-27T10:11:03+00:00",
    "items": [
        {
            "id": 1,
            "quantity": 4,
            "total": 52.80,
            "price": 12.00,
            "total_tax": 4.80,
            "tax_rate": 10,
            "variant": {
                "id": 27,
                "total": 13.20,
                "price": 12.00,
                "tax": 1.20,
                "tax_rate": 10,
                "attributes": [
                    {
                        "name": "color",
                        "value": "Khaki"
                    },
                    {
                        "name": "size",
                        "value": "XL"
                    }
                ],
                "origin": {
                    "code": "4490824589755"
                },
                "media_id": 251,
                "views": [],
                "created_at": "2017-09-27T10:10:38+00:00",
                "updated_at": "2017-09-27T10:10:38+00:00"
            },
            "created_at": "2017-09-27T10:10:59+00:00",
            "updated_at": "2017-09-27T10:10:59+00:00",
            "cancelled_at": null
        }
    ],
    "customer": {
        "id": 40,
        "first_name": "John",
        "last_name": "Doe",
        "email": "John@example.com",
        "phone": "12345 67890",
        "addresses": [],
        "default_address": {
            "id": 122,
            "default": true,
            "company": null,
            "first_name": "John",
            "last_name": "Doe",
            "city": "Anytown",
            "street1": "123 Main St",
            "street2": null,
            "zip": "12345",
            "phone": "12345 67890",
            "email": "John@example.com",
            "province_code": "NW",
            "country_code": "DE",
            "vat_in": null,
            "created_at": "2017-09-27T10:11:01+00:00",
            "updated_at": "2017-09-27T10:11:01+00:00"
        },
        "created_at": "2017-09-27T10:10:59+00:00",
        "updated_at": "2017-09-27T10:10:59+00:00"
    },
    "shipping_address": {
        "id": 45,
        "default": true,
        "company": "MyCompany",
        "first_name": "John",
        "last_name": "Doe",
        "city": "Anytown",
        "street1": "123 Main St",
        "street2": null,
        "zip": "12345",
        "phone": "12345 67890",
        "email": "John@example.net",
        "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,
        "default": true,
        "company": "MyCompany",
        "first_name": "John",
        "last_name": "Doe",
        "city": "Anytown",
        "street1": "123 Main St",
        "street2": null,
        "zip": "12345",
        "phone": "12345 67890",
        "email": "John@example.net",
        "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,
    "transactions": [
        {
            "amount": 57.20,
            "title": "Invoice"
        }
    ],
    "fulfillments": [
        {
            "id": 1,
            "tracking_number": "2229446017085",
            "order": 1,
            "parcels": [
                [
                    1
                ]
            ],
            "created_at": "2021-02-24T11:04:46+01:00",
            "updated_at": "2021-02-25T11:35:50+01:00"
        }
    ],
    "id_tags": [
        {
            "id": 1,
            "order_item_id": 1,
            "current_state": "Goods booked in",
            "created_at": "2017-09-27T10:10:59+00:00",
            "updated_at": "2017-09-27T10:10:59+00:00"
        },
        {
            "id": 2,
            "order_item_id": 1,
            "current_state": "Released to production stage",
            "created_at": "2017-09-27T10:10:59+00:00",
            "updated_at": "2017-09-27T10:10:59+00:00"
        },
        {
            "id": 3,
            "order_item_id": 1,
            "current_state": "Shipped",
            "created_at": "2017-09-27T10:10:59+00:00",
            "updated_at": "2017-09-27T10:10:59+00:00"
        },
        {
            "id": 4,
            "order_item_id": 1,
            "current_state": "Scanned on machine (DTG)",
            "created_at": "2017-09-27T10:10:59+00:00",
            "updated_at": "2017-09-27T10:10:59+00:00"
        }
    ]
}

Cancel

You can cancel an already placed order by executing the following request.

Depending on the cancellation setting it may be that an order can no longer be canceled. In this case an API exception is thrown.

Example

Request

PUT /orders/1/cancel HTTP/1.1

Response

{
    "id": 1,
    "order_type": 1,
    "is_test": true,
    "external_identifier": null,
    "external_reference": "et",
    "cost_centre": "lorem 1234",
    "state": "delivered",
    "customer_locale": "en",
    "currency": "EUR",
    "total": 57.20,
    "subtotal": 52.00,
    "total_tax": 5.20,
    "total_items_price": 52.80,
    "shipping_total": 4.40,
    "created_at": "2017-09-27T10:10:59+00:00",
    "updated_at": "2017-09-27T10:11:03+00:00",
    "cancelled_at": null,
    "ordered_at": "2017-09-27T10:11:03+00:00",
    "items": [
        {
            "id": 1,
            "quantity": 4,
            "total": 52.80,
            "price": 12.00,
            "total_tax": 4.80,
            "tax_rate": 10,
            "variant": {
                "id": 27,
                "total": 13.20,
                "price": 12.00,
                "tax": 1.20,
                "tax_rate": 10,
                "attributes": [
                    {
                        "name": "color",
                        "value": "Khaki"
                    },
                    {
                        "name": "size",
                        "value": "XL"
                    }
                ],
                "origin": {
                    "code": "4490824589755"
                },
                "media_id": 251,
                "views": [],
                "created_at": "2017-09-27T10:10:38+00:00",
                "updated_at": "2017-09-27T10:10:38+00:00"
            },
            "created_at": "2017-09-27T10:10:59+00:00",
            "updated_at": "2017-09-27T10:10:59+00:00",
            "cancelled_at": null
        }
    ],
    "customer": {
        "id": 40,
        "first_name": "John",
        "last_name": "Doe",
        "email": "John@example.com",
        "phone": "12345 67890",
        "addresses": [],
        "default_address": {
            "id": 122,
            "default": true,
            "company": null,
            "first_name": "John",
            "last_name": "Doe",
            "city": "Anytown",
            "street1": "123 Main St",
            "street2": null,
            "zip": "12345",
            "phone": "12345 67890",
            "email": "John@example.com",
            "province_code": "NW",
            "country_code": "DE",
            "vat_in": null,
            "created_at": "2017-09-27T10:11:01+00:00",
            "updated_at": "2017-09-27T10:11:01+00:00"
        },
        "created_at": "2017-09-27T10:10:59+00:00",
        "updated_at": "2017-09-27T10:10:59+00:00"
    },
    "shipping_address": {
        "id": 45,
        "default": true,
        "company": "MyCompany",
        "first_name": "John",
        "last_name": "Doe",
        "city": "Anytown",
        "street1": "123 Main St",
        "street2": null,
        "zip": "12345",
        "phone": "12345 67890",
        "email": "John@example.net",
        "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,
        "default": true,
        "company": "MyCompany",
        "first_name": "John",
        "last_name": "Doe",
        "city": "Anytown",
        "street1": "123 Main St",
        "street2": null,
        "zip": "12345",
        "phone": "12345 67890",
        "email": "John@example.net",
        "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,
    "transactions": [
        {
            "amount": 57.20,
            "title": "Invoice"
        }
    ],
    "fulfillments": [
        {
            "id": 1,
            "tracking_number": "2229446017085",
            "order": 1,
            "parcels": [
                [
                    1
                ]
            ],
            "created_at": "2021-02-24T11:04:46+01:00",
            "updated_at": "2021-02-25T11:35:50+01:00"
        }
    ],
    "id_tags": [
        {
            "id": 1,
            "order_item_id": 1,
            "current_state": "Goods booked in",
            "created_at": "2017-09-27T10:10:59+00:00",
            "updated_at": "2017-09-27T10:10:59+00:00"
        },
        {
            "id": 2,
            "order_item_id": 1,
            "current_state": "Released to production stage",
            "created_at": "2017-09-27T10:10:59+00:00",
            "updated_at": "2017-09-27T10:10:59+00:00"
        },
        {
            "id": 3,
            "order_item_id": 1,
            "current_state": "Shipped",
            "created_at": "2017-09-27T10:10:59+00:00",
            "updated_at": "2017-09-27T10:10:59+00:00"
        },
        {
            "id": 4,
            "order_item_id": 1,
            "current_state": "Scanned on machine (DTG)",
            "created_at": "2017-09-27T10:10:59+00:00",
            "updated_at": "2017-09-27T10:10:59+00:00"
        }
    ]
}