XM

Retrieve Order By Order ID

Path:

GET https://{baseurl}/api-order/orders/orderNumber/{orderId}

This API faciliates retrieval of order details based on the order ID. This is secured by x-api-key. When the order ID is not available, the Get Order by Email API is recommended.

Headers

Content-Type : application/json

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

x-api-key : d41d8cd98f00b204e9800998ecf8427e

Parameters

Type : path

Name : The 15 character order ID (generated after successful cartcheckout).

Required: true

Sample Request

https://{baseurl}/api-order/orders/orderNumber/8677-7648-19307

Sample Response

Response Code: 200

Message: OK

Description: You'll see this message when the order details are successfully retrieved. The response includes order details and a history of all the changes to the order.

{
"order": {
"_id": "60ca5d3dc0fac00008e64c91",
"tags": [],
"cartId": "60ca5b6ae3b5d900081ae44a",
"customerUserId": "60c128045a38bf0009ad6502",
"attributes": [],
"customerEmail": "[email protected]",
"orderCurrency": "USD",
"orderTotal": 90.5,
"taxTotal": 0.5,
"channel": 12,
"status": "ORDER_FULFILLED",
"statusLog": "Order has been fulfilled",
"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": 1,
"totalQuantity": 1,
"statusDescriptions": [],
"events": [],
"pickups": [
{
"pickupPerson": {
"name": {
"first": "John",
"last": "Smith"
},
"phone": {
"number": "8087769338",
"kind": "Mobile"
},
"email": "[email protected]"
},
"_id": "60ca5e93344d5f00087725d9",
"lineItems": [
{
"_id": "60ca5e93344d5f00087725da",
"lineItemId": 1,
"quantity": 1,
"id": "60ca5e93344d5f00087725da"
}
],
"pickupStatus": "picked",
"shipToId": 390,
"id": "60ca5e93344d5f00087725d9"
}
],
"createdAt": "2021-06-16T20:21:17.038Z",
"updatedAt": "2021-06-16T20:26:59.689Z",
"__v": 0
},
"history": [
{
"_id": "60ca5e93344d5f00087725db",
"tags": [],
"cartId": "60ca5b6ae3b5d900081ae44a",
"customerUserId": "60c128045a38bf0009ad6502",
"customerEmail": "[email protected]",
"orderCurrency": "USD",
"orderTotal": 90.5,
"taxTotal": 0.5,
"channel": 12,
"status": "ORDER_FULFILLED",
"statusLog": "Order has been fulfilled",
"orderId": "8677-7648-19307",
"shipTo": [
{
"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",
"itemId": 89,
"quantity": 1,
"sku": "GardenWoodSofa",
"taxCode": "tytuy",
"title": "Garden Wood Sofa",
"weight": 2345,
"lineItemId": 1,
"currency": "USD",
"shipToId": 390,
"discount": 0,
"estimatedTax": 0,
"total": 90,
"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": 1,
"totalQuantity": 1,
"statusDescriptions": [],
"events": [],
"__v": 0,
"createdAt": "2021-06-16T20:26:59.769Z",
"updatedAt": "2021-06-16T20:26:59.769Z"
},
{
"_id": "60ca5d3dc0fac00008e64c95",
"tags": [],
"cartId": "60ca5b6ae3b5d900081ae44a",
"customerUserId": "60c128045a38bf0009ad6502",
"customerEmail": "[email protected]",
"orderCurrency": "USD",
"orderTotal": 90.5,
"taxTotal": 0.5,
"channel": 12,
"status": "ORDER_CREATED",
"statusLog": "Order has been created",
"orderId": "8677-7648-19307",
"shipTo": [
{
"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",
"itemId": 89,
"quantity": 1,
"sku": "GardenWoodSofa",
"taxCode": "tytuy",
"title": "Garden Wood Sofa",
"weight": 2345,
"lineItemId": 1,
"currency": "USD",
"shipToId": 390,
"discount": 0,
"estimatedTax": 0,
"total": 90,
"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": [],
"createdAt": "2021-06-16T20:21:17.095Z",
"updatedAt": "2021-06-16T20:21:17.095Z",
"__v": 0
}
]
}

Error Code: 404

Message: Not Found

Description: You will see this error when the order number doesn't exist in the system.

{
"code": "ORDER_NOT_FOUND",
"message": "Order Id Not Found"
}

Error Code: 500

Message: Internal Server Error

Description: You will see this error when the order number is incorrect.

{}

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