XM

Retrieve All Orders by Customer Reference ID

Path:

GET /data-subscription/orders/get-by-customer/{customer-reference-ID}

This API helps retrieve details of a subscribed order based on the specified order ID.

Headers

Content-Type : application/json

Authorization: JWT Token

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

Parameters

Type : path

Name : The system-generated customer reference ID.

Required: true

Sample Path

https://{baseurl}/data-subscription/orders/get-by-customer/606efb7ec042330007b48447

Sample Response

Response Code: 200

Message: OK

{
"success": true,
"responseStatus": "OK",
"message": "Request processed successfully.",
"data": {
"orders": [
{
"shipTo": {
"name": {
"firstName": "Khizer",
"middleName": "",
"lastName": "Younas"
},
"streetAddress": {
"street1": "177 HUNTINGTON AVE STE 1703",
"street2": ""
},
"shipToId": "606f79b7a084a10008fc411f",
"city": "BOSTON",
"state": "MA",
"zipCode": "02115-3153",
"country": "US"
},
"billTo": {
"name": {
"firstName": "Khizer",
"middleName": "",
"lastName": "Younas"
},
"streetAddress": {
"street1": "177 HUNTINGTON AVE STE 1703",
"street2": ""
},
"city": "BOSTON",
"state": "MA",
"zipCode": "02115-3153",
"country": "US",
"billToId": "606f79d440b47300084ad850"
},
"paymentDetails": {
"processor": "stripe"
},
"isDeleted": false,
"deletedAt": null,
"_id": "606f79d8f94b4a00090fcad8",
"subscriptionID": "606f79d8f94b4a00090fcad7",
"planID": "606ef36a93bc6e00084fd5ca",
"itemID": "1000000058",
"itemName": "FRUIT LOVERS VARIETY",
"quantity": 1,
"frequency": 2,
"frequencyType": "Monthly",
"flagPreviousOrder": false,
"orderReferenceId": "2865-4716-86171",
"customerReferenceId": "606efb7ec042330007b48447",
"discount": 0,
"tax": 0,
"totalAmount": 2499,
"shippingCost": 0,
"paymentStatus": "PAID",
"paymentMethod": "pi_1Ie5gUFbKq2PvwXbhEJlJQrv",
"paymentDate": "2021-04-08T21:47:04.778Z",
"createdAt": "2021-04-08T21:47:04.784Z",
"updatedAt": "2021-04-08T21:47:04.784Z",
"__v": 0
},
{
"shipTo": {
"name": {
"firstName": "Khizer",
"middleName": "",
"lastName": "Younas"
},
"streetAddress": {
"street1": "177 HUNTINGTON AVE STE 1703",
"street2": ""
},
"shipToId": "606f822b2d77400008841d1e",
"city": "BOSTON",
"state": "MA",
"zipCode": "02115-3153",
"country": "US"
},
"billTo": {
"name": {
"firstName": "Khizer",
"middleName": "",
"lastName": "Younas"
},
"streetAddress": {
"street1": "177 HUNTINGTON AVE STE 1703",
"street2": ""
},
"city": "BOSTON",
"state": "MA",
"zipCode": "02115-3153",
"country": "US",
"billToId": "606f8240d10b8600089fa55b"
},
"paymentDetails": {
"processor": "stripe"
},
"isDeleted": false,
"deletedAt": null,
"_id": "606f8243feef6c0008971e65",
"subscriptionID": "606f8243feef6c0008971e64",
"planID": "606ef36a93bc6e00084fd5ca",
"itemID": "1000000058",
"itemName": "FRUIT LOVERS VARIETY",
"quantity": 1,
"frequency": 2,
"frequencyType": "Monthly",
"flagPreviousOrder": false,
"orderReferenceId": "8520-6752-84361",
"customerReferenceId": "606efb7ec042330007b48447",
"discount": 30,
"tax": 0,
"totalAmount": 1749.3,
"shippingCost": 0,
"paymentStatus": "PAID",
"paymentMethod": "pi_1Ie6FMFbKq2PvwXb82yBlcn9",
"paymentDate": "2021-04-08T22:22:59.579Z",
"createdAt": "2021-04-08T22:22:59.584Z",
"updatedAt": "2021-04-08T22:22:59.584Z",
"__v": 0
},
{
"shipTo": {
"name": {
"firstName": "Khizer",
"middleName": "",
"lastName": "Younas"
},
"streetAddress": {
"street1": "177 HUNTINGTON AVE STE 1703",
"street2": ""
},
"shipToId": "606f8414484b1500094c53bd",
"city": "boston",
"state": "MA",
"zipCode": "02115-3153",
"country": "US"
},
"billTo": {
"name": {
"firstName": "Khizer",
"middleName": "",
"lastName": "Younas"
},
"streetAddress": {
"street1": "177 HUNTINGTON AVE STE 1703",
"street2": ""
},
"city": "boston",
"state": "MA",
"zipCode": "02115-3153",
"country": "US",
"billToId": "606f8431591d4d0008f3d24a"
},
"paymentDetails": {
"processor": "stripe"
},
"isDeleted": false,
"deletedAt": null,
"_id": "606f843692d2360008857980",
"subscriptionID": "606f843592d236000885797f",
"planID": "606ef369c239960008ab3d77",
"itemID": "1000000058",
"itemName": "FRUIT LOVERS VARIETY",
"quantity": 1,
"frequency": 2,
"frequencyType": "Weekly",
"flagPreviousOrder": false,
"orderReferenceId": "1953-2671-40456",
"customerReferenceId": "606efb7ec042330007b48447",
"discount": 24,
"tax": 0,
"totalAmount": 1899.2399999999996,
"shippingCost": 0,
"paymentStatus": "PAID",
"paymentMethod": "pi_1Ie6NHFbKq2PvwXbn2hx2KEr",
"paymentDate": "2021-04-08T22:31:18.677Z",
"createdAt": "2021-04-08T22:31:18.682Z",
"updatedAt": "2021-04-08T22:31:18.682Z",
"__v": 0
},
{
"shipTo": {
"name": {
"firstName": "test IQBAR",
"middleName": "",
"lastName": "test"
},
"streetAddress": {
"street1": "185-S QA Estate",
"street2": ""
},
"shipToId": "testShip",
"city": "Lahore",
"state": "Punjab",
"zipCode": "a1a1a1",
"country": "Pakistan"
},
"billTo": {
"name": {
"firstName": "test bill",
"middleName": "",
"lastName": "test"
},
"streetAddress": {
"street1": "185-S QA Estate bill",
"street2": ""
},
"billToId": "testBill",
"city": "Lahore",
"state": "Punjab",
"zipCode": "a1a1a1",
"country": "Pakistan"
},
"paymentDetails": {
"processor": "stripe"
},
"isDeleted": false,
"deletedAt": null,
"_id": "60893381982e030009d7925f",
"subscriptionID": "6089337f982e030009d7925e",
"planID": "6069ad22b68b21000ab1b046",
"itemID": "1000000058",
"itemName": "FRUIT LOVERS VARIETY",
"quantity": 3,
"frequency": 4,
"frequencyType": "Weekly",
"orderReferenceId": "5082-5948-21691",
"customerReferenceId": "606efb7ec042330007b48447",
"discount": 10,
"tax": 2,
"totalAmount": 6747.3,
"shippingCost": 2,
"paymentStatus": "PAID",
"paymentMethod": "pm_1ISekkETggmgrCy2b7osIpl8",
"paymentDate": "2021-04-28T10:05:53.626Z",
"createdAt": "2021-04-28T10:05:53.631Z",
"updatedAt": "2021-04-28T10:05:53.631Z",
"__v": 0
}
]
}
}

Response Code: 400

Message: Client Error

Response Code: 500

Message: Server Error

Changelog

  • April-2021