XM
Powered By GitBook
Retrieve Plans by Item IDs
Path:
1
POST /data-subscription/plans/get-by-itemIds
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 : header
Name : JWT Authorization
Required: true
Type : query
Name : Item ID and Price List ID
Required: true

Sample Path

1
https://{baseURL}/data-subscription/plans/get-by-itemIds
Copied!

Sample Request

1
{
2
"itemIds":[1000019305,1000012023]
3
}
Copied!

Sample Response

Response Code: 200
Message: OK
1
{
2
"success": true,
3
"responseStatus": "OK",
4
"message": "Request processed successfully.",
5
"data": {
6
"1000012023": [
7
{
8
"isDeleted": false,
9
"deletedAt": null,
10
"_id": "60461602e614e445784f1ccd",
11
"title": "test plan",
12
"description": "test plan ",
13
"products": [
14
{
15
"_id": "60461602e614e445784f1cce",
16
"itemId": "1000012023",
17
"priceListId": "100257"
18
}
19
],
20
"frequency": 3,
21
"frequencyType": "Weekly",
22
"status": "ACTIVE",
23
"discount": 5,
24
"shippingCost": 2,
25
"merchantAccountId": "8739392294",
26
"merchantAccount": "5f328bf0b7c15700071233b9",
27
"createdAt": "2021-03-08T12:18:10.692Z",
28
"updatedAt": "2021-03-08T12:18:10.692Z",
29
"__v": 0
30
}
31
],
32
"1000019305": [
33
{
34
"isDeleted": false,
35
"deletedAt": null,
36
"_id": "6048948070587c7c08053dcc",
37
"title": "test plan",
38
"description": "test plan ",
39
"products": [
40
{
41
"_id": "6048948070587c7c08053dcd",
42
"itemId": "1000019305",
43
"priceListId": "100264"
44
}
45
],
46
"frequency": 3,
47
"frequencyType": "Weekly",
48
"status": "ACTIVE",
49
"discount": 5,
50
"shippingCost": 2,
51
"merchantAccountId": "8739392294",
52
"merchantAccount": "5f328bf0b7c15700071233b9",
53
"createdAt": "2021-03-10T09:42:24.394Z",
54
"updatedAt": "2021-03-10T09:42:24.394Z",
55
"__v": 0
56
},
57
{
58
"isDeleted": false,
59
"deletedAt": null,
60
"_id": "604f5e65eddac91f7ad5535c",
61
"title": "test plan",
62
"description": "test plan ",
63
"products": [
64
{
65
"_id": "604f5e65eddac91f7ad5535d",
66
"itemId": "1000019305",
67
"priceListId": "100266"
68
}
69
],
70
"frequency": 6,
71
"frequencyType": "weekly",
72
"status": "ACTIVE",
73
"discount": 5,
74
"shippingCost": 2,
75
"merchantAccountId": "8739392294",
76
"merchantAccount": "5f328bf0b7c15700071233b9",
77
"createdAt": "2021-03-15T13:17:25.261Z",
78
"updatedAt": "2021-03-15T13:17:25.261Z",
79
"__v": 0
80
},
81
{
82
"isDeleted": false,
83
"deletedAt": null,
84
"_id": "605082f7afc4e21f7a126692",
85
"title": "test plan",
86
"description": "test plan ",
87
"products": [
88
{
89
"_id": "605082f7afc4e21f7a126693",
90
"itemId": "1000019305",
91
"priceListId": "100267"
92
},
93
{
94
"_id": "605082f7afc4e21f7a126694",
95
"itemId": "1000012000",
96
"priceListId": "100267"
97
}
98
],
99
"frequency": 1,
100
"frequencyType": "weekly",
101
"status": "ACTIVE",
102
"discount": 5,
103
"shippingCost": 2,
104
"merchantAccountId": "8739392294",
105
"merchantAccount": "5f328bf0b7c15700071233b9",
106
"createdAt": "2021-03-16T10:05:43.266Z",
107
"updatedAt": "2021-03-16T10:05:43.266Z",
108
"__v": 0
109
},
110
{
111
"isDeleted": false,
112
"deletedAt": null,
113
"_id": "60584b5fd54c3d6ddd934c8e",
114
"title": "test plan",
115
"description": "test plan ",
116
"products": [
117
{
118
"_id": "60584b5fd54c3d6ddd934c8f",
119
"itemId": "1000019305",
120
"priceListId": "100272"
121
},
122
{
123
"_id": "60584b5fd54c3d6ddd934c90",
124
"itemId": "1000012000",
125
"priceListId": "100272"
126
}
127
],
128
"frequency": 11,
129
"frequencyType": "weekly",
130
"status": "ACTIVE",
131
"discount": 5,
132
"shippingCost": 2,
133
"merchantAccountId": "8739392294",
134
"merchantAccount": "5f328bf0b7c15700071233b9",
135
"createdAt": "2021-03-22T07:46:39.675Z",
136
"updatedAt": "2021-03-22T07:46:39.675Z",
137
"__v": 0
138
}
139
]
140
}
141
}
Copied!
Response Code: 400
Message: Client Error
Response Code: 500
Message: Server Error

Changelog

    April-2021
Last modified 3mo ago
Copy link
Contents
Changelog