This is the documentation for 2022-02-01.

Orders

An order is created when the checkout process is complete.

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]=completed
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

Expanding objects

Expand order type

You can show order type details here.

  • /orders?expand=order_type
Expand ID Tags for order item

You can show ID Tag details for order items here.

  • /orders?expand=items.id_tags
Expand the variant details for order items

You can show the content of the variant for an order item.

  • /orders?expand=items.variant
Expand variants customization resource

You can show the content customizations' resource of a variant for an order item.

  • /orders?expand=items.variant.views.customizations.resource
Expand disposition order resource

You can show the content disposition order resource for an order.

  • /orders?expand=disposition_order
Expand production orders resource

You can show the content production orders resource of the disposition order for an order.

  • /orders?expand=disposition_order.production_orders
Expand production resource

You can show the content production resource for all production order for the disposition order for an order.

  • /orders?expand=disposition_order.production_orders.production

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": "completed",
            "failure_message": null,
            "customer_locale": "en",
            "currency": "EUR",
            "total": 57.20,
            "subtotal": 52.00,
            "total_tax": 5.20,
            "total_items_price": 52.80,
            "shipping_total": 4.40,
            "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": true,
                    "quantity": 4,
                    "total": 52.80,
                    "price": 12.00,
                    "total_tax": 4.80,
                    "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": true,
                "email": "John@example.com",
                "created_at": "2017-09-27T10:10:59+00:00",
                "updated_at": "2017-09-27T10:11:03+00:00",
            },
            "shipping_address": {
                "id": 45,
                "is_test": 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,
                "is_test": 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,
            "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": true,
                    "shipping_method": {
                        "is_test": true,
                        "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"
                }
            ],
        },
        {
            "id": 2,
            "order_type": 1,
            "is_test": true,
            "external_identifier": null,
            "external_reference": "dicta",
            "coste_centre": "ipsum 8765",
            "state": "prepared",
            "failure_message": null,
            "customer_locale": "en",
            "currency": "EUR",
            "total": 28.60,
            "subtotal": 26.00,
            "total_tax": 2.60,
            "total_items_price": 22.00,
            "shipping_total": 6.60,
            "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": true,
                    "quantity": 4,
                    "total": 22.00,
                    "price": 20.00,
                    "total_tax": 2.00,
                    "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": 53,
                    "id_tags": [
                        2
                    ]
                }
            ],
            "disposition_order": 54,
            "customer": {
                "id": 40,
                "is_test": true,
                "email": "john@example.com",
                "created_at": "2017-09-27T10:10:59+00:00",
                "updated_at": "2017-09-27T10:11:03+00:00",
            },
            "shipping_address": {
                "id": 47,
                "is_test": 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,
                "is_test": 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,
            "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": true,
                    "shipping_method": {
                        "is_test": true,
                        "order_id": 2,
                        "handle": "pickup",
                        "title": "Pickup",
                        "price": 0
                    },
                    "tracking_number": "2229446017086",
                    "media": [],
                    "order": 2,
                    "created_at": "2021-02-24T11:04:46+01:00",
                    "updated_at": "2021-02-25T11:35:50+01: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
    }
}

Example with expanded relationships

Request

GET /orders?expand=items.id_tags HTTP/1.1

Response

