XM

Retrieve Orders by Subscription ID

Path:

GET /data-subscription/orders/get-by-subscriptionId/{subscriptionID}

This API retrieves details of the subscribed orders based on the specified subscription 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 subscription ID.

Required: true

Sample Path

https://{baseURL}/data-subscription/orders/get-by-subscriptionId/6058511b4dd50e6ddd6d744c

Sample Response

Response Code: 200

Message: OK

{
"success": true,
"responseStatus": "OK",
"message": "Request processed successfully.",
"data": {
"subscription": {
"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"
},
"isDeleted": false,
"deletedAt": null,
"_id": "6058511b4dd50e6ddd6d744c",
"planID": "604f5e65eddac91f7ad5535c",
"itemID": "1000019305",
"priceListID": "100266",
"quantity": 3,
"customerID": "6045e4453db3e710480a4d2b",
"frequency": 6,
"frequencyType": "weekly",
"merchantAccountId": "8739392294",
"merchantAccount": "5f328bf0b7c15700071233b9",
"status": "ACTIVE",
"lastOrderReferenceId": "5082-5948-16923",
"cancellationReason": "",
"discount": 2,
"tax": 2,
"shippingCost": 2,
"paymentMethod": "pm_1ISekkETggmgrCy2b7osIpl8",
"lastPaymentDate": "2021-03-22T08:11:07.219Z",
"nextPaymentDate": "2021-05-03T08:11:07.218Z",
"createdAt": "2021-03-22T08:11:07.234Z",
"updatedAt": "2021-03-22T08:11:07.234Z",
"__v": 0
},
"orderAttempts": [
{
"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"
},
"isDeleted": false,
"deletedAt": null,
"_id": "605851204dd50e6ddd6d744d",
"subscriptionID": "6058511b4dd50e6ddd6d744c",
"planID": "604f5e65eddac91f7ad5535c",
"itemID": "1000019305",
"itemName": "test0939",
"quantity": 3,
"frequency": 6,
"frequencyType": "weekly",
"flagPreviousOrder": false,
"orderReferenceId": "5082-5948-16923",
"customerReferenceId": "customerReferenceId",
"discount": 2,
"tax": 2,
"totalAmount": 882000,
"shippingCost": 2,
"paymentStatus": "PAID",
"paymentMethod": "pm_1ISekkETggmgrCy2b7osIpl8",
"paymentDate": "2021-03-22T08:11:12.321Z",
"createdAt": "2021-03-22T08:11:12.367Z",
"updatedAt": "2021-03-22T08:11:12.367Z",
"__v": 0
}
]
}
}

Response Code: 400

Message: Client Error

Response Code: 500

Message: Server Error

Changelog

  • April-2021