POST

get_orders

This method returns a complete order list. The date_from and date_to parameters can be used to set a date range. The limit parameter limits the number of results, with 100 as the maximum value. The offset parameters indicates the number of results to be skipped.

Query parameters

action
string

Requested method

required
default : get_orders
shop_number
string

Your shop number. Example: “10123”

required
date_from
string

Start date of the query. (Format ISO 8601). Example: “2012-01-15T09:53:50+01:00”

format : date
date_to
string

End date of the query. (Format ISO 8601). Example: “2012-02-20T10:12:47+01:00”

limit
integer

Number of results to be returned from the query. (Default = 50, Max = 100)

offset
integer

Number of results to be skipped. Can be used to browse through the results. (Default = 0)

order_numbers
array[string,array]

Limits the results to the order numbers entered in the parameter. Example: order_numbers[0]=“1012001234”, order_numbers[1]=“1012001235”

with_items
boolean

Setting this parameter to 1 retrieves every order’s items. (Default = 0)

trace_id
string

A unique request ID. Example: “spa-4f99573d74ae1”

Response

application/json
object
error_text
null
error
integer
sma_version
string
trace_id
string
limit
integer
offset
integer
has_more_results
boolean
orders
array[object]

Error Codes

Code Description
101 Unknown action
103 “shop_number” not set
110 Merchant not found
113 Shop not found
118 Missing parameters
123 Following parameters of wrong type: […]
400 Authorization not set
400 Authorization not set
401 Authorization username invalid format
402 Generated authorization password invalid
403 Generated authorization is too old
404 The given OAuth2 access token is invalid
405 Shop has no rights to access API. Make sure your contract is valid
999 Unknown error

Example

{
    "error_text": null,
    "error": 0,
    "sma_version": "1.0",
    "trace_id": "spa-4f99573d74ae1",
    "limit": 100,
    "offset": 0,
    "has_more_results": false,
    "orders": [
        {
            "order_number": "1012001931",
            "external_order_number": null,
            "external_order_id": null,
            "customer_number": "100816",
            "mail": "johnsmith@shopgate.com",
            "phone": null,
            "mobile": null,
            "custom_fields": [
                {
                    "label": "Birthday",
                    "internal_field_name": "dob",
                    "type": "date",
                    "value": "1981-05-26"
                }
            ],
            "external_customer_number": null,
            "external_customer_id": null,
            "confirm_shipping_url": "https://www.shopgate.com/clickcs/12345678/bf18fa0a2c67ced533e8c81dfa40ef85",
            "created_time": "2012-04-26T16:07:54+02:00",
            "payment_method": "DEBIT",
            "payment_group": "DEBIT",
            "is_paid": 1,
            "payment_time": "2012-04-26T16:08:39+02:00",
            "payment_transaction_number": null,
            "payment_infos": {
                "bank_account_holder": "John Smith",
                "bank_account_number": "2433702",
                "bank_code": "51390000",
                "bank_name": "World Bank",
                "iban": null,
                "bic": null
            },
            "is_shipping_blocked": 0,
            "is_shipping_completed": 1,
            "shipping_completed_time": "2012-04-26T16:09:56+02:00",
            "amount_items": "14.96",
            "amount_shipping": "0.00",
            "amount_payment": "14.96",
            "amount_complete": "14.96",
            "client": {
                "type": "mobilesite"
            }
            "currency": "EUR",
            "is_test": 0,
            "is_storno": 0,
            "invoice_address": {
                "gender": null,
                "first_name": "John",
                "last_name": "Smith",
                "birthday": null,
                "company": "Test Company",
                "street_1": "Main Street 10",
                "street_2": null,
                "city": "Berlin",
                "zipcode": "10667",
                "country": "DE",
                "state": null,
                "custom_fields": [
                    {
                        "label": "Floor",
                        "internal_field_name": "floor",
                        "type": "string",
                        "value": "2nd"
                    }
                ]
            },
            "delivery_address": {
                "gender": null,
                "first_name": "John",
                "last_name": "Smith",
                "birthday": null,
                "company": "Test Company",
                "street_1": "Main Street 10",
                "street_2": null,
                "city": "Berlin",
                "zipcode": "10667",
                "country": "DE",
                "state": null,
                "custom_fields": [
                    {
                        "label": "Floor",
                        "internal_field_name": "floor",
                        "type": "string",
                        "value": "2nd"
                    }
                ]
            },
            "shipping_group": "DPD",
            "shipping_type": "MANUAL",
            "shipping_infos": {
                "name": "My DPD Example",
                "amount": "4.99",
                "amount_net": "4.59",
                "amount_gross": "4.99",
                "weight": 700
            },
            "items": [
                {
                    "order_item_id": "1231123",
                    "item_number": "8",
                    "quantity": 1,
                    "name": "Undercover Blues",
                    "unit_amount": "12.57",
                    "unit_amount_with_tax": "14.96",
                    "tax_percent": "19.00",
                    "currency": "EUR",
                    "internal_order_info": "{\"exchange_rate\":\"1.00000000\"}",
                    "options": [ ],
                    "inputs": [ ]
                }
            ],
            "delivery_notes": [
                {
                    "shipping_type": "DHL",
                    "tracking_number": "JJD1412345678901",
                    "shipping_time": "2012-04-26T00:00:00+02:00"
                }
            ]
        }
    ]
}