{
    "data": [
        {
            "id": 1,
            "order_type": 1,
            "is_test": false,
            "external_identifier": null,
            "external_reference": null,
            "cost_centre": null,
            "state": "prepared",
            "failure_message": null,
            "customer_locale": "de",
            "currency": "EUR",
            "total": 544.61,
            "subtotal": 493.72,
            "total_tax": 6.04,
            "total_items_price": 561.91,
            "shipping_total": -17.3,
            "discount_total": 0,
            "created_at": "2022-04-28T14:34:08+00:00",
            "updated_at": "2022-04-28T14:34:54+00:00",
            "cancelled_at": null,
            "ordered_at": "2022-04-28T14:34:08+00:00",
            "items": [
                {
                    "id": 1,
                    "is_test": 0,
                    "quantity": 1,
                    "total": 107.34,
                    "price": 100.32,
                    "total_tax": 7.02,
                    "tax_rate": 7,
                    "variant": 433,
                    "created_at": "2022-04-28T14:34:08+00:00",
                    "updated_at": "2022-04-28T14:34:08+00:00",
                    "cancelled_at": null,
                    "id_tags": [
                        {
                            "id": 1,
                            "is_test": 0,
                            "order": 1,
                            "order_item": 1,
                            "state": "ordered",
                            "created_at": "2022-04-28T14:34:08+00:00",
                            "updated_at": "2022-04-28T14:34:08+00:00"
                        }
                    ]
                }
            ],
            "disposition_order": 54,
            "customer": {
                "id": 5,
                "is_test": 0,
                "email": "ottis.schumm@example.org",
                "created_at": "2022-04-28T14:34:08+00:00",
                "updated_at": "2022-04-28T14:34:08+00:00"
            },
            "shipping_address": {
                "id": 4,
                "is_test": 0,
                "company": "Wehner PLC",
                "first_name": "Weldon",
                "last_name": "Ryan",
                "city": "Effertzview",
                "street1": "31637 Edgar Ridge",
                "street2": null,
                "zip": "07528-3753",
                "phone": "1-608-531-5941",
                "email": "xhartmann@example.net",
                "province_code": null,
                "country_code": "DE",
                "vat_in": null,
                "created_at": "2022-04-28T14:34:08+00:00",
                "updated_at": "2022-04-28T14:34:08+00:00"
            },
            "billing_address": {
                "id": 3,
                "is_test": 0,
                "company": "Haley-Reichel",
                "first_name": "Kylie",
                "last_name": "Murray",
                "city": "New Holliefort",
                "street1": "339 Merl Manors Apt. 224",
                "street2": "4650 Xavier Views",
                "zip": "79300",
                "phone": null,
                "email": null,
                "province_code": null,
                "country_code": "DE",
                "vat_in": null,
                "created_at": "2022-04-28T14:34:08+00:00",
                "updated_at": "2022-04-28T14:34:08+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": 1,
                    "is_test": 0,
                    "shipping_method": {
                        "is_test": 0,
                        "order_id": 1,
                        "handle": "pickup",
                        "title": "ea",
                        "price": 0
                    },
                    "tracking_number": null,
                    "media": [],
                    "order": 1,
                    "created_at": "2022-04-28T14:34:08+00:00",
                    "updated_at": "2022-04-28T14:34:08+00:00"
                }
            ]
        },
        {
            "id": 2,
            "order_type": 1,
            "is_test": false,
            "external_identifier": null,
            "external_reference": null,
            "cost_centre": null,
            "state": "preparing",
            "failure_message": null,
            "customer_locale": "de",
            "currency": "EUR",
            "total": 533.7,
            "subtotal": 477.36,
            "total_tax": 3.82,
            "total_items_price": 537.96,
            "shipping_total": -4.26,
            "discount_total": 0,
            "created_at": "2022-04-28T14:34:09+00:00",
            "updated_at": "2022-04-28T14:34:57+00:00",
            "cancelled_at": null,
            "ordered_at": "2022-04-28T14:34:09+00:00",
            "items": [
                {
                    "id": 2,
                    "is_test": 0,
                    "quantity": 1,
                    "total": 65.81,
                    "price": 61.5,
                    "total_tax": 4.31,
                    "tax_rate": 7,
                    "variant": 434,
                    "created_at": "2022-04-28T14:34:09+00:00",
                    "updated_at": "2022-04-28T14:34:09+00:00",
                    "cancelled_at": null,
                    "id_tags": [
                        {
                            "id": 2,
                            "is_test": 0,
                            "order": 2,
                            "order_item": 2,
                            "state": "ordered",
                            "created_at": "2022-04-28T14:34:09+00:00",
                            "updated_at": "2022-04-28T14:34:09+00:00"
                        }
                    ]
                }
            ],
            "disposition_order": 54,
            "customer": {
                "id": 6,
                "is_test": 0,
                "email": "mills.marianne@example.net",
                "created_at": "2022-04-28T14:34:09+00:00",
                "updated_at": "2022-04-28T14:34:09+00:00"
            },
            "shipping_address": {
                "id": 6,
                "is_test": 0,
                "company": null,
                "first_name": "Vicenta",
                "last_name": "Cummings",
                "city": "Port Pearl",
                "street1": "836 Marquise Hollow",
                "street2": "459 Seamus Ports Suite 859",
                "zip": "60964",
                "phone": null,
                "email": null,
                "province_code": null,
                "country_code": "DE",
                "vat_in": null,
                "created_at": "2022-04-28T14:34:09+00:00",
                "updated_at": "2022-04-28T14:34:09+00:00"
            },
            "billing_address": {
                "id": 5,
                "is_test": 0,
                "company": null,
                "first_name": "Jermaine",
                "last_name": "Hyatt",
                "city": "South Vallie",
                "street1": "922 Doyle Mountain",
                "street2": null,
                "zip": "74842",
                "phone": "(314) 526-7118",
                "email": "alvah.wolff@example.net",
                "province_code": null,
                "country_code": "DE",
                "vat_in": null,
                "created_at": "2022-04-28T14:34:09+00:00",
                "updated_at": "2022-04-28T14:34:09+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": 2,
                    "is_test": 0,
                    "shipping_method": {
                        "is_test": 0,
                        "order_id": 2,
                        "handle": "pickup",
                        "title": "ea",
                        "price": 0
                    },
                    "tracking_number": null,
                    "media": [],
                    "order": 2,
                    "created_at": "2022-04-28T14:34:09+00:00",
                    "updated_at": "2022-04-28T14:34:09+00:00"
                }
            ]
        }
    ],
    "links": {
        "first": "https://api.smake.io/v2/apps/1/orders?expand=items.id_tags&per_page=2&page=1",
        "last": null,
        "prev": null,
        "next": "https://api.smake.io/v2/apps/1/orders?expand=items.id_tags&per_page=2&page=2"
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "path": "https://api.smake.io/v2/apps/1/orders",
        "per_page": 2,
        "to": 2
    }
}

