POST

get_orders

This action implements retrieval of order data from your shop. If a customer already has an account in your online shop, you can allow them to see the current status of their orders on the mobile website or in the mobile apps.

Query parameters

action
string

Requested method
Example:

required
shop_number
string

Your shop number.
Example: “11413”

required
customer_token
string

Shopgate customer token in the online store
Example: “YY5UwgsjrYVFwqzAYx”

required
customer_language
string

Shopgate customer language (language part: ISO-639 lowercase, country part: ISO-3166 uppercase)
Example: “en_US”

required
limit
integer

Example: 10

default : 10
offset
integer

Example: 0

default : 0
order_date_from
string

returns orders which are created after the given date time format (Format ISO 8601)
Example: “2013-02-08T09:20:25+01:00”

default :
sort_order
string

return the orders in the given sort_order
Example: created_asc

default : created_desc
trace_id
string

Unique request trace ID.
Example: “sma-9412”

required

Response

application/json
object
error
integer
error_text
null
trace_id
string
shopgate_library_version
string
plugin_version
string
orders
array[object]

Error Codes

Code Description
2 cannot open/create logfile(s)
10 invalid value in configuration
11 error reading or writing configuration
20 no action specified
21 unknown action requested
22 disabled action requested
23 wrong response format
72 customer token missing
73 invalid customer token
74 customer language missing
75 customer account not confirmed
77 customer account insufficient permissions
83 database error
100 no connection to server
101 Unknown action
102 error code received from merchant API
120 authentication failed
999 Unknown error

Example

{
  "error": 0,
  "error_text": null,
  "trace_id": "sma-76315",
  "shopgate_library_version": "2.9.32",
  "plugin_version": "2.9.20",
  "orders": [
    {
      "order_number": null,
      "external_order_number": "AB-1267",
      "external_order_id": "509",
      "status_name": "Shipped",
      "status_color": null,
      "created_time": "2015-08-25T07:10:47",
      "mail": "customer@merchant.com",
      "phone": "+4960337470",
      "mobile": null,
      "custom_fields": [
        {
          "label": "Customer Comments",
          "internal_field_name": "ocomment",
          "value": "This is a comment"
        }
      ],
      "invoice_address": {
        "first_name": "Max",
        "last_name": "Mustermann",
        "gender": "m",
        "birthday": null,
        "company": null,
        "street_1": "Schloßstrasse 10",
        "street_2": null,
        "zipcode": "35510",
        "city": "Butzbach",
        "country": "DE",
        "state": "HE",
        "phone": "+4960337470",
        "mobile": null,
        "mail": null,
        "custom_fields": []
      },
      "delivery_address": {
        "first_name": "Max",
        "last_name": "Mustermann",
        "gender": "m",
        "birthday": null,
        "company": null,
        "street_1": "Schloßstrasse 10",
        "street_2": null,
        "zipcode": "35510",
        "city": "Butzbach",
        "country": "DE",
        "state": "HE",
        "phone": "+4960337470",
        "mobile": null,
        "mail": null,
        "custom_fields": []
      },
      "currency": "EUR",
      "amount_items_gross": 119,
      "amount_items_net": 100,
      "amount_complete_gross": 124.95,
      "amount_complete_net": 105,
      "is_paid": 1,
      "payment_method": "Paypal",
      "payment_time": "2015-08-25T07:10:46",
      "payment_transaction_number": null,
      "is_shipping_completed": 1,
      "shipping_completed_time": "2015-08-28T12:15:15",
      "delivery_notes": [
        {
          "shipping_service_id": "DHL",
          "shipping_service_name": "DHL Standard",
          "tracking_number": "129834765",
          "shipping_time": "2015-08-28T12:15:15"
        }
      ],
      "order_taxes": [
        {
          "label": "Mehrwertsteuer",
          "tax_percent": 19,
          "amount": 19.95
        }
      ],
      "extra_costs": [
        {
          "type": "shipping",
          "tax_percent": 19,
          "amount": 5.95,
          "label": "Shipping costs"
        }
      ],
      "external_coupons": [],
      "items": [
        {
          "item_number": "1",
          "item_number_public": "1001",
          "quantity": 1,
          "name": "Coffee Mug",
          "unit_amount": 100,
          "unit_amount_with_tax": 119,
          "tax_percent": 19,
          "currency": "EUR"
        }
      ]
    },
    {
      "order_number": null,
      "external_order_number": "AB-1567",
      "external_order_id": "698",
      "status_name": "In Progress",
      "status_color": null,
      "created_time": "2015-09-24T14:18:32",
      "mail": "customer@merchant.com",
      "phone": "+4960337470",
      "mobile": null,
      "custom_fields": [],
      "invoice_address": {
        "first_name": "Max",
        "last_name": "Mustermann",
        "gender": "m",
        "birthday": null,
        "company": null,
        "street_1": "Schloßstrasse 10",
        "street_2": null,
        "zipcode": "35510",
        "city": "Butzbach",
        "country": "DE",
        "state": "HE",
        "phone": "+4960337470",
        "mobile": null,
        "mail": null,
        "custom_fields": []
      },
      "delivery_address": {
        "first_name": "Max",
        "last_name": "Mustermann",
        "gender": "m",
        "birthday": null,
        "company": null,
        "street_1": "Schloßstrasse 10",
        "street_2": null,
        "zipcode": "35510",
        "city": "Butzbach",
        "country": "DE",
        "state": "HE",
        "phone": "+4960337470",
        "mobile": null,
        "mail": null,
        "custom_fields": []
      },
      "currency": "EUR",
      "amount_items_gross": 130.9,
      "amount_items_net": 110,
      "amount_complete_gross": 136.85,
      "amount_complete_net": 115,
      "is_paid": 0,
      "payment_method": "Cash on Delivery",
      "payment_time": null,
      "payment_transaction_number": null,
      "is_shipping_completed": 0,
      "shipping_completed_time": null,
      "delivery_notes": [],
      "order_taxes": [
        {
          "label": "Mehrwertsteuer",
          "tax_percent": 19,
          "amount": 19.95
        }
      ],
      "extra_costs": [
        {
          "type": "shipping",
          "tax_percent": 19,
          "amount": 5.95,
          "label": "Shipping costs"
        }
      ],
      "external_coupons": [],
      "items": [
        {
          "item_number": "1",
          "item_number_public": "1001",
          "quantity": 1,
          "name": "Coffee Mug",
          "unit_amount": 100,
          "unit_amount_with_tax": 119,
          "tax_percent": 19,
          "currency": "EUR"
        },
        {
          "item_number": "246",
          "item_number_public": "AX-1D3573",
          "quantity": 1,
          "name": "Base Cap",
          "unit_amount": 10,
          "unit_amount_with_tax": 11.9,
          "tax_percent": 19,
          "currency": "EUR"
        }
      ]
    }
  ]
}