Get sales orders
const url = 'https://order.shopgate.io/v1/merchants/example/orders?includeInternalIds=false&limit=100&offset=0';const options = {method: 'GET'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://order.shopgate.io/v1/merchants/example/orders?includeInternalIds=false&limit=100&offset=0'Get sales orders
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Unique merchant code which represents the unique “merchant account”.
Query Parameters
Section titled “Query Parameters”Filter string. Supported filters: id, orderNumber, externalCode, name, customerId, contactType, status, date, submitDate, updateDate, fulfillDate, completeDate, fulfillmentStatus
Available fields: lineItems
The entity gets extended with the internal ID of Shopgate, this query cannot be used by external clients.
Items per page, for pagination, default is 10, max is 100
Offset for pagination, default is 0
Responses
Section titled “Responses”Return sales orders
object
object
Number of the Order. Its need to be unique in the system
Code of the source shop.
External order id
Customer identifier
A customer number / reference to an external system.
Indicates if the order needs to be threated expediently
Customer notes where the shopper can provide special instructions. The notes are shown in the In-Store App & Admin.
Special instructions of the order. It can contain special shipping or fulfillment instructions
object
Position in the AddressSequences-Array, mandatory for all fulfillment methods that include billing like directShip and BOPIS
Position in the AddressSequences-Array, mandatory for all fulfillment methods that include shipping like directShip
object
ISO 3166 ALPHA-2 / ISO 3166-2 Country Code
object
Number of a postbox
Number of a post
Validated according to country code
Validated according to country code
Validated according to country code
object
object
object
object
Contains all shipping method which are available fro this order segment. This property is only set if the order was not placed yet and is in the new status
object
object
object
Subtotal of the order
Total amount of all applied promotions with coupons on order level. Without line item level promotions, since these are already included in the order subtotal.
Tax amount of the first tax group (e.g. for german taxes this is an absolut number based on either 7% or 19% of the order total; the order total is 10.00 EUR so the taxAmount is 10.00 EUR * 0.19 = 1.9 EUR)
Tax amount of the second tax group (can be used for additional taxes like for example US state taxes)
Shipping total without any discounts. Its based on the line items in the order
Sum of discounts applied to the shipping total
Shipping total including all discounts
object
Total sum of the order including tax, shipping and discounts
Date of the order when it was created in the Shopgate system
Date when the order was submitted by the customer
Date when the order status was changed to fulfilled
Date when the order status was changed to completed
IP address from the client where the order was placed. It can be a IPv4 or IPv6 address
The UserAgent string from headers of the incoming request.
The domain from which order came.
The platform from which the order came.
Operation system of the source device
Indicates if the order has been imported from an external system. Enabling this flag means that there will be no further processes triggered by this order like emitting events, calculating properties like prices, or starting payment transactions.
Campaign the order should be attributed to
object
object
Line Item id of the item to update. In case of an insert this field is not required
Reason for a quantity change. Needs to be set if a new quantity is set. Deprecated reasons:
- wrongAttribute
- wrongProduct
- changedMind
- brokenOrDamaged
- outOfStock
object
object
Example
{ "orders": [ { "orderNumber": "1293747", "shopCode": "shop_12345", "externalCode": "000000274", "type": "standard", "customerId": "55c98b8e-1100-497c-8df6-4b4f0353ab2a", "externalCustomerNumber": "C1756793", "status": "new", "expedited": false, "localeCode": "de-de", "currencyCode": "EUR", "taxExempt": false, "notes": "Some note", "specialInstructions": "House behind the dumpster", "data": {}, "fulfillmentStatus": "open", "primaryBillToAddressSequenceIndex": 0, "primaryShipToAddressSequenceIndex": 0, "addressSequences": [ { "type": "shipping", "customerContactId": "0b475af4-7ed9-4065-b4bb-7d76c537d820", "firstName": "Max", "middleName": "René", "lastName": "Muster", "company": "Shopgate GmbH", "address1": "Schloßstr. 10", "address2": "Haus B", "address3": "erste Etage", "address4": null, "city": "Butzbach", "region": "HE", "postalCode": "35510", "country": "DE", "additionalFields": { "dhlPostBoxNumber": 12345, "dhlPostNumber": 1234567890 }, "phone": "+49 12345 6789 001", "fax": "+49 12345 6789 002", "mobile": "+49 12345 6789 003", "emailAddress": "max.muster@shopgate.com", "orderSegment": { "selectedShippingMethod": { "code": "standardShipping", "serviceLevel": { "code": "standard", "carrier": { "code": "DHL", "name": "DHL International" }, "name": "DHL Standard", "cost": 4.99, "iconUrl": "https://myserver.com/DHL.png" }, "name": "Standard Shipping" }, "availableShippingMethods": [ { "code": "standardShipping", "name": "Standard Shipping", "serviceLevels": [ { "code": "string", "name": "DHL Standard", "cost": 4.99, "iconUrl": "https://myserver.com/DHL.png", "carrier": { "code": "DHL", "name": "DHL International" } } ] } ] } } ], "subTotal": 65.99, "discountAmount": 0, "promoAmount": 0, "taxAmount": 12.54, "tax2Amount": 0, "shippingSubTotal": 4.99, "shippingDiscountAmount": 0, "shippingPromoAmount": 0, "shippingTotal": 4.99, "taxSummary": [ { "code": "default_19", "name": "19%", "amount": 12.54 } ], "total": 70.98, "date": "2021-12-16T16:05:21.342Z", "submitDate": "2019-09-02T09:02:57.733Z", "fulfillDate": "2019-09-03T15:02:32.733Z", "completeDate": "2019-09-03T15:02:57.733Z", "sourceIp": "85.45.62.2", "userAgent": "Mozilla/5.0 (Android 4.4; Mobile; rv:41.0) Gecko/41.0 Firefox/41.0", "domain": "www.mydomain.com", "platform": "engage", "os": "ios", "imported": false, "campaignAttribution": { "campaignCode": "CMP-1", "channel": "push", "distributionIndex": 0 }, "lineItemCount": 1 } ], "meta": { "limit": 100, "offset": 0, "totalItemCount": 1 }}
