Get sales order
const url = 'https://order.shopgate.io/v1/merchants/example/orders/example?includeInternalIds=false&getOriginalImageUrls=true';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/example?includeInternalIds=false&getOriginalImageUrls=true'Get sales order
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Unique merchant code which represents the unique “merchant account”.
Unique order number
Query Parameters
Section titled “Query Parameters”The entity gets extended with the internal ID of Shopgate, this query cannot be used by external clients.
List of specific fields or groups to return. Possible values are: customer, orderUrl, isOrderable
Responses
Section titled “Responses”Return sales order
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
External identifier for this transaction
object
Originally authorized amount
Charged amount of this transaction
Different from payment method to payment method
object
object
External error code of the provider
object
object
Is set if the type is cc
object
object
object
The actual package weight.
object
The date and time of the package entering status “inTransit” or “fulfilled”.
object
object
object
object
object
Coupon of the order. If the order is in the status new only the code needs to be passed For all other status the whole object should to be filled out with to have all information of the coupons persist for transparency purposes.
object
Code of the coupon
Name of the coupon
object
Limit for the overall usage of this coupon
Indicates how often this coupon can be used per customer
object
object
Name of the Coupon
object
Reason for a quantity change. Needs to be set if a new quantity is set. Deprecated reasons:
- wrongAttribute
- wrongProduct
- changedMind
- brokenOrDamaged
- outOfStock
Sum of this line item in fulfillment orders.
Identifier for the line item. Needs to be unique within the sales order.
Identifier for the parent line item. Needs to be unique within the sales order.
Index of the address in the address sequence array where it should be shipped to
object
Product code
Product name
Main image url of the product
Main price of the product
Sale price of the product
object
object
object
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)
Amount of all applied promotions for a single unit (single quantity).
Amount of all applied discounts (promotions with coupons) for a single unit (single quantity).
Total amount of all applied promotions with coupons for the line item. (Formula: lineItem.unitDiscountAmount * lineItem.quantity)
Total amount of all applied promotions for the line item. (Formula: lineItem.unitPromoAmount * lineItem.quantity)
The extended Price is the final price of the line item, including all discounts & promotions that apply to this line item, and also already multiplied with the quantity. Formula: (product.price or product.salePrice if not empty) * quantity + promoAmount + discountAmount. Example: A product original price is 60€ (product.price), but it is on sale for 40€ (product.salePrice). Ordered quantity is 2, there is no discount but there is a promotion that applies to this product and gives 10% additional discount (unitPromoAmount = 4€, promoAmount = 8€). The extended price of this line item should be (40€ * 2) + (-8€) = 72€.
Price of the line item. Formula: (product.price or product.salePrice if not empty) * quantity
Determines if a substitution is allowed for this line item.
object
Id of the fulfillment slot
Hour and minute of the day where the time should start
Limit of orders which can be placed in this slot. This value can only be set for the type fulfillmentSlot
Applied promotions of the order. If the order is in the status new this parameter will be ignored. The system will automatically calc the promotions for the order
object
Promotional text that will be displayed to the customer
object
object
Describes the impact of the promotion to specific line items. This only applies to BOGO promotions
object
Condition for products which should be impacted by the promotion
This only applies to BOGO promotions.
Available condition fields are:
- lineItem.product.code
- lineItem.product.categoryCode
- lineItem.product.price
- lineItem.product.salePrice
- lineItem.product.quantity
- lineItem.product.options.<optionsCode>
- lineItem.product.properties.<propertyCode>
Indicates if the product which the customer would receive is automatically added to the cart. This only applies if the condition has one rule with a single product code
object
Unique coupon code. This code can be used by the end customer to activate a promotion in his cart.
Name of the Coupon
object
Limit for the overall usage of this coupon
Indicates how often this coupon can be used per customer
object
Only available and must be set for generated couponSet type.
Set the limits how often the promotion can be used by a customer and with which other promotion it can be combined. For the field cantBeCombinedWithPromotionCode promotion code(s) can be given or a special code anyProductPromotions|anyOrderPromotions that will exclude any product|order promotion when it gets calculated. Available condition fields are:
- maxOverallUsageCount
- maxCustomerUsageCount
- maxUsagePerOrder (only works for target=product)
- cantBeCombinedWithPromotionCode
Applied promotions of the order. If the order is in the status new this parameter will be ignored. The system will automatically calc the promotions for the order
object
Promotional text that will be displayed to the customer
object
object
Describes the impact of the promotion to specific line items. This only applies to BOGO promotions
object
Condition for products which should be impacted by the promotion
This only applies to BOGO promotions.
Available condition fields are:
- lineItem.product.code
- lineItem.product.categoryCode
- lineItem.product.price
- lineItem.product.salePrice
- lineItem.product.quantity
- lineItem.product.options.<optionsCode>
- lineItem.product.properties.<propertyCode>
Indicates if the product which the customer would receive is automatically added to the cart. This only applies if the condition has one rule with a single product code
object
Unique coupon code. This code can be used by the end customer to activate a promotion in his cart.
Name of the Coupon
object
Limit for the overall usage of this coupon
Indicates how often this coupon can be used per customer
object
Only available and must be set for generated couponSet type.
Set the limits how often the promotion can be used by a customer and with which other promotion it can be combined. For the field cantBeCombinedWithPromotionCode promotion code(s) can be given or a special code anyProductPromotions|anyOrderPromotions that will exclude any product|order promotion when it gets calculated. Available condition fields are:
- maxOverallUsageCount
- maxCustomerUsageCount
- maxUsagePerOrder (only works for target=product)
- cantBeCombinedWithPromotionCode
Selected fulfillment slots of the selected locations. You can only select on slot per location
object
Id of the fulfillment slot
Hour and minute of the day where the time should start
Limit of orders which can be placed in this slot. This value can only be set for the type fulfillmentSlot
Customer of the order. This property only exists if ‘customer’ is passed in the field query parameter.
object
Internal Customer number, set automatically upon creation
External Customer number
First name of the customer
Middle name of the customer
Last name of the customer
Indicates anonymous/guest customer.
Tax class of the customer.
object
API identifier for the contact
External identifier of the contact
object
Number of a postbox
Number of a post
Validated according to country code
Validated according to country code
Validated according to country code
Custom customer attribute
object
Code of the defined customer attribute
Value for this attribute. Its a free text field for attributes where no values are set. Attributes which have value set should contains the code in an object. For instance value: { "code": "fish" }
Human readable name of the attribute
All customer settings which are defined by Shopgate
object
Communication Preferences.
Indicates if this order is orderable. Its used for the checkout. This property only exists if ‘isOrderable’ is passed in the field query parameter.
Example
{ "order": { "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": 6.6, "taxAmount": 0, "tax2Amount": 0, "shippingSubTotal": 4.99, "shippingDiscountAmount": 0, "shippingPromoAmount": 0, "shippingTotal": 0, "taxSummary": [ { "code": "default_19", "name": "19%", "amount": 11.28 } ], "total": 59.39, "date": "2021-12-16T16:17:47.929Z", "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, "returnStatus": "partialReturn", "paymentTransactions": [ { "id": "edadf6a6-f536-489f-92b8-c15fc1edc19b", "externalCode": "pi_GTS8a787uuRMaC86GBxpDABYn", "status": "failed", "type": "order", "paymentMethod": { "code": "stripe", "type": "cc", "provider": "stripe" }, "authorizedAmount": 59.39, "chargedAmount": 0, "checkoutParams": { "paymentIntent": "geosjhgirhgsigpr" }, "paymentError": { "message": "Your card has insufficient funds", "code": "card_declined" }, "paymentInfo": { "type": "cc", "card": { "type": "visa", "last4": 4242 } } } ], "fulfillmentGroups": [ { "id": 648, "fulfillmentMethod": "directShip", "fulfillmentLocationCode": "string", "shipToAddressSequenceIndex": 0, "fulfillments": [ { "status": "open", "carrier": "DHL", "serviceLevel": "sameDay", "tracking": "JJD000390007882823450", "fulfillmentPackages": [ { "status": "open", "serviceLevel": "sameDay", "package": "small", "fulfilledFromLocationCode": "DERetail001", "weight": 2000, "weightUnit": "g", "dimensions": { "length": 25, "lengthUnit": "cm", "width": 17.5, "widthUnit": "cm", "height": 10, "heightUnit": "cm" }, "tracking": "JJD000390007882823450", "pickUpBy": "Kim Muster", "labelUrl": "https://documentserver.internal/label/label.pdf", "fulfillmentDate": "2021-12-16T16:17:47.929Z", "packageItems": [ { "salesOrderLineItemCode": "386", "quantity": 1, "id": 457 } ], "id": 694, "additionalProp1": {} } ], "id": 981 } ] } ], "coupons": [ { "code": "SUMMER2020", "name": "Coupon for Summer 2020", "limits": { "overall": 500, "maxPerCustomer": 1 }, "status": "active", "couponSet": null, "promotion": { "code": "promo", "name": "Promo with Coupon" } } ], "lineItems": [ { "quantityChangeReason": "wrongItem", "status": "inProgress", "subStatus": null, "code": "386", "quantity": 1, "routedQuantity": 1, "fulfillmentMethod": "directShip", "fulfillmentLocationCode": "DERetail001", "shipToAddressSequenceIndex": 0, "product": { "code": "24-MB02", "name": "Fusion Backpack", "image": "https://myawesomeshop.com/images/img1.jpg", "price": 79.99, "salePrice": 65.99, "currencyCode": "EUR", "identifiers": { "mfgPartNum": "100-440-0.750-3434-A", "upc": "72527273070", "ean": "401234567890", "isbn": "978-3-16-148410-0", "sku": "UGG-BB-PUR-06", "distiPartNum": "235454356363" }, "options": [ { "code": "color", "name": "Color", "value": { "code": "red", "name": "Red" } } ] }, "currencyCode": "EUR", "shippingAmount": 0, "taxAmount": 0, "tax2Amount": 0, "taxExempt": false, "unitPromoAmount": 0, "unitDiscountAmount": 0, "discountAmount": 0, "promoAmount": 0, "overrideAmount": 0, "extendedPrice": 65.99, "price": 79.99, "salePrice": 65.99, "substitutionAllowed": true, "returnQuantity": 1, "fulfillmentSlot": { "id": "5_2019-09-03", "date": "2019-09-03", "weekday": "fri", "from": "08:00", "to": "08:59", "status": "active", "orderCount": 10 }, "appliedPromotions": [] } ], "appliedPromotions": [ { "code": "2020summerPromotion", "name": "Summer Promotion for 2020", "model": "simpleDiscount", "description": "This promotion is for our summer coupons", "promotionalText": "This coupons gives you 10% off to celebrate the summer 2020", "status": "active", "startDate": "2020-07-01T00:00:000", "endDate": "2020-07-01T00:00:000", "target": "order", "type": "promotion", "discount": { "type": "percentage", "amount": 10 }, "conditions": { "$and": [ { "subTotal": { "gte": 100 } }, { "$or": [ { "fulfillmentMethod": { "$in": [ "directShip", "BOPIS", "ROPIS" ] } }, { "customer.segment.code": { "$in": [ "employees", "contractors" ] } } ] } ] }, "impact": { "conditions": { "lineItem.product.categoryCode": { "$in": [ "backpacks" ] }, "lineItem.quantity": 1 }, "automaticallyAddedToCart": false }, "coupon": { "code": "summer2020", "name": "Coupon 10off for the summer 2020", "limits": { "overall": 10, "maxPerCustomer": null } }, "couponSet": null, "limitConditions": { "maxOverallUsageCount": 100, "maxCustomerUsageCount": 1, "maxUsagePerOrder": 1, "cantBeCombinedWithPromotionCode": { "$in": [ "bogo1" ] } } } ], "fulfillmentSlots": { "id": "5_2019-09-03", "date": "2019-09-03", "weekday": "fri", "from": "08:00", "to": "08:59", "status": "active", "orderCount": 10 }, "customer": { "id": "d162439c-e2f9-4050-8b94-6bff33e8163b", "internalCustomerNumber": 2, "externalCustomerNumber": "10001", "firstName": "Max", "middleName": "René", "lastName": "Muster", "emailAddress": "max.muster@shopgate.com", "status": "active", "isAnonymous": true, "externalUpdateDate": "2021-12-16T16:17:47.929Z", "taxExempt": false, "taxClass": "string", "contacts": [ { "id": "55a94ee0-6671-11e9-bb49-13684cb7b248", "externalContactCode": "357709b0-9378-470b-976e-1b040e29b97b", "status": "active", "firstName": "Max", "middleName": "René", "lastName": "Muster", "companyName": "Shopgate GmbH", "address1": "Schloßstr. 10", "address2": "Haus B", "address3": "erste Etage", "address4": null, "city": "Butzbach", "postalCode": "35510", "region": "HE", "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", "isDefaultBilling": true, "isDefaultShipping": true, "externalUpdateDate": "2021-12-16T16:17:47.929Z" } ], "attributes": [ { "code": "tshirtSize", "name": "T-Shirt Size", "value": { "code": "l", "name": "L" } }, { "code": "nameOfCat", "name": "Name of your cat", "value": "Some Cat Name" } ], "settings": { "defaultLocale": "de-de", "defaultCurrency": "EUR", "communicationPreferences": [ "email", "push", "sms" ], "defaultLocationCode": "DERetail001", "marketingOptIn": false } }, "isOrderable": true }}
