XM

Retrieve Orders By User

Path:

GET /api-order/orders/user?offset=0&limit=10

This API supports a paginated response to retrieve all the orders of a user, including individual item details such as quantity, pricing (along with tax), promos, itemID, SKUs, etc.

Headers

Authorization: JWT userAuthToken

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

Consumes

  • application/json

Produces

  • application/json

Parameters

Path:

Name: Offset, Limit

Required: true

Sample Request

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

Response

Response Code: 200

Message: OK

Sample

{
"query": {
"limit": 10,
"offset": 0,
"count": 1,
"orderTotalSum": 273.78,
"orderAverage": 273.78,
"totalQuantitySum": 13
},
"orders": [
{
"_id": "5ef355555af89900081327f1",
"tags": [],
"cartId": "5ef352e269c9800007e4b1d1",
"customerUserId": "5ef35258dd4c6f0007066108",
"customerEmail": "[email protected]",
"customerPhone": {
"number": "33344455555",
"kind": "Mobile"
},
"orderCurrency": "USD",
"orderTotal": 273.78,
"taxTotal": 20.28,
"channel": 12,
"status": "ORDER_PAYMENT_AUTHORIZED",
"statusLog": "Order has been placed",
"orderId": "3587-8887-25674",
"shipTo": [
{
"address": {
"name": {
"first": "Ryan",
"last": "Demo"
},
"phone": {
"number": "3334445555",
"kind": "mobile"
},
"email": "[email protected]",
"street1": "1000 main street",
"street2": "",
"city": "Seattle",
"state": "WA",
"country": "US",
"zipCode": "98101",
"kind": "shipping"
},
"promosApplied": [],
"_id": "5ef3553c4fdf8b00083d934c",
"shipToType": "SHIP_TO_ADDRESS",
"taxCode": "FR020000",
"shipToId": 607,
"price": 0,
"currency": "USD",
"shipmentMethodId": "9c948d30e73740199657328984b6afa9",
"estimatedTax": 0,
"shipmentCarrier": "FedEx",
"shipmentMethod": "Ground®",
"total": 0,
"id": "5ef3553c4fdf8b00083d934c"
}
],
"items": [
{
"group": [
"5e2cf7dc45570b000863c496"
],
"promosApplied": [],
"_id": "5ef352e269c9800007e4b1d2",
"price": 24,
"weightUnit": "lb",
"itemId": 1000003611,
"quantity": 1,
"sku": "1379729",
"taxCode": "PH050500",
"title": "Pratima Pitta Balancing Body Oil",
"weight": 1,
"lineItemId": 1,
"currency": "USD",
"shipToId": 607,
"discount": 0,
"estimatedTax": 1.92,
"total": 25.92,
"id": "5ef352e269c9800007e4b1d2"
},
{
"group": [
"5e2cf7b345570b000863c493"
],
"promosApplied": [],
"_id": "5ef352f269c9800007e4b1d3",
"price": 18,
"weightUnit": "lb",
"itemId": 1000003548,
"quantity": 1,
"sku": "1379700",
"taxCode": "PH050500",
"title": "Pratima Vata Herbal Cleanser",
"weight": 1,
"lineItemId": 2,
"currency": "USD",
"shipToId": 607,
"discount": 0,
"estimatedTax": 1.44,
"total": 19.44,
"id": "5ef352f269c9800007e4b1d3"
},
{
"group": [
"5e2cf7b345570b000863c493"
],
"promosApplied": [],
"_id": "5ef3532469c9800007e4b1d4",
"price": 67.5,
"weightUnit": "lb",
"itemId": 1000003648,
"quantity": 1,
"sku": "1301741",
"taxCode": "PH050500",
"title": "Tracie Martyn Enzyme Exfoliant",
"weight": 0.5,
"lineItemId": 3,
"currency": "USD",
"shipToId": 607,
"discount": 0,
"estimatedTax": 5.4,
"total": 72.9,
"id": "5ef3532469c9800007e4b1d4"
},
{
"group": [
"5e2cfb9b45570b000863c4b5"
],
"promosApplied": [],
"_id": "5ef353b769c9800007e4b1db",
"price": 9,
"weightUnit": "lb",
"itemId": 1000005244,
"quantity": 8,
"sku": "1497827",
"taxCode": "PE090100",
"title": "Nalina Napkin Plum",
"weight": 0.25,
"lineItemId": 4,
"currency": "USD",
"shipToId": 607,
"discount": 0,
"estimatedTax": 0.72,
"total": 77.76,
"id": "5ef353b769c9800007e4b1db"
},
{
"group": [
"5e2f45ae0aefb70008e96c40"
],
"promosApplied": [],
"_id": "5ef3549a69c9800007e4b1e9",
"price": 36,
"weightUnit": "lb",
"itemId": 1000000399,
"quantity": 1,
"sku": "1482503",
"taxCode": "PH060771",
"title": "Dusty Rose Raw Silk Pillow",
"weight": 3,
"lineItemId": 5,
"currency": "USD",
"shipToId": 607,
"discount": 0,
"estimatedTax": 2.88,
"total": 38.88,
"id": "5ef3549a69c9800007e4b1e9"
},
{
"group": [
"5e2f45ae0aefb70008e96c40"
],
"promosApplied": [],
"_id": "5ef354b869c9800007e4b1ee",
"price": 36,
"weightUnit": "lb",
"itemId": 1000000244,
"quantity": 1,
"sku": "1482513",
"taxCode": "PH060771",
"title": "Raw Silk Pillow Eggplant",
"weight": 2,
"lineItemId": 6,
"currency": "USD",
"shipToId": 607,
"discount": 0,
"estimatedTax": 2.88,
"total": 38.88,
"id": "5ef354b869c9800007e4b1ee"
}
],
"shipments": [],
"payments": [
{
"billToAddress": {
"name": {
"first": "Ryan",
"last": "Demo"
},
"phone": {
"number": "3334445555",
"kind": "Mobile"
},
"email": "[email protected]",
"street1": "1000 main street",
"street2": "",
"city": "Seattle",
"state": "WA",
"country": "US",
"zipCode": "98101"
},
"shipToId": [
607
],
"_id": "5ef355555af89900081327f9",
"paymentIdentifier": {
"cardIdentifier": "4321"
},
"paymentMethod": "American Express",
"paymentKind": "Fabric User",
"amount": 273.78,
"currency": "USD",
"conversion": 1,
"paymentToken": {
"token": "42077258359"
},
"id": "5ef355555af89900081327f9"
}
],
"revision": 1,
"totalQuantity": 13,
"events": [],
"createdAt": "2020-10-24T13:29:57.736Z",
"updatedAt": "2020-10-24T13:30:00.174Z",
"__v": 0
}
]
}

Changelog

  • Last Updated - April 2021

  • First Updated - July 2020