Get

Returns the order with id = x.

Expanding objects

Expand order type

You can show order type details here.

  • /orders/1?expand=order_type
Expand ID Tags for order item

You can show ID Tag details for order items here.

  • /orders/1?expand=items.id_tags
Expand the variant details for order items

You can show the content of the variant for an order item.

  • /orders/1?expand=items.variant
Expand 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
Expand disposition order resource

You can show the content of the disposition order for an order.

  • /orders/1?expand=disposition_order
Expand production orders resource

You can show the content of the production orders for the disposition order.

  • /orders/1?expand=disposition_order.production_orders
Expand production resource

You can show the production details of a production order for the disposition order.

  • /orders/1?expand=disposition_order.production_orders.production

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 12345",
    "state": "completed",
    "failure_message": null,
    "customer_locale": "en",
    "currency": "EUR",
    "total": 57.20,
    "subtotal": 52.00,
    "total_tax": 5.20,
    "total_items_price": 52.80,
    "shipping_total": 4.40,
    "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": true,
            "quantity": 4,
            "total": 52.80,
            "price": 12.00,
            "total_tax": 4.80,
            "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": true,
        "email": "John@example.com",
        "created_at": "2017-09-27T10:10:59+00:00",
        "updated_at": "2017-09-27T10:11:03+00:00",
    },
    "shipping_address": {
        "id": 45,
        "is_test": 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,
        "is_test": 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,
    "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": true,
            "shipping_method": {
                "is_test": true,
                "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"
        }
    ],
},

Example with expanded relationships

Request

GET /orders?expand=items.id_tags HTTP/1.1

Response

{
    "id": 1,
    "order_type": 1,
    "is_test": false,
    "external_identifier": null,
    "external_reference": null,
    "cost_centre": null,
    "state": "prepared",
    "failure_message": null,
    "customer_locale": "de",
    "currency": "EUR",
    "total": 544.61,
    "subtotal": 493.72,
    "total_tax": 6.04,
    "total_items_price": 561.91,
    "shipping_total": -17.3,
    "discount_total": 0,
    "created_at": "2022-04-28T14:34:08+00:00",
    "updated_at": "2022-04-28T14:34:54+00:00",
    "cancelled_at": null,
    "ordered_at": "2022-04-28T14:34:08+00:00",
    "items": [
        {
            "id": 1,
            "is_test": 0,
            "quantity": 1,
            "total": 107.34,
            "price": 100.32,
            "total_tax": 7.02,
            "tax_rate": 7,
            "variant": 433,
            "created_at": "2022-04-28T14:34:08+00:00",
            "updated_at": "2022-04-28T14:34:08+00:00",
            "cancelled_at": null,
            "id_tags": [
                {
                    "id": 1,
                    "is_test": 0,
                    "order": 1,
                    "order_item": 1,
                    "state": "ordered",
                    "created_at": "2022-04-28T14:34:08+00:00",
                    "updated_at": "2022-04-28T14:34:08+00:00"
                }
            ]
        }
    ],
    "customer": {
        "id": 5,
        "is_test": 0,
        "email": "ottis.schumm@example.org",
        "created_at": "2022-04-28T14:34:08+00:00",
        "updated_at": "2022-04-28T14:34:08+00:00"
    },
    "shipping_address": {
        "id": 4,
        "is_test": 0,
        "company": "Wehner PLC",
        "first_name": "Weldon",
        "last_name": "Ryan",
        "city": "Effertzview",
        "street1": "31637 Edgar Ridge",
        "street2": null,
        "zip": "07528-3753",
        "phone": "1-608-531-5941",
        "email": "xhartmann@example.net",
        "province_code": null,
        "country_code": "DE",
        "vat_in": null,
        "created_at": "2022-04-28T14:34:08+00:00",
        "updated_at": "2022-04-28T14:34:08+00:00"
    },
    "billing_address": {
        "id": 3,
        "is_test": 0,
        "company": "Haley-Reichel",
        "first_name": "Kylie",
        "last_name": "Murray",
        "city": "New Holliefort",
        "street1": "339 Merl Manors Apt. 224",
        "street2": "4650 Xavier Views",
        "zip": "79300",
        "phone": null,
        "email": null,
        "province_code": null,
        "country_code": "DE",
        "vat_in": null,
        "created_at": "2022-04-28T14:34:08+00:00",
        "updated_at": "2022-04-28T14:34:08+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": 1,
            "is_test": 0,
            "shipping_method": {
                "is_test": 0,
                "order_id": 1,
                "handle": "pickup",
                "title": "ea",
                "price": 0
            },
            "tracking_number": null,
            "media": [],
            "order": 1,
            "created_at": "2022-04-28T14:34:08+00:00",
            "updated_at": "2022-04-28T14:34:08+00:00"
        }
    ]
}

