XM
Powered By GitBook
Create Subscriptions
Path:
1
POST /data-subscription/subscriptions
Copied!
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 Path

1
https://{baseurl}/data-subscription/subscriptions
Copied!

Sample Request

1
{
2
"planID": "6069ad22b68b21000ab1b046",
3
"itemID": "1000000058",
4
"quantity": 3,
5
"customerEmail": "[email protected]",
6
"status": "ACTIVE",
7
"paymentMethod": "pm_1ISekkETggmgrCy2b7osIpl8",
8
"customerReferenceId": "606efb7ec042330007b48447",
9
"orderReferenceId": "5082-5948-21691",
10
"shippingCost": 2,
11
"customerFullName": "test",
12
"discount": 2,
13
"tax": 2,
14
"shipTo": {
15
"shipToId":"testShip",
16
"name": {
17
"firstName": "test IQBAR",
18
"middleName": "",
19
"lastName": "test"
20
},
21
"streetAddress": {
22
"street1": "185-S QA Estate",
23
"street2": ""
24
},
25
"city": "Lahore",
26
"state": "Punjab",
27
"zipCode": "a1a1a1",
28
"country": "Pakistan"
29
},
30
"billTo": {
31
"billToId":"testBill",
32
"name": {
33
"firstName": "test bill",
34
"middleName": "",
35
"lastName": "test"
36
},
37
"streetAddress": {
38
"street1": "185-S QA Estate bill",
39
"street2": ""
40
},
41
"city": "Lahore",
42
"state": "Punjab",
43
"zipCode": "a1a1a1",
44
"country": "Pakistan"
45
}
46
}
Copied!

Sample Response

Response Code: 200
Message: OK
1
{
2
"success": true,
3
"responseStatus": "OK",
4
"message": "Request processed successfully.",
5
"data": {
6
"shipTo": {
7
"name": {
8
"firstName": "test IQBAR",
9
"middleName": "",
10
"lastName": "test"
11
},
12
"streetAddress": {
13
"street1": "185-S QA Estate",
14
"street2": ""
15
},
16
"shipToId": "testShip",
17
"city": "Lahore",
18
"state": "Punjab",
19
"zipCode": "a1a1a1",
20
"country": "Pakistan"
21
},
22
"billTo": {
23
"name": {
24
"firstName": "test bill",
25
"middleName": "",
26
"lastName": "test"
27
},
28
"streetAddress": {
29
"street1": "185-S QA Estate bill",
30
"street2": ""
31
},
32
"billToId": "testBill",
33
"city": "Lahore",
34
"state": "Punjab",
35
"zipCode": "a1a1a1",
36
"country": "Pakistan"
37
},
38
"paymentDetails": {
39
"processor": "stripe"
40
},
41
"_id": "6089337f982e030009d7925e",
42
"isDeleted": false,
43
"deletedAt": null,
44
"planID": "6069ad22b68b21000ab1b046",
45
"itemID": "1000000058",
46
"priceListID": "100024",
47
"quantity": 3,
48
"customerID": "606efdc83bf07b0009bb92e7",
49
"frequency": 4,
50
"frequencyType": "Weekly",
51
"merchantAccount": "5fc78dfc6135050007191290",
52
"status": "ACTIVE",
53
"lastOrderReferenceId": "5082-5948-21691",
54
"cancellationReason": "",
55
"discount": 10,
56
"tax": 2,
57
"shippingCost": 2,
58
"paymentMethod": "pm_1ISekkETggmgrCy2b7osIpl8",
59
"lastPaymentDate": "2021-04-28T10:05:51.669Z",
60
"nextPaymentDate": "2021-05-26T10:05:51.667Z",
61
"createdAt": "2021-04-28T10:05:51.683Z",
62
"updatedAt": "2021-04-28T10:05:51.683Z",
63
"__v": 0
64
}
65
}
Copied!
Response Code: 404
Message: Not in stock

Change Log

    April-2021 first updated
Last modified 3mo ago
Copy link
Contents
Change Log