XM

Retrieve Orders By Email

Path:

GET https://{baseurl}/api-order/orders/user/guest?orderEmail={email}

This API facilitates retrieval of order details based on email address.

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 : query

Name : The email address of the customer.

Required: true

Sample Request

https://{baseurl}/api-order/orders/user/[email protected]

Sample Response

Response Code: 200

Message: OK

Description: You'll see this message when the order details are successfully retrieved. When the email address is invalid, a blank array is returned in the success response.

[
{
"_id": "60ca3b299430450009679f90",
"tags": [],
"cartId": "60ca3ab52d5e41000881389e",
"attributes": [],
"customerEmail": "[email protected]",
"orderCurrency": "USD",
"orderTotal": 102.49,
"taxTotal": 0.5,
"channel": 12,
"status": "ORDER_SHIPPED",
"statusLog": "Order has been shipped",
"orderReference": "5778-5180-41779",
"orderId": "4284-4200-49489",
"shipTo": [
{
"address": {
"name": {
"first": "Friend",
"last": "Address"
},
"phone": {
"number": "123-992-1234",
"kind": "Mobile"
},
"street1": "888 Broadway",
"city": "New York",
"state": "NY",
"country": "United States",
"zipCode": "10003",
"kind": "shipping",
"email": "[email protected]"
},
"promosApplied": [],
"_id": "60ca3ac24ef53d0009395682",
"shipToType": "SHIP_TO_ADDRESS",
"taxCode": "FR1000",
"shipToId": 386,
"price": 11.99,
"shipmentMethodId": "10002",
"estimatedTax": 0.5,
"shipmentCarrier": "2 Day",
"total": 12.49,
"id": "60ca3ac24ef53d0009395682"
}
],
"items": [
{
"group": [
"123123123123123213212222"
],
"promosApplied": [],
"_id": "60ca3ab52d5e41000881389f",
"price": 90,
"weightUnit": "lb",
"isPickup": false,
"itemId": 89,
"quantity": 1,
"priceListId": 100000,
"sku": "GardenWoodSofa",
"taxCode": "tytuy",
"title": "Garden Wood Sofa",
"weight": 2345,
"lineItemId": 1,
"attributeTotalPrice": 0,
"attributes": [],
"currency": "USD",
"shipToId": 386,
"discount": 0,
"estimatedTax": 0,
"total": 90,
"reservedLocation": [
{
"_id": "60ca3b2e673a8100083c7835",
"warehouseId": "60bf9615e66d120008b37e5e",
"quantity": 1,
"id": "60ca3b2e673a8100083c7835"
}
],
"id": "60ca3ab52d5e41000881389f"
}
],
"shipments": [
{
"_id": "60ca3bdda6f3020008224e45",
"shipmentRef": "ref-100",
"shipmentCarrier": "Fedex",
"shipmentCarrierUrl": "https://fedex.com",
"trackingNumber": "2345367890876549",
"lineItems": [
{
"_id": "60ca3bdda6f3020008224e46",
"lineItemId": 1,
"quantity": 1,
"id": "60ca3bdda6f3020008224e46"
}
],
"shipmentStatus": "awaiting",
"estimatedDeliveryDate": "2019-03-01T00:00:00.000Z",
"shippedDate": "2020-04-05T00:00:00.000Z",
"shipToId": 386,
"id": "60ca3bdda6f3020008224e45"
}
],
"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": [
386
],
"_id": "60ca3b299430450009679f93",
"paymentStatus": "succeeded",
"amount": 102.49,
"currency": "USD",
"paymentIdentifier": {
"cardIdentifier": "4242"
},
"paymentMethod": "visa",
"paymentKind": "CARD_STRIPE",
"conversion": 1,
"paymentToken": {
"token": "pi_1J32xZJxr7zyIFb9Yc82PMcm",
"type": "CARD_STRIPE"
},
"id": "60ca3b299430450009679f93"
}
],
"revision": 1,
"totalQuantity": 1,
"statusDescriptions": [],
"events": [],
"pickups": [],
"createdAt": "2021-06-16T17:55:53.231Z",
"updatedAt": "2021-06-16T17:58:53.711Z",
"__v": 0
}
]

Error Code: 400

Message: Bad Request

Description: You will see this error when the format of the email addres is incorrect.

{
"code": "REQUEST_VALIDATION",
"message": "Invalid data in query: /orderEmail should match format \"email\""
}

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