Post

Background processing

When you create an order, this happens asynchronously. You can use Polling or 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 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. 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.

Attributes

Field Type Description Required
customer object Customer address. Customer object yes
items array Order items. An array of order item. Order item object yes
order_type object Order type. If not specified the default order type is used. Order type object
number string External number may be used to reference an order from another external system. We do not check for uniqueness!
external_identifier string External identifier may be used to reference an order from another external system. We do not check for uniqueness!
external_reference string External reference may be use to specifies where an order originally came from. We do not check for uniqueness!
cost_centre string Your cost center
shipping_address object Shipping address. Address object yes
billing_address object Billing address. If you do not specify this address, it corresponds to the shipping address. Address object
whitelabel_address object White label / Sender address. Address object
payments array Payment. An array with information about one Payment object yes
shipments array Shipment. An array with information about one Shipment object yes

Customer object

Back to Attributes

Field Type Description Required
email string E-Mail-Address yes

Order item object

Back to Attributes

Field Type Description Required
variant object Variant. Variant object yes
quantity integer The quantity of the variants to be ordered. yes

Variant object

Back to order item

Field Type Description Required
type string The variant designing type. Current available type is basic. yes
id integer The id of the variant to be ordered. yes, if origin.external_identifier or origin.sku is not specified
origin object Origin. Origin object yes, if variant.id is not specified
views array You can add designs to a variant within the order process by filling in the views object. All features of the variant design endpoint can be used here. Variant design
adopt_design_from_variant object You can adopt the designs from another variant. Note that the variants must belong to the same product.

Origin object

Back to variant

Field Type Description Required
external_identifier string The external identifier of the variant to be ordered. yes, if variants id or origin.sku is not specified
sku string The SKU (stock keeping unit) of the variant to be ordered. yes, if variants id or origin.external_identifier is not specified

Adobt design from variant object

With the use of this object you can adopt the design from another variant of the same product.

Back to variant

Field Type Description Required
id integer The id from the variant which contains the customizations you want to adopt. yes

Order type object

Back to Attributes

Field Type Description Required
handle string The handle of the order type. For a list of available order types, please ask your producer. yes

Address object

Back to Attributes

Field Type Description Required
company string Company
first_name string First name yes
last_name string Last name yes
street1 string First street line. Limited to 35 characters yes
street2 string Second street line. Limited to 35 characters
zip string Zip code yes
city string City yes
country_code ISO 3166-1-alpha-2 code (ISO 2 country code) Example: 'US' or 'DE'. All accepted values can be found on the Official ISO website. yes
province_code string Requires a one or three-digit code. Example: 'AL' (Alabama) or 'QLD' (Queensland) Only for shipments to the United States, Canada, Australia and Israel.
phone string So that, for example, the parcel service can call the address/dispatcher of the parcel in case of problems with shipping. yes
email string Contact person's e-mail address, RFC3696/5321 compliant. yes
vat_in string Sales tax

Payment object

Back to Attributes

