XM

Retrieve Orders By Authorization Token

Path:

GET https://{baseurl}/api-order/orders/user?offset=0&limit=10

This API enables your customers to retrieve their order details, in a paginated response. This is secured by Authorization Token.

Headers

Content-Type : application/json

Authorization: JWT userAuthToken

x-site-context : { "date": "2020-08-28T02:35:27.787Z", "channel": 12, "account": 5f493c9f30ec2a0007a94fc8", "stage": "sandbox" }

Parameters

Type : query

Name : The offset and limit values to retrieve order details in a paginated response. When no value is specified, the default value used for offset and limit are 0 and 10 respectively.

Required: true

Sample Request

Path:

https://{baseurl}/api-order/orders/user?offset=0&limit=2

Response

Response Code: 200

Message: OK

Description: You'll see this message when the order details are successfully retrieved. The response is a list of orders in the account based on the query criteria. Each object with in the array of the orders object is a separate order.

{
"query": {
"limit": 2,
"offset": 0,
"count": 19,
"orderTotalSum": 31719.46,
"orderAverage": 1669.45,
"totalQuantitySum": 132,
"statusCounts": {
"ORDER_CREATED": 13,
"ORDER_CONFIRMED": 0,
"ORDER_CANCELLED": 1,
"ORDER_PARTIALLY_SHIPPED": 0,
"ORDER_SHIPPED": 2,
"ORDER_PARTIALLY_DELIVERED": 0,
"ORDER_DELIVERED": 0,
"ORDER_RETURNED": 0,
"ORDER_PARTIALLY_RETURNED": 0,
"ORDER_PAYMENT_AUTHORIZED": 2,
"ORDER_PAYMENT_INVALID": 0,
"ORDER_FULFILLED": 0,
"ORDER_PARTIALLY_FULFILLED": 1
}
},
"orders": [
{
"_id": "60ca5d3dc0fac00008e64c91",
"tags": [],
"cartId": "60ca5b6ae3b5d900081ae44a",
"customerUserId": "60c128045a38bf0009ad6502",
"attributes": [],
"customerEmail": "[email protected]",
"orderCurrency": "USD",
"orderTotal": 90.5,
"taxTotal": 0.5,
"channel": 12,
"status": "ORDER_CREATED",
"statusLog": "Order has been created",
"orderReference": "1635-8532-92190",
"orderId": "8677-7648-19307",
"shipTo": [
{
"pickupPerson": {
"name": {
"first": "John",
"last": "Doe"
},
"phone": {
"number": "8087769338",
"kind": "Mobile"
},
"email": "[email protected]"
},
"altPickupPerson": {
"name": {
"first": "first",
"last": "last"
},
"phone": {
"number": "8087769338",
"kind": "Mobile"
},
"email": "[email protected]"
},
"promosApplied": [],
"_id": "60ca5c1c9f490e0008020b28",
"shipToType": "BOPIS",
"taxCode": "FR1000",
"shipToId": 390,
"price": 0,
"currency": "",
"shipmentMethodId": "",
"estimatedTax": 0.5,
"shipmentCarrier": "",
"shipmentMethod": "",
"total": 0.5,
"id": "60ca5c1c9f490e0008020b28"
}
],
"items": [
{
"group": [
"123123123123123213212222"
],
"promosApplied": [],
"_id": "60ca5b6ae3b5d900081ae44b",
"price": 90,
"weightUnit": "lb",
"isPickup": true,
"itemId": 89,
"quantity": 1,
"priceListId": 100000,
"sku": "GardenWoodSofa",
"taxCode": "tytuy",
"title": "Garden Wood Sofa",
"weight": 2345,
"lineItemId": 1,
"attributeTotalPrice": 0,
"attributes": [],
"warehouseId": "60bf9615e66d120008b37e5e",
"currency": "USD",
"shipToId": 390,
"discount": 0,
"estimatedTax": 0,
"total": 90,
"reservedLocation": [
{
"_id": "60ca5d3e06b91d0008427435",
"warehouseId": "60bf9615e66d120008b37e5e",
"quantity": 1,
"id": "60ca5d3e06b91d0008427435"
}
],
"id": "60ca5b6ae3b5d900081ae44b"
}
],
"shipments": [],
"payments": [
{
"billToAddress": {
"name": {
"first": "John",
"last": "Smith"
},
"phone": {
"number": "07780811973",
"kind": "mobile"
},
"email": "[email protected]",
"street1": "600 Congress Ave",
"street2": "suite 219",
"city": "Austin",
"state": "Tx",
"country": "US",
"zipCode": "10033"
},
"shipToId": [
390
],
"_id": "60ca5d3dc0fac00008e64c94",
"paymentStatus": "succeeded",
"amount": 90.5,
"currency": "USD",
"paymentIdentifier": {
"cardIdentifier": "4242"
},
"paymentMethod": "visa",
"paymentKind": "CARD_STRIPE",
"conversion": 1,
"paymentToken": {
"token": "pi_1J35DCJxr7zyIFb9axtM3OKv",
"type": "CARD_STRIPE"
},
"id": "60ca5d3dc0fac00008e64c94"
}
],
"revision": 0,
"totalQuantity": 1,
"statusDescriptions": [],
"events": [],
"pickups": [],
"createdAt": "2021-06-16T20:21:17.038Z",
"updatedAt": "2021-06-16T20:21:18.355Z",
"__v": 0
},
{
"_id": "60c7a091d17c5b000920cefe",
"tags": [],
"cartId": "60c7a089147af80008cd5b07",
"customerUserId": "60c128045a38bf0009ad6502",
"attributes": [],
"customerEmail": "[email protected]",
"orderCurrency": "USD",
"orderTotal": 700,
"taxTotal": 0,
"channel": 12,
"status": "ORDER_SHIPPED",
"statusLog": "Order has been shipped",
"orderReference": "3904-7477-79114",
"orderId": "9773-9497-40152",
"shipTo": [
{
"address": {
"name": {
"first": "First",
"last": "Last"
},
"phone": {
"number": "998-992-9404",
"kind": "Mobile"
},
"street1": "3520, Crowley Drive",
"city": "Vancouver",
"state": "BC",
"country": "Canada",
"zipCode": "98004",
"kind": "shipping",
"email": "[email protected]"
},
"promosApplied": [],
"_id": "60c7a08c8d0ea300088c9e9a",
"shipToType": "SHIP_TO_ADDRESS",
"taxCode": "FR1000",
"shipToId": 334,
"price": 0,
"shipmentMethodId": "10003",
"estimatedTax": 0,
"shipmentCarrier": "Fedex",
"shipmentMethod": "Next Day",
"total": 0,
"id": "60c7a08c8d0ea300088c9e9a"
}
],
"items": [
{
"group": [
"123123123123123213212222"
],
"promosApplied": [
{
"unit": "%OFF",
"value": 100,
"ON": {
"kind": "SERVICE",
"value": [
{
"label": "Fedex - Next Day Delivery",
"isSelected": true,
"key": "Fedex_Next_Day_Delivery",
"methodIds": [
10003
]
},
{
"label": "DHL - Next Day Delivery",
"isSelected": true,
"key": "DHL_Next_Day_Delivery",
"methodIds": [
10005,
10006,
10007,
10008
]
}
]
},
"id": "60c26dd7a014a30008e1e9e1",
"promoId": "60c26dd7a014a30008e1e9df",
"promoCode": "shiptrio"
},
{
"unit": "%OFF",
"value": 5,
"ON": {
"kind": "SKU",
"value": null
},
"id": "60c6e7776d6fd800094504e8",
"promoId": "60c6e5c339c1e00009c3b974"
},
{
"unit": "%OFF",
"value": 100,
"ON": {
"kind": "SKU",
"value": null
},
"id": "60c6e579ac3abe000807002c",
"promoId": "60c6e56439c1e00009c3b96e"
}
],
"_id": "60c7a08b147af80008cd5b09",
"price": 200,
"weightUnit": "lb",
"isPickup": false,
"itemId": 90,
"quantity": 2,
"priceListId": 100000,
"sku": "Bench",
"taxCode": "ASD789",
"title": "Bench",
"weight": 5,
"lineItemId": 1,
"attributeTotalPrice": 0,
"attributes": [],
"currency": "USD",
"shipToId": 334,
"discount": 200,
"estimatedTax": 0,
"total": 400,
"reservedLocation": [
{
"_id": "60c7aa9cb4c6c80009496e2c",
"warehouseId": "60bf9615e66d120008b37e5e",
"quantity": 2,
"id": "60c7aa9cb4c6c80009496e2c"
}
],
"id": "60c7a08b147af80008cd5b09"
},
{
"group": [
"123123123123123213212222"
],
"promosApplied": [
{
"unit": "%OFF",
"value": 100,
"ON": {
"kind": "SERVICE",
"value": [
{
"label": "Fedex - Next Day Delivery",
"isSelected": true,
"key": "Fedex_Next_Day_Delivery",
"methodIds": [
10003
]
},
{
"label": "DHL - Next Day Delivery",
"isSelected": true,
"key": "DHL_Next_Day_Delivery",
"methodIds": [
10005,
10006,
10007,
10008
]
}
]
},
"id": "60c26dd7a014a30008e1e9e1",
"promoId": "60c26dd7a014a30008e1e9df",
"promoCode": "shiptrio"
},
{
"unit": "%OFF",
"value": 5,
"ON": {
"kind": "SKU",
"value": null
},
"id": "60c6e7776d6fd800094504e8",
"promoId": "60c6e5c339c1e00009c3b974"
},
{
"unit": "%OFF",
"value": 100,
"ON": {
"kind": "SKU",
"value": null
},
"id": "60c6e579ac3abe000807002c",
"promoId": "60c6e56439c1e00009c3b96e"
}
],
"_id": "60c7a089147af80008cd5b08",
"price": 100,
"weightUnit": "lb",
"isPickup": false,
"itemId": 170,
"quantity": 3,
"priceListId": 100000,
"sku": "testPrice",
"taxCode": "EWPE",
"title": "Pricing",
"weight": 23,
"lineItemId": 2,
"attributeTotalPrice": 0,
"attributes": [],
"currency": "USD",
"shipToId": 334,
"discount": 100,
"estimatedTax": 0,
"total": 300,
"reservedLocation": [
{
"_id": "60c7aa9c97041d0009a5801e",
"warehouseId": "60bfb7fa92eb920008dd0078",
"quantity": 3,
"id": "60c7aa9c97041d0009a5801e"
}
],
"id": "60c7a089147af80008cd5b08"
}
],
"shipments": [
{
"_id": "60c7a62003a1ce0009ea6824",
"shipmentRef": "POS Shipment Added",
"shipmentCarrier": "DHL",
"shipmentCarrierUrl": "https://dhl.com",
"trackingNumber": "2345367890876549",
"lineItems": [
{
"_id": "60c7a62003a1ce0009ea6825",
"lineItemId": 1,
"quantity": 1,
"id": "60c7a62003a1ce0009ea6825"
}
],
"shipmentStatus": "Shipping",
"estimatedDeliveryDate": "2021-07-01T00:00:00.000Z",
"shippedDate": "2021-06-11T00:00:00.000Z",
"shipToId": 334,
"id": "60c7a62003a1ce0009ea6824"
},
{
"_id": "60c7a6a003a1ce0009ea682d",
"shipmentRef": "POS Shipment Added",
"shipmentCarrier": "DHL",
"shipmentCarrierUrl": "https://dhl.com",
"trackingNumber": "2345367890876549",
"lineItems": [
{
"_id": "60c7a6a003a1ce0009ea682e",
"lineItemId": 1,
"quantity": 1,
"id": "60c7a6a003a1ce0009ea682e"
}
],
"shipmentStatus": "Shipping",
"estimatedDeliveryDate": "2021-07-01T00:00:00.000Z",
"shippedDate": "2021-06-11T00:00:00.000Z",
"shipToId": 334,
"id": "60c7a6a003a1ce0009ea682d"
},
{
"_id": "60c7a6d603a1ce0009ea6838",
"shipmentRef": "POS Shipment Added",
"shipmentCarrier": "DHL",
"shipmentCarrierUrl": "https://dhl.com",
"trackingNumber": "2345367890876549",
"lineItems": [
{
"_id": "60c7a6d603a1ce0009ea6839",
"lineItemId": 2,
"quantity": 2,
"id": "60c7a6d603a1ce0009ea6839"
}
],
"shipmentStatus": "Shipping",
"estimatedDeliveryDate": "2021-07-01T00:00:00.000Z",
"shippedDate": "2021-06-11T00:00:00.000Z",
"shipToId": 334,
"id": "60c7a6d603a1ce0009ea6838"
},
{
"_id": "60c7a8c648aa0d00086c9f38",
"shipmentRef": "POS Shipment Added",
"shipmentCarrier": "DHL",
"shipmentCarrierUrl": "https://dhl.com",
"trackingNumber": "2345367890876549",
"lineItems": [
{
"_id": "60c7a8c648aa0d00086c9f39",
"lineItemId": 2,
"quantity": 1,
"id": "60c7a8c648aa0d00086c9f39"
}
],
"shipmentStatus": "Shipping",
"estimatedDeliveryDate": "2021-07-01T00:00:00.000Z",
"shippedDate": "2021-06-11T00:00:00.000Z",
"shipToId": 334,
"id": "60c7a8c648aa0d00086c9f38"
}
],
"payments": [
{
"billToAddress": {
"name": {
"first": "Dave",
"last": "Sheffer"
},
"phone": {
"number": "4156529712",
"kind": "Mobile"
},
"email": "[email protected]",
"street1": "10400 NE 4th St",
"street2": "",
"city": "Bellevue",
"state": "WA",
"country": "United States",
"zipCode": "98004"
},
"shipToId": [
334
],
"_id": "60c7a091d17c5b000920cf02",
"paymentIdentifier": {
"cardIdentifier": "1111"
},
"paymentMethod": "Visa",
"paymentKind": "Fabric User",
"amount": 700,
"currency": "USD",
"conversion": 1,
"paymentToken": {
"token": "40067346490",
"type": "CARD"
},
"id": "60c7a091d17c5b000920cf02"
}
],
"revision": 4,
"totalQuantity": 5,
"statusDescriptions": [],
"events": [],
"pickups": [],
"createdAt": "2021-06-14T18:31:45.928Z",
"updatedAt": "2021-06-14T19:14:36.519Z",
"__v": 0
}
]
}

Error Code: 500

Message: Internal Server Error

Description: You will see this error when the account number is incorrect in the x-site-context (for a multi-tenent client).

Change Log

  • June - 2021

  • July - 2020 First updated