XM

Retrieve All Subscriptions

Path:

GET /data-subscription/subscriptions

This API facilitates easy creation of a new subscription based on the subscription details such as planId, itemId, quantity, etc. in the request body.

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

Name : Subscription details

Required: true

Sample Request

{
"quantity": 2
}

Sample Response

Response Code: 200

Message: OK

{
"success": true,
"responseStatus": "OK",
"message": "Request processed successfully.",
"data": {
"shipTo": {
"name": {
"firstName": "test IQBAR",
"middleName": "",
"lastName": "test"
},
"streetAddress": {
"street1": "185-S QA Estate",
"street2": ""
},
"phone": {
"number": ""
},
"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": ""
},
"phone": {
"number": ""
},
"billToId": "testBill",
"city": "Lahore",
"state": "Punjab",
"zipCode": "a1a1a1",
"country": "Pakistan"
},
"isDeleted": true,
"deletedAt": "2021-03-22T09:30:47.567Z",
"_id": "6058511b4dd50e6ddd6d744c",
"planID": "604f5e65eddac91f7ad5535c",
"itemID": "1000019305",
"priceListID": "100266",
"quantity": 2,
"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-22T09:35:12.964Z",
"__v": 0
}
}

Response Code: 400

Message: Client Error

Response Code: 500

Message: Server Error

Changelog

  • April-2021 last updated

  • July-2020 First updated

‚Äč