Field Type Description Required
payment_method.handle string The handle of the payment method to be used to pay for the order. For a list of available payment methods, see payment-methods. yes

Shipment object

Back to Attributes

Field Type Description Required
shipping_method.handle string The handle used to deliver the order. For a list of available shipping methods, see shipping-methods. yes
tracking_number string The tracking number of the service provider
media array Media. An array of Shipment Media Objects

Shipment media object

Back to Attributes

Field Type Description Required
url string File URL where the file can be downloaded The field is required when none of id are present.
id integer Media id that was previously uploaded under media The field is required when none of url are present.
collection_name string The collection to which the file should be assigned yes

The following collection names and file formats are currently supported:

Collection name File format
shipping-label image/png, application/pdf
packing-slip application/pdf
commercial-invoice application/pdf

Example

Request

POST /orders HTTP/1.1

{
    "customer": {
        "email": "max@example.com"
    },
    "items": [
        {
            "variant": {
                "type": "basic",
                "id": 25
            },
            "quantity": 3
        }
    ],
    "shipping_address": {
        "first_name": "Max",
        "last_name": "Mustermann",
        "street1": "Am Wassermann 361",
        "zip": "508291",
        "city": "Köln",
        "country_code": "DE",
        "phone": "+49 123 456 789",
        "email": "max@example.com"
    },
    "shipments": [
        {
            "shipping_method": {
                "handle": "shipping-method-handle"
            }
        }
    ],
    "payments": [
        {
            "payment_method": {
                "handle": "payment-method-handle"
            }
        }
    ]
}

Response

HTTP/1.1 202 Accepted
Location https://api.smake.io/jobs/1
X-Identifier: 137

The X-Identifier is the new generated order id for later reference.

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": 71,
    "order_type": 1,
    "is_test": false,
    "external_identifier": null,
    "external_reference": 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": "info@muster.de",
        "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": "info@muster.de",
        "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": "info@muster.de",
        "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"
        }
    ]
}

Further post order examples

Create order with designing a variant with media ids

Request

POST /orders HTTP/1.1

{
    "customer": {
        "email": "max@example.com"
    },
    "items": [
        {
            "variant": {
                "type": "basic",
                "id": 25,
                "views": [
                    {
                        "handle": "front",
                        "media": [
                            {
                                "id": 1233,
                                "collection_name": "mockup"
                            }
                        ],
                        "customizations": [
                            {
                                "resource_type": "logo",
                                "width": 200,
                                "height": 200,
                                "resource": {
                                    "production_method": {
                                        "handle": "dtg"
                                    },
                                    "media": [
                                        {
                                            "id": 1234,
                                            "collection_name": "production-file"
                                        }
                                    ]
                                }
                            }
                        ]
                    }
                ]
            },
            "quantity": 3
        }
    ],
    "shipping_address": {
        "first_name": "Max",
        "last_name": "Mustermann",
        "street1": "Am Wassermann 361",
        "zip": "508291",
        "city": "Köln",
        "country_code": "DE",
        "phone": "+49 123 456 789",
        "email": "max@example.com"
    },
    "shipments": [
        {
            "shipping_method": {
                "handle": "shipping-method-handle"
            }
        }
    ],
    "payments": [
        {
            "payment_method": {
                "handle": "payment-method-handle"
            }
        }
    ]
}

Create order with own shipping documents

Request

POST /orders HTTP/1.1

{
    "customer": {
        "email": "max@example.com"
    },
    "items": [
        {
            "variant": {
                "type": "basic",
                "id": 25
            },
            "quantity": 3
        }
    ],
    "shipping_address": {
        "first_name": "Max",
        "last_name": "Mustermann",
        "street1": "Am Wassermann 361",
        "zip": "508291",
        "city": "Köln",
        "country_code": "DE",
        "phone": "+49 123 456 789",
        "email": "max@example.com"
    },
    "shipments": [
        {
            "shipping_method": {
                "handle": "shipping-method-handle"
            },
            "tracking_number": "my external tracking number",
            "media":[
                {
                    "url": "https://smake-public.s3.eu-west-1.amazonaws.com/testfiles/logo.png",
                    "collection_name": "shipping-label"
                },
                {
                    "id": 1,
                    "collection_name": "commercial-invoice"
                },
                {
                    "url": "https://smake-public.s3.eu-west-1.amazonaws.com/testfiles/packaging-slip.pdf",
                    "collection_name": "packing-slip"
                }
            ]
        }
    ],
    "payments": [
        {
            "payment_method": {
                "handle": "payment-method-handle"
            }
        }
    ]
}