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

{info} Pagination, Filtering

Example

{primary.fa-paper-plane} Request

GET /orders HTTP/1.1

{success} Response

HTTP/1.1 200 OK

{
    "data": [
        {
            "id": 1,
            "is_test": true,
            "external_identifier": null,
            "project_name": "et",
            "state": "delivered",
            "customer_locale": "en",
            "currency": "EUR",
            "total": 87.76,
            "subtotal": 86.63,
            "total_tax": 1.13,
            "total_items_price": 82.98,
            "shipping_line": {
                "title": "Pickup",
                "price": 4.47,
                "total": 4.78,
                "tax": 0.31
            },
            "created_at": "2017-09-27T10:10:59+00:00",
            "updated_at": "2017-09-27T10:11:03+00:00",
            "cancelled_at": null,
            "items": [
                {
                    "id": 1,
                    "quantity": 4,
                    "total": 82.98,
                    "price": 20.54,
                    "total_tax": 0.82,
                    "tax_rate": 1,
                    "variant": {
                        "id": 27,
                        "total": 186.58,
                        "price": 174.37,
                        "tax": 12.21,
                        "tax_rate": 7,
                        "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,
                    "street3": 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,
                "street3": 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,
                "street3": 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": 87.76,
                    "title": "Invoice"
                }
            ],
            "fulfillments": [
                {
                    "id": 1,
                    "order_id": 1,
                    "tracking_number": "2229446017085",
                    "created_at": "2017-09-27T10:11:02+00:00",
                    "updated_at": "2017-09-27T10:11:02+00: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,
            "is_test": true,
            "external_identifier": null,
            "project_name": "dicta",
            "state": "incompleted",
            "customer_locale": "en",
            "currency": "EUR",
            "total": 9.46,
            "subtotal": 8.94,
            "total_tax": 0.52,
            "total_items_price": 5.44,
            "shipping_line": {
                "title": "German Post Maxibrief",
                "price": 3.76,
                "total": 4.02,
                "tax": 0.26
            },
            "created_at": "2017-09-27T10:10:59+00:00",
            "updated_at": "2017-09-27T10:10:59+00:00",
            "cancelled_at": null,
            "items": [
                {
                    "id": 2,
                    "quantity": 1,
                    "total": 5.44,
                    "price": 5.18,
                    "total_tax": 0.26,
                    "tax_rate": 5,
                    "variant": {
                        "id": 53,
                        "total": 144.78,
                        "price": 135.31,
                        "tax": 9.47,
                        "tax_rate": 7,
                        "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,
                    "street3": 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,
                "street3": 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,
                "street3": 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": 9.46,
                    "title": "Invoice"
                }
            ],
            "fulfillments": [
                {
                    "id": 2,
                    "order_id": 2,
                    "tracking_number": "2229446017086",
                    "created_at": "2017-09-27T10:11:02+00:00",
                    "updated_at": "2017-09-27T10:11:02+00: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

Get order

Returns the order with id = x.

Example

{primary.fa-paper-plane} Request

GET /orders/1 HTTP/1.1

{success} Response

HTTP/1.1 200 OK

{
    "id": 1,
    "is_test": true,
    "external_identifier": null,
    "project_name": "et",
    "state": "delivered",
    "customer_locale": "en",
    "currency": "EUR",
    "total": 87.76,
    "subtotal": 86.63,
    "total_tax": 1.13,
    "total_items_price": 82.98,
    "shipping_line": {
        "title": "Pickup",
        "price": 4.47,
        "total": 4.78,
        "tax": 0.31
    },
    "created_at": "2017-09-27T10:10:59+00:00",
    "updated_at": "2017-09-27T10:11:03+00:00",
    "cancelled_at": null,
    "items": [
        {
            "id": 1,
            "quantity": 4,
            "total": 82.98,
            "price": 20.54,
            "total_tax": 0.82,
            "tax_rate": 1,
            "variant": {
                "id": 27,
                "total": 186.58,
                "price": 174.37,
                "tax": 12.21,
                "tax_rate": 7,
                "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,
            "street3": 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,
        "street3": 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,
        "street3": 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": 87.76,
            "title": "Invoice"
        }
    ],
    "fulfillments": [
        {
            "id": 1,
            "order_id": 1,
            "tracking_number": "2229446017085",
            "created_at": "2017-09-27T10:11:02+00:00",
            "updated_at": "2017-09-27T10:11:02+00: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"
        }
    ]
}