@gofynd/fdk-client-javascript 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (310) hide show
  1. package/documentation/application/CART.md +5934 -4502
  2. package/documentation/application/CATALOG.md +6338 -7245
  3. package/documentation/application/COMMON.md +95 -222
  4. package/documentation/application/COMMUNICATION.md +106 -186
  5. package/documentation/application/CONFIGURATION.md +903 -1597
  6. package/documentation/application/CONTENT.md +557 -1279
  7. package/documentation/application/FILESTORAGE.md +84 -220
  8. package/documentation/application/LEAD.md +314 -660
  9. package/documentation/application/LOGISTIC.md +229 -305
  10. package/documentation/application/ORDER.md +642 -1137
  11. package/documentation/application/PAYMENT.md +2285 -3031
  12. package/documentation/application/POSCART.md +6079 -4642
  13. package/documentation/application/REWARDS.md +94 -248
  14. package/documentation/application/SHARE.md +152 -250
  15. package/documentation/application/THEME.md +952 -1235
  16. package/documentation/application/USER.md +1228 -1765
  17. package/documentation/platform/ANALYTICS.md +207 -349
  18. package/documentation/platform/AUDITTRAIL.md +121 -204
  19. package/documentation/platform/BILLING.md +865 -1376
  20. package/documentation/platform/CART.md +2814 -3662
  21. package/documentation/platform/CATALOG.md +14453 -17192
  22. package/documentation/platform/COMMON.md +95 -222
  23. package/documentation/platform/COMMUNICATION.md +1632 -2380
  24. package/documentation/platform/COMPANYPROFILE.md +572 -957
  25. package/documentation/platform/CONFIGURATION.md +3050 -4073
  26. package/documentation/platform/CONTENT.md +3438 -4172
  27. package/documentation/platform/DISCOUNT.md +140 -236
  28. package/documentation/platform/FILESTORAGE.md +187 -323
  29. package/documentation/platform/INVENTORY.md +268 -911
  30. package/documentation/platform/LEAD.md +2195 -2541
  31. package/documentation/platform/ORDER.md +3400 -5361
  32. package/documentation/platform/PARTNER.md +9 -36
  33. package/documentation/platform/PAYMENT.md +903 -1213
  34. package/documentation/platform/REWARDS.md +183 -347
  35. package/documentation/platform/SHARE.md +120 -213
  36. package/documentation/platform/THEME.md +12956 -13239
  37. package/documentation/platform/USER.md +975 -1120
  38. package/documentation/platform/WEBHOOK.md +78 -184
  39. package/documentation/public/CONFIGURATION.md +95 -222
  40. package/documentation/public/INVENTORY.md +100 -282
  41. package/documentation/public/WEBHOOK.md +27 -133
  42. package/package.json +1 -1
  43. package/sdk/application/Cart/CartApplicationClient.d.ts +243 -243
  44. package/sdk/application/Cart/CartApplicationClient.js +567 -567
  45. package/sdk/application/Cart/CartApplicationModel.d.ts +64 -63
  46. package/sdk/application/Cart/CartApplicationModel.js +489 -886
  47. package/sdk/application/Cart/CartApplicationValidator.d.ts +17 -17
  48. package/sdk/application/Cart/CartApplicationValidator.js +98 -98
  49. package/sdk/application/Catalog/CatalogApplicationClient.d.ts +358 -358
  50. package/sdk/application/Catalog/CatalogApplicationClient.js +1036 -1036
  51. package/sdk/application/Catalog/CatalogApplicationModel.d.ts +90 -90
  52. package/sdk/application/Catalog/CatalogApplicationModel.js +677 -1243
  53. package/sdk/application/Catalog/CatalogApplicationValidator.d.ts +19 -19
  54. package/sdk/application/Catalog/CatalogApplicationValidator.js +110 -110
  55. package/sdk/application/Common/CommonApplicationClient.d.ts +13 -13
  56. package/sdk/application/Common/CommonApplicationClient.js +38 -38
  57. package/sdk/application/Common/CommonApplicationModel.d.ts +12 -12
  58. package/sdk/application/Common/CommonApplicationModel.js +83 -160
  59. package/sdk/application/Common/CommonApplicationValidator.d.ts +1 -1
  60. package/sdk/application/Common/CommonApplicationValidator.js +6 -6
  61. package/sdk/application/Communication/CommunicationApplicationClient.d.ts +11 -11
  62. package/sdk/application/Communication/CommunicationApplicationClient.js +26 -26
  63. package/sdk/application/Communication/CommunicationApplicationModel.d.ts +6 -6
  64. package/sdk/application/Communication/CommunicationApplicationModel.js +38 -83
  65. package/sdk/application/Communication/CommunicationApplicationValidator.d.ts +1 -1
  66. package/sdk/application/Communication/CommunicationApplicationValidator.js +4 -4
  67. package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +116 -116
  68. package/sdk/application/Configuration/ConfigurationApplicationClient.js +330 -330
  69. package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +85 -85
  70. package/sdk/application/Configuration/ConfigurationApplicationModel.js +480 -851
  71. package/sdk/application/Configuration/ConfigurationApplicationValidator.d.ts +8 -8
  72. package/sdk/application/Configuration/ConfigurationApplicationValidator.js +33 -33
  73. package/sdk/application/Content/ContentApplicationClient.d.ts +67 -67
  74. package/sdk/application/Content/ContentApplicationClient.js +191 -191
  75. package/sdk/application/Content/ContentApplicationModel.d.ts +76 -76
  76. package/sdk/application/Content/ContentApplicationModel.js +467 -884
  77. package/sdk/application/Content/ContentApplicationValidator.d.ts +5 -5
  78. package/sdk/application/Content/ContentApplicationValidator.js +24 -24
  79. package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +25 -25
  80. package/sdk/application/FileStorage/FileStorageApplicationClient.js +59 -59
  81. package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +13 -13
  82. package/sdk/application/FileStorage/FileStorageApplicationModel.js +86 -169
  83. package/sdk/application/FileStorage/FileStorageApplicationValidator.d.ts +1 -1
  84. package/sdk/application/FileStorage/FileStorageApplicationValidator.js +7 -7
  85. package/sdk/application/Lead/LeadApplicationClient.d.ts +24 -24
  86. package/sdk/application/Lead/LeadApplicationClient.js +100 -100
  87. package/sdk/application/Lead/LeadApplicationModel.d.ts +35 -35
  88. package/sdk/application/Lead/LeadApplicationModel.js +267 -474
  89. package/sdk/application/Lead/LeadApplicationValidator.d.ts +2 -2
  90. package/sdk/application/Lead/LeadApplicationValidator.js +11 -11
  91. package/sdk/application/Logistic/LogisticApplicationClient.d.ts +30 -19
  92. package/sdk/application/Logistic/LogisticApplicationClient.js +110 -43
  93. package/sdk/application/Logistic/LogisticApplicationModel.d.ts +17 -14
  94. package/sdk/application/Logistic/LogisticApplicationModel.js +133 -201
  95. package/sdk/application/Logistic/LogisticApplicationValidator.d.ts +3 -2
  96. package/sdk/application/Logistic/LogisticApplicationValidator.js +14 -8
  97. package/sdk/application/Order/OrderApplicationClient.d.ts +85 -85
  98. package/sdk/application/Order/OrderApplicationClient.js +232 -232
  99. package/sdk/application/Order/OrderApplicationModel.d.ts +50 -50
  100. package/sdk/application/Order/OrderApplicationModel.js +352 -656
  101. package/sdk/application/Order/OrderApplicationValidator.d.ts +7 -7
  102. package/sdk/application/Order/OrderApplicationValidator.js +28 -28
  103. package/sdk/application/Payment/PaymentApplicationClient.d.ts +318 -318
  104. package/sdk/application/Payment/PaymentApplicationClient.js +739 -739
  105. package/sdk/application/Payment/PaymentApplicationModel.d.ts +72 -72
  106. package/sdk/application/Payment/PaymentApplicationModel.js +570 -1038
  107. package/sdk/application/Payment/PaymentApplicationValidator.d.ts +28 -28
  108. package/sdk/application/Payment/PaymentApplicationValidator.js +107 -107
  109. package/sdk/application/PosCart/PosCartApplicationClient.d.ts +254 -254
  110. package/sdk/application/PosCart/PosCartApplicationClient.js +617 -617
  111. package/sdk/application/PosCart/PosCartApplicationModel.d.ts +64 -63
  112. package/sdk/application/PosCart/PosCartApplicationModel.js +475 -871
  113. package/sdk/application/PosCart/PosCartApplicationValidator.d.ts +18 -18
  114. package/sdk/application/PosCart/PosCartApplicationValidator.js +103 -103
  115. package/sdk/application/Rewards/RewardsApplicationClient.d.ts +27 -27
  116. package/sdk/application/Rewards/RewardsApplicationClient.js +112 -112
  117. package/sdk/application/Rewards/RewardsApplicationModel.d.ts +14 -14
  118. package/sdk/application/Rewards/RewardsApplicationModel.js +96 -191
  119. package/sdk/application/Rewards/RewardsApplicationValidator.d.ts +3 -3
  120. package/sdk/application/Rewards/RewardsApplicationValidator.js +12 -12
  121. package/sdk/application/Share/ShareApplicationClient.d.ts +37 -37
  122. package/sdk/application/Share/ShareApplicationClient.js +84 -84
  123. package/sdk/application/Share/ShareApplicationModel.d.ts +8 -8
  124. package/sdk/application/Share/ShareApplicationModel.js +63 -123
  125. package/sdk/application/Share/ShareApplicationValidator.d.ts +4 -4
  126. package/sdk/application/Share/ShareApplicationValidator.js +12 -12
  127. package/sdk/application/Theme/ThemeApplicationClient.d.ts +8 -8
  128. package/sdk/application/Theme/ThemeApplicationClient.js +31 -31
  129. package/sdk/application/Theme/ThemeApplicationModel.d.ts +34 -34
  130. package/sdk/application/Theme/ThemeApplicationModel.js +190 -336
  131. package/sdk/application/Theme/ThemeApplicationValidator.d.ts +1 -1
  132. package/sdk/application/Theme/ThemeApplicationValidator.js +4 -4
  133. package/sdk/application/User/UserApplicationClient.d.ts +280 -280
  134. package/sdk/application/User/UserApplicationClient.js +581 -581
  135. package/sdk/application/User/UserApplicationModel.d.ts +79 -72
  136. package/sdk/application/User/UserApplicationModel.js +440 -689
  137. package/sdk/application/User/UserApplicationValidator.d.ts +24 -24
  138. package/sdk/application/User/UserApplicationValidator.js +89 -89
  139. package/sdk/common/AxiosHelper.js +1 -1
  140. package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.d.ts +51 -51
  141. package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.js +179 -179
  142. package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.d.ts +6 -6
  143. package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.js +20 -20
  144. package/sdk/platform/Analytics/AnalyticsPlatformModel.d.ts +11 -11
  145. package/sdk/platform/Analytics/AnalyticsPlatformModel.js +95 -178
  146. package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +10 -10
  147. package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +41 -41
  148. package/sdk/platform/AuditTrail/AuditTrailPlatformModel.d.ts +10 -10
  149. package/sdk/platform/AuditTrail/AuditTrailPlatformModel.js +50 -89
  150. package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.d.ts +1 -1
  151. package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.js +6 -6
  152. package/sdk/platform/Billing/BillingPlatformClient.d.ts +60 -60
  153. package/sdk/platform/Billing/BillingPlatformClient.js +181 -181
  154. package/sdk/platform/Billing/BillingPlatformModel.d.ts +40 -40
  155. package/sdk/platform/Billing/BillingPlatformModel.js +342 -668
  156. package/sdk/platform/Billing/BillingPlatformValidator.d.ts +8 -8
  157. package/sdk/platform/Billing/BillingPlatformValidator.js +25 -25
  158. package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +168 -168
  159. package/sdk/platform/Cart/CartPlatformApplicationClient.js +553 -553
  160. package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +11 -11
  161. package/sdk/platform/Cart/CartPlatformApplicationValidator.js +63 -63
  162. package/sdk/platform/Cart/CartPlatformModel.d.ts +84 -83
  163. package/sdk/platform/Cart/CartPlatformModel.js +671 -1205
  164. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +632 -632
  165. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +1525 -1525
  166. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +40 -40
  167. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +174 -174
  168. package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +682 -682
  169. package/sdk/platform/Catalog/CatalogPlatformClient.js +1557 -1557
  170. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +291 -291
  171. package/sdk/platform/Catalog/CatalogPlatformModel.js +2127 -3904
  172. package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +66 -66
  173. package/sdk/platform/Catalog/CatalogPlatformValidator.js +229 -229
  174. package/sdk/platform/Common/CommonPlatformClient.d.ts +12 -12
  175. package/sdk/platform/Common/CommonPlatformClient.js +41 -41
  176. package/sdk/platform/Common/CommonPlatformModel.d.ts +12 -12
  177. package/sdk/platform/Common/CommonPlatformModel.js +83 -160
  178. package/sdk/platform/Common/CommonPlatformValidator.d.ts +1 -1
  179. package/sdk/platform/Common/CommonPlatformValidator.js +6 -6
  180. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +326 -326
  181. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +943 -943
  182. package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +30 -30
  183. package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +87 -87
  184. package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +67 -67
  185. package/sdk/platform/Communication/CommunicationPlatformModel.js +522 -974
  186. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +55 -55
  187. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +212 -212
  188. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +27 -27
  189. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +279 -542
  190. package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.d.ts +7 -7
  191. package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.js +24 -24
  192. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +163 -153
  193. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +615 -552
  194. package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.d.ts +22 -21
  195. package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.js +69 -63
  196. package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +125 -125
  197. package/sdk/platform/Configuration/ConfigurationPlatformClient.js +342 -342
  198. package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +148 -146
  199. package/sdk/platform/Configuration/ConfigurationPlatformModel.js +854 -1508
  200. package/sdk/platform/Configuration/ConfigurationPlatformValidator.d.ts +9 -9
  201. package/sdk/platform/Configuration/ConfigurationPlatformValidator.js +38 -38
  202. package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +534 -534
  203. package/sdk/platform/Content/ContentPlatformApplicationClient.js +1324 -1324
  204. package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +50 -50
  205. package/sdk/platform/Content/ContentPlatformApplicationValidator.js +156 -156
  206. package/sdk/platform/Content/ContentPlatformModel.d.ts +78 -78
  207. package/sdk/platform/Content/ContentPlatformModel.js +484 -907
  208. package/sdk/platform/Discount/DiscountPlatformClient.d.ts +65 -65
  209. package/sdk/platform/Discount/DiscountPlatformClient.js +216 -216
  210. package/sdk/platform/Discount/DiscountPlatformModel.d.ts +7 -7
  211. package/sdk/platform/Discount/DiscountPlatformModel.js +60 -121
  212. package/sdk/platform/Discount/DiscountPlatformValidator.d.ts +6 -6
  213. package/sdk/platform/Discount/DiscountPlatformValidator.js +29 -29
  214. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +24 -24
  215. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +58 -58
  216. package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +1 -1
  217. package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +8 -8
  218. package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +52 -52
  219. package/sdk/platform/FileStorage/FileStoragePlatformClient.js +123 -123
  220. package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +13 -13
  221. package/sdk/platform/FileStorage/FileStoragePlatformModel.js +86 -169
  222. package/sdk/platform/FileStorage/FileStoragePlatformValidator.d.ts +3 -3
  223. package/sdk/platform/FileStorage/FileStoragePlatformValidator.js +11 -11
  224. package/sdk/platform/Inventory/InventoryPlatformClient.d.ts +63 -63
  225. package/sdk/platform/Inventory/InventoryPlatformClient.js +228 -228
  226. package/sdk/platform/Inventory/InventoryPlatformModel.d.ts +30 -30
  227. package/sdk/platform/Inventory/InventoryPlatformModel.js +497 -964
  228. package/sdk/platform/Inventory/InventoryPlatformValidator.d.ts +7 -7
  229. package/sdk/platform/Inventory/InventoryPlatformValidator.js +28 -28
  230. package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +73 -73
  231. package/sdk/platform/Lead/LeadPlatformApplicationClient.js +200 -200
  232. package/sdk/platform/Lead/LeadPlatformApplicationValidator.d.ts +7 -7
  233. package/sdk/platform/Lead/LeadPlatformApplicationValidator.js +28 -28
  234. package/sdk/platform/Lead/LeadPlatformClient.d.ts +80 -80
  235. package/sdk/platform/Lead/LeadPlatformClient.js +212 -212
  236. package/sdk/platform/Lead/LeadPlatformModel.d.ts +35 -35
  237. package/sdk/platform/Lead/LeadPlatformModel.js +267 -474
  238. package/sdk/platform/Lead/LeadPlatformValidator.d.ts +6 -6
  239. package/sdk/platform/Lead/LeadPlatformValidator.js +24 -24
  240. package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +10 -10
  241. package/sdk/platform/Order/OrderPlatformApplicationClient.js +65 -65
  242. package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +1 -1
  243. package/sdk/platform/Order/OrderPlatformApplicationValidator.js +6 -6
  244. package/sdk/platform/Order/OrderPlatformClient.d.ts +357 -357
  245. package/sdk/platform/Order/OrderPlatformClient.js +1035 -1035
  246. package/sdk/platform/Order/OrderPlatformModel.d.ts +198 -196
  247. package/sdk/platform/Order/OrderPlatformModel.js +1574 -2861
  248. package/sdk/platform/Order/OrderPlatformValidator.d.ts +32 -32
  249. package/sdk/platform/Order/OrderPlatformValidator.js +160 -160
  250. package/sdk/platform/Partner/PartnerPlatformModel.d.ts +1 -1
  251. package/sdk/platform/Partner/PartnerPlatformModel.js +10 -26
  252. package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +57 -57
  253. package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +167 -167
  254. package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +6 -6
  255. package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +23 -23
  256. package/sdk/platform/Payment/PaymentPlatformClient.d.ts +42 -42
  257. package/sdk/platform/Payment/PaymentPlatformClient.js +153 -153
  258. package/sdk/platform/Payment/PaymentPlatformModel.d.ts +27 -27
  259. package/sdk/platform/Payment/PaymentPlatformModel.js +222 -410
  260. package/sdk/platform/Payment/PaymentPlatformValidator.d.ts +4 -4
  261. package/sdk/platform/Payment/PaymentPlatformValidator.js +21 -21
  262. package/sdk/platform/PlatformApplicationClient.d.ts +1496 -10325
  263. package/sdk/platform/PlatformApplicationClient.js +1584 -13899
  264. package/sdk/platform/PlatformClient.d.ts +7965 -7885
  265. package/sdk/platform/PlatformClient.js +8672 -10105
  266. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +83 -83
  267. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +275 -275
  268. package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.d.ts +8 -8
  269. package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.js +34 -34
  270. package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +15 -15
  271. package/sdk/platform/Rewards/RewardsPlatformModel.js +92 -194
  272. package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +10 -10
  273. package/sdk/platform/Share/SharePlatformApplicationClient.js +59 -59
  274. package/sdk/platform/Share/SharePlatformApplicationValidator.d.ts +1 -1
  275. package/sdk/platform/Share/SharePlatformApplicationValidator.js +6 -6
  276. package/sdk/platform/Share/SharePlatformModel.d.ts +8 -8
  277. package/sdk/platform/Share/SharePlatformModel.js +60 -118
  278. package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +132 -132
  279. package/sdk/platform/Theme/ThemePlatformApplicationClient.js +310 -310
  280. package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +15 -15
  281. package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +44 -44
  282. package/sdk/platform/Theme/ThemePlatformModel.d.ts +34 -34
  283. package/sdk/platform/Theme/ThemePlatformModel.js +190 -336
  284. package/sdk/platform/User/UserPlatformApplicationClient.d.ts +136 -69
  285. package/sdk/platform/User/UserPlatformApplicationClient.js +505 -166
  286. package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +12 -7
  287. package/sdk/platform/User/UserPlatformApplicationValidator.js +61 -23
  288. package/sdk/platform/User/UserPlatformModel.d.ts +79 -72
  289. package/sdk/platform/User/UserPlatformModel.js +440 -689
  290. package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +31 -31
  291. package/sdk/platform/Webhook/WebhookPlatformClient.js +88 -88
  292. package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +7 -7
  293. package/sdk/platform/Webhook/WebhookPlatformModel.js +68 -136
  294. package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +3 -3
  295. package/sdk/platform/Webhook/WebhookPlatformValidator.js +14 -14
  296. package/sdk/public/Configuration/ConfigurationPublicClient.d.ts +13 -13
  297. package/sdk/public/Configuration/ConfigurationPublicClient.js +38 -38
  298. package/sdk/public/Configuration/ConfigurationPublicModel.d.ts +12 -12
  299. package/sdk/public/Configuration/ConfigurationPublicModel.js +85 -162
  300. package/sdk/public/Configuration/ConfigurationPublicValidator.d.ts +1 -1
  301. package/sdk/public/Configuration/ConfigurationPublicValidator.js +6 -6
  302. package/sdk/public/Inventory/InventoryPublicClient.d.ts +34 -34
  303. package/sdk/public/Inventory/InventoryPublicClient.js +113 -113
  304. package/sdk/public/Inventory/InventoryPublicModel.d.ts +10 -10
  305. package/sdk/public/Inventory/InventoryPublicModel.js +119 -245
  306. package/sdk/public/Inventory/InventoryPublicValidator.d.ts +3 -3
  307. package/sdk/public/Inventory/InventoryPublicValidator.js +15 -15
  308. package/sdk/public/Webhook/WebhookPublicModel.d.ts +7 -7
  309. package/sdk/public/Webhook/WebhookPublicModel.js +68 -136
  310. package/tests/application/catalog.spec.js +7 -0
@@ -10,37 +10,37 @@ class PosCart {
10
10
  constructor(_conf) {
11
11
  this._conf = _conf;
12
12
  this._relativeUrls = {
13
- getCart: "/service/application/pos/cart/v1.0/detail",
14
- getCartLastModified: "/service/application/pos/cart/v1.0/detail",
13
+ addAddress: "/service/application/pos/cart/v1.0/address",
15
14
  addItems: "/service/application/pos/cart/v1.0/detail",
16
- updateCart: "/service/application/pos/cart/v1.0/detail",
17
- getItemCount: "/service/application/pos/cart/v1.0/basic",
18
- getCoupons: "/service/application/pos/cart/v1.0/coupon",
19
15
  applyCoupon: "/service/application/pos/cart/v1.0/coupon",
20
- removeCoupon: "/service/application/pos/cart/v1.0/coupon",
21
- getBulkDiscountOffers: "/service/application/pos/cart/v1.0/bulk-price",
22
16
  applyRewardPoints: "/service/application/pos/cart/v1.0/redeem/points/",
23
- getAddresses: "/service/application/pos/cart/v1.0/address",
24
- addAddress: "/service/application/pos/cart/v1.0/address",
25
- getAddressById: "/service/application/pos/cart/v1.0/address/{id}",
26
- updateAddress: "/service/application/pos/cart/v1.0/address/{id}",
27
- removeAddress: "/service/application/pos/cart/v1.0/address/{id}",
28
- selectAddress: "/service/application/pos/cart/v1.0/select-address",
29
- selectPaymentMode: "/service/application/pos/cart/v1.0/payment",
30
- validateCouponForPayment:
31
- "/service/application/pos/cart/v1.0/payment/validate/",
32
- getShipments: "/service/application/pos/cart/v1.0/shipment",
33
- updateShipments: "/service/application/pos/cart/v1.0/shipment",
34
17
  checkoutCart: "/service/application/pos/cart/v1.0/checkout",
35
- updateCartMeta: "/service/application/pos/cart/v1.0/meta",
18
+ getAddressById: "/service/application/pos/cart/v1.0/address/{id}",
19
+ getAddresses: "/service/application/pos/cart/v1.0/address",
36
20
  getAvailableDeliveryModes:
37
21
  "/service/application/pos/cart/v1.0/available-delivery-mode",
38
- getStoreAddressByUid: "/service/application/pos/cart/v1.0/store-address",
22
+ getBulkDiscountOffers: "/service/application/pos/cart/v1.0/bulk-price",
23
+ getCart: "/service/application/pos/cart/v1.0/detail",
24
+ getCartLastModified: "/service/application/pos/cart/v1.0/detail",
39
25
  getCartShareLink: "/service/application/pos/cart/v1.0/share-cart",
40
26
  getCartSharedItems:
41
27
  "/service/application/pos/cart/v1.0/share-cart/{token}",
28
+ getCoupons: "/service/application/pos/cart/v1.0/coupon",
29
+ getItemCount: "/service/application/pos/cart/v1.0/basic",
30
+ getShipments: "/service/application/pos/cart/v1.0/shipment",
31
+ getStoreAddressByUid: "/service/application/pos/cart/v1.0/store-address",
32
+ removeAddress: "/service/application/pos/cart/v1.0/address/{id}",
33
+ removeCoupon: "/service/application/pos/cart/v1.0/coupon",
34
+ selectAddress: "/service/application/pos/cart/v1.0/select-address",
35
+ selectPaymentMode: "/service/application/pos/cart/v1.0/payment",
36
+ updateAddress: "/service/application/pos/cart/v1.0/address/{id}",
37
+ updateCart: "/service/application/pos/cart/v1.0/detail",
38
+ updateCartMeta: "/service/application/pos/cart/v1.0/meta",
42
39
  updateCartWithSharedItems:
43
40
  "/service/application/pos/cart/v1.0/share-cart/{token}/{action}",
41
+ updateShipments: "/service/application/pos/cart/v1.0/shipment",
42
+ validateCouponForPayment:
43
+ "/service/application/pos/cart/v1.0/payment/validate/",
44
44
  };
45
45
  this._urls = Object.entries(this._relativeUrls).reduce(
46
46
  (urls, [method, relativeUrl]) => {
@@ -60,19 +60,14 @@ class PosCart {
60
60
 
61
61
  /**
62
62
  * @param {Object} arg - Arg object.
63
- * @param {string} [arg.id] -
64
- * @param {boolean} [arg.i] -
65
- * @param {boolean} [arg.b] -
66
- * @param {number} [arg.assignCardId] -
67
- * @param {string} [arg.areaCode] -
68
- * @param {boolean} [arg.buyNow] -
69
- * @returns {Promise<CartDetailResponse>} - Success response
70
- * @summary: Fetch all items added to the cart
71
- * @description: Use this API to get details of all the items added to a cart.
63
+ * @param {Address} arg.body
64
+ * @returns {Promise<SaveAddressResponse>} - Success response
65
+ * @summary: Add address to an account
66
+ * @description: Use this API to add an address to an account.
72
67
  */
73
- async getCart({ id, i, b, assignCardId, areaCode, buyNow } = {}) {
74
- const { error } = PosCartValidator.getCart().validate(
75
- { id, i, b, assignCardId, areaCode, buyNow },
68
+ async addAddress({ body } = {}) {
69
+ const { error } = PosCartValidator.addAddress().validate(
70
+ { body },
76
71
  { abortEarly: false, allowUnknown: true }
77
72
  );
78
73
  if (error) {
@@ -80,43 +75,37 @@ class PosCart {
80
75
  }
81
76
 
82
77
  // Showing warrnings if extra unknown parameters are found
83
- const { error: warrning } = PosCartValidator.getCart().validate(
84
- { id, i, b, assignCardId, areaCode, buyNow },
78
+ const { error: warrning } = PosCartValidator.addAddress().validate(
79
+ { body },
85
80
  { abortEarly: false, allowUnknown: false }
86
81
  );
87
82
  if (warrning) {
88
83
  Logger({
89
84
  level: "WARN",
90
- message: "Parameter Validation warrnings for getCart",
85
+ message: "Parameter Validation warrnings for addAddress",
91
86
  });
92
87
  Logger({ level: "WARN", message: warrning });
93
88
  }
94
89
 
95
90
  const query_params = {};
96
- query_params["id"] = id;
97
- query_params["i"] = i;
98
- query_params["b"] = b;
99
- query_params["assign_card_id"] = assignCardId;
100
- query_params["area_code"] = areaCode;
101
- query_params["buy_now"] = buyNow;
102
91
 
103
92
  const xHeaders = {};
104
93
 
105
94
  const response = await APIClient.execute(
106
95
  this._conf,
107
- "get",
96
+ "post",
108
97
  constructUrl({
109
- url: this._urls["getCart"],
98
+ url: this._urls["addAddress"],
110
99
  params: {},
111
100
  }),
112
101
  query_params,
113
- undefined,
102
+ body,
114
103
  xHeaders
115
104
  );
116
105
 
117
106
  const {
118
107
  error: res_error,
119
- } = PosCartModel.CartDetailResponse().validate(response, {
108
+ } = PosCartModel.SaveAddressResponse().validate(response, {
120
109
  abortEarly: false,
121
110
  allowUnknown: false,
122
111
  });
@@ -124,68 +113,7 @@ class PosCart {
124
113
  if (res_error) {
125
114
  Logger({
126
115
  level: "WARN",
127
- message: "Response Validation Warnnings for getCart",
128
- });
129
- Logger({ level: "WARN", message: res_error });
130
- }
131
-
132
- return response;
133
- }
134
-
135
- /**
136
- * @param {Object} arg - Arg object.
137
- * @param {string} [arg.id] -
138
- * @returns {Promise<any>} - Success response
139
- * @summary: Fetch last-modified timestamp
140
- * @description: Use this API to fetch Last-Modified timestamp in header metadata.
141
- */
142
- async getCartLastModified({ id } = {}) {
143
- const { error } = PosCartValidator.getCartLastModified().validate(
144
- { id },
145
- { abortEarly: false, allowUnknown: true }
146
- );
147
- if (error) {
148
- return Promise.reject(new FDKClientValidationError(error));
149
- }
150
-
151
- // Showing warrnings if extra unknown parameters are found
152
- const { error: warrning } = PosCartValidator.getCartLastModified().validate(
153
- { id },
154
- { abortEarly: false, allowUnknown: false }
155
- );
156
- if (warrning) {
157
- Logger({
158
- level: "WARN",
159
- message: "Parameter Validation warrnings for getCartLastModified",
160
- });
161
- Logger({ level: "WARN", message: warrning });
162
- }
163
-
164
- const query_params = {};
165
- query_params["id"] = id;
166
-
167
- const xHeaders = {};
168
-
169
- const response = await APIClient.execute(
170
- this._conf,
171
- "head",
172
- constructUrl({
173
- url: this._urls["getCartLastModified"],
174
- params: {},
175
- }),
176
- query_params,
177
- undefined,
178
- xHeaders
179
- );
180
-
181
- const { error: res_error } = Joi.string()
182
- .allow("")
183
- .validate(response, { abortEarly: false, allowUnknown: false });
184
-
185
- if (res_error) {
186
- Logger({
187
- level: "WARN",
188
- message: "Response Validation Warnnings for getCartLastModified",
116
+ message: "Response Validation Warnnings for addAddress",
189
117
  });
190
118
  Logger({ level: "WARN", message: res_error });
191
119
  }
@@ -266,19 +194,19 @@ class PosCart {
266
194
 
267
195
  /**
268
196
  * @param {Object} arg - Arg object.
269
- * @param {string} [arg.id] -
270
197
  * @param {boolean} [arg.i] -
271
198
  * @param {boolean} [arg.b] -
272
- * @param {string} [arg.areaCode] -
199
+ * @param {boolean} [arg.p] -
200
+ * @param {string} [arg.id] -
273
201
  * @param {boolean} [arg.buyNow] -
274
- * @param {UpdateCartRequest} arg.body
275
- * @returns {Promise<UpdateCartDetailResponse>} - Success response
276
- * @summary: Update items in the cart
277
- * @description: <p>Use this API to update items added to the cart with the help of a request object containing attributes like item_quantity and item_size. These attributes will be fetched from the following APIs</p> <ul> <li><font color="monochrome">operation</font> Operation for current api call. <b>update_item</b> for update items. <b>remove_item</b> for removing items.</li> <li> <font color="monochrome">item_id</font> "/platform/content/v1/products/"</li> <li> <font color="monochrome">item_size</font> "/platform/content/v1/products/:slug/sizes/"</li> <li> <font color="monochrome">quantity</font> item quantity (must be greater than or equal to 1)</li> <li> <font color="monochrome">article_id</font> "/content​/v1​/products​/:identifier​/sizes​/price​/"</li> <li> <font color="monochrome">item_index</font> item position in the cart (must be greater than or equal to 0)</li> </ul>
202
+ * @param {ApplyCouponRequest} arg.body
203
+ * @returns {Promise<CartDetailResponse>} - Success response
204
+ * @summary: Apply Coupon
205
+ * @description: Use this API to apply coupons on items in the cart.
278
206
  */
279
- async updateCart({ body, id, i, b, areaCode, buyNow } = {}) {
280
- const { error } = PosCartValidator.updateCart().validate(
281
- { body, id, i, b, areaCode, buyNow },
207
+ async applyCoupon({ body, i, b, p, id, buyNow } = {}) {
208
+ const { error } = PosCartValidator.applyCoupon().validate(
209
+ { body, i, b, p, id, buyNow },
282
210
  { abortEarly: false, allowUnknown: true }
283
211
  );
284
212
  if (error) {
@@ -286,32 +214,32 @@ class PosCart {
286
214
  }
287
215
 
288
216
  // Showing warrnings if extra unknown parameters are found
289
- const { error: warrning } = PosCartValidator.updateCart().validate(
290
- { body, id, i, b, areaCode, buyNow },
217
+ const { error: warrning } = PosCartValidator.applyCoupon().validate(
218
+ { body, i, b, p, id, buyNow },
291
219
  { abortEarly: false, allowUnknown: false }
292
220
  );
293
221
  if (warrning) {
294
222
  Logger({
295
223
  level: "WARN",
296
- message: "Parameter Validation warrnings for updateCart",
224
+ message: "Parameter Validation warrnings for applyCoupon",
297
225
  });
298
226
  Logger({ level: "WARN", message: warrning });
299
227
  }
300
228
 
301
229
  const query_params = {};
302
- query_params["id"] = id;
303
230
  query_params["i"] = i;
304
231
  query_params["b"] = b;
305
- query_params["area_code"] = areaCode;
232
+ query_params["p"] = p;
233
+ query_params["id"] = id;
306
234
  query_params["buy_now"] = buyNow;
307
235
 
308
236
  const xHeaders = {};
309
237
 
310
238
  const response = await APIClient.execute(
311
239
  this._conf,
312
- "put",
240
+ "post",
313
241
  constructUrl({
314
- url: this._urls["updateCart"],
242
+ url: this._urls["applyCoupon"],
315
243
  params: {},
316
244
  }),
317
245
  query_params,
@@ -321,7 +249,7 @@ class PosCart {
321
249
 
322
250
  const {
323
251
  error: res_error,
324
- } = PosCartModel.UpdateCartDetailResponse().validate(response, {
252
+ } = PosCartModel.CartDetailResponse().validate(response, {
325
253
  abortEarly: false,
326
254
  allowUnknown: false,
327
255
  });
@@ -329,7 +257,7 @@ class PosCart {
329
257
  if (res_error) {
330
258
  Logger({
331
259
  level: "WARN",
332
- message: "Response Validation Warnnings for updateCart",
260
+ message: "Response Validation Warnnings for applyCoupon",
333
261
  });
334
262
  Logger({ level: "WARN", message: res_error });
335
263
  }
@@ -339,15 +267,18 @@ class PosCart {
339
267
 
340
268
  /**
341
269
  * @param {Object} arg - Arg object.
342
- * @param {string} [arg.id] - The unique identifier of the cart.
270
+ * @param {string} [arg.id] -
271
+ * @param {boolean} [arg.i] -
272
+ * @param {boolean} [arg.b] -
343
273
  * @param {boolean} [arg.buyNow] -
344
- * @returns {Promise<CartItemCountResponse>} - Success response
345
- * @summary: Count items in the cart
346
- * @description: Use this API to get the total number of items present in cart.
274
+ * @param {RewardPointRequest} arg.body
275
+ * @returns {Promise<CartDetailResponse>} - Success response
276
+ * @summary: Apply reward points at cart
277
+ * @description: Use this API to redeem a fixed no. of reward points by applying it to the cart.
347
278
  */
348
- async getItemCount({ id, buyNow } = {}) {
349
- const { error } = PosCartValidator.getItemCount().validate(
350
- { id, buyNow },
279
+ async applyRewardPoints({ body, id, i, b, buyNow } = {}) {
280
+ const { error } = PosCartValidator.applyRewardPoints().validate(
281
+ { body, id, i, b, buyNow },
351
282
  { abortEarly: false, allowUnknown: true }
352
283
  );
353
284
  if (error) {
@@ -355,39 +286,41 @@ class PosCart {
355
286
  }
356
287
 
357
288
  // Showing warrnings if extra unknown parameters are found
358
- const { error: warrning } = PosCartValidator.getItemCount().validate(
359
- { id, buyNow },
289
+ const { error: warrning } = PosCartValidator.applyRewardPoints().validate(
290
+ { body, id, i, b, buyNow },
360
291
  { abortEarly: false, allowUnknown: false }
361
292
  );
362
293
  if (warrning) {
363
294
  Logger({
364
295
  level: "WARN",
365
- message: "Parameter Validation warrnings for getItemCount",
296
+ message: "Parameter Validation warrnings for applyRewardPoints",
366
297
  });
367
298
  Logger({ level: "WARN", message: warrning });
368
299
  }
369
300
 
370
301
  const query_params = {};
371
302
  query_params["id"] = id;
303
+ query_params["i"] = i;
304
+ query_params["b"] = b;
372
305
  query_params["buy_now"] = buyNow;
373
306
 
374
307
  const xHeaders = {};
375
308
 
376
309
  const response = await APIClient.execute(
377
310
  this._conf,
378
- "get",
311
+ "post",
379
312
  constructUrl({
380
- url: this._urls["getItemCount"],
313
+ url: this._urls["applyRewardPoints"],
381
314
  params: {},
382
315
  }),
383
316
  query_params,
384
- undefined,
317
+ body,
385
318
  xHeaders
386
319
  );
387
320
 
388
321
  const {
389
322
  error: res_error,
390
- } = PosCartModel.CartItemCountResponse().validate(response, {
323
+ } = PosCartModel.CartDetailResponse().validate(response, {
391
324
  abortEarly: false,
392
325
  allowUnknown: false,
393
326
  });
@@ -395,7 +328,7 @@ class PosCart {
395
328
  if (res_error) {
396
329
  Logger({
397
330
  level: "WARN",
398
- message: "Response Validation Warnnings for getItemCount",
331
+ message: "Response Validation Warnnings for applyRewardPoints",
399
332
  });
400
333
  Logger({ level: "WARN", message: res_error });
401
334
  }
@@ -406,14 +339,14 @@ class PosCart {
406
339
  /**
407
340
  * @param {Object} arg - Arg object.
408
341
  * @param {string} [arg.id] -
409
- * @param {boolean} [arg.buyNow] -
410
- * @returns {Promise<GetCouponResponse>} - Success response
411
- * @summary: Fetch Coupon
412
- * @description: Use this API to get a list of available coupons along with their details.
342
+ * @param {CartPosCheckoutDetailRequest} arg.body
343
+ * @returns {Promise<CartCheckoutResponse>} - Success response
344
+ * @summary: Checkout all items in the cart
345
+ * @description: Use this API to checkout all items in the cart for payment and order generation. For COD, order will be generated directly, whereas for other checkout modes, user will be redirected to a payment gateway.
413
346
  */
414
- async getCoupons({ id, buyNow } = {}) {
415
- const { error } = PosCartValidator.getCoupons().validate(
416
- { id, buyNow },
347
+ async checkoutCart({ body, id } = {}) {
348
+ const { error } = PosCartValidator.checkoutCart().validate(
349
+ { body, id },
417
350
  { abortEarly: false, allowUnknown: true }
418
351
  );
419
352
  if (error) {
@@ -421,39 +354,38 @@ class PosCart {
421
354
  }
422
355
 
423
356
  // Showing warrnings if extra unknown parameters are found
424
- const { error: warrning } = PosCartValidator.getCoupons().validate(
425
- { id, buyNow },
357
+ const { error: warrning } = PosCartValidator.checkoutCart().validate(
358
+ { body, id },
426
359
  { abortEarly: false, allowUnknown: false }
427
360
  );
428
361
  if (warrning) {
429
362
  Logger({
430
363
  level: "WARN",
431
- message: "Parameter Validation warrnings for getCoupons",
364
+ message: "Parameter Validation warrnings for checkoutCart",
432
365
  });
433
366
  Logger({ level: "WARN", message: warrning });
434
367
  }
435
368
 
436
369
  const query_params = {};
437
370
  query_params["id"] = id;
438
- query_params["buy_now"] = buyNow;
439
371
 
440
372
  const xHeaders = {};
441
373
 
442
374
  const response = await APIClient.execute(
443
375
  this._conf,
444
- "get",
376
+ "post",
445
377
  constructUrl({
446
- url: this._urls["getCoupons"],
378
+ url: this._urls["checkoutCart"],
447
379
  params: {},
448
380
  }),
449
381
  query_params,
450
- undefined,
382
+ body,
451
383
  xHeaders
452
384
  );
453
385
 
454
386
  const {
455
387
  error: res_error,
456
- } = PosCartModel.GetCouponResponse().validate(response, {
388
+ } = PosCartModel.CartCheckoutResponse().validate(response, {
457
389
  abortEarly: false,
458
390
  allowUnknown: false,
459
391
  });
@@ -461,7 +393,7 @@ class PosCart {
461
393
  if (res_error) {
462
394
  Logger({
463
395
  level: "WARN",
464
- message: "Response Validation Warnnings for getCoupons",
396
+ message: "Response Validation Warnnings for checkoutCart",
465
397
  });
466
398
  Logger({ level: "WARN", message: res_error });
467
399
  }
@@ -471,19 +403,28 @@ class PosCart {
471
403
 
472
404
  /**
473
405
  * @param {Object} arg - Arg object.
474
- * @param {boolean} [arg.i] -
475
- * @param {boolean} [arg.b] -
476
- * @param {boolean} [arg.p] -
477
- * @param {string} [arg.id] -
406
+ * @param {string} arg.id -
407
+ * @param {string} [arg.cartId] -
478
408
  * @param {boolean} [arg.buyNow] -
479
- * @param {ApplyCouponRequest} arg.body
480
- * @returns {Promise<CartDetailResponse>} - Success response
481
- * @summary: Apply Coupon
482
- * @description: Use this API to apply coupons on items in the cart.
483
- */
484
- async applyCoupon({ body, i, b, p, id, buyNow } = {}) {
485
- const { error } = PosCartValidator.applyCoupon().validate(
486
- { body, i, b, p, id, buyNow },
409
+ * @param {string} [arg.mobileNo] -
410
+ * @param {string} [arg.checkoutMode] -
411
+ * @param {string} [arg.tags] -
412
+ * @param {boolean} [arg.isDefault] -
413
+ * @returns {Promise<Address>} - Success response
414
+ * @summary: Fetch a single address by its ID
415
+ * @description: Use this API to get an addresses using its ID. If successful, returns a Address resource in the response body specified in `Address`. Attibutes listed below are optional <ul> <li> <font color="monochrome">mobile_no</font></li> <li> <font color="monochrome">checkout_mode</font></li> <li> <font color="monochrome">tags</font></li> <li> <font color="monochrome">default</font></li> </ul>
416
+ */
417
+ async getAddressById({
418
+ id,
419
+ cartId,
420
+ buyNow,
421
+ mobileNo,
422
+ checkoutMode,
423
+ tags,
424
+ isDefault,
425
+ } = {}) {
426
+ const { error } = PosCartValidator.getAddressById().validate(
427
+ { id, cartId, buyNow, mobileNo, checkoutMode, tags, isDefault },
487
428
  { abortEarly: false, allowUnknown: true }
488
429
  );
489
430
  if (error) {
@@ -491,42 +432,122 @@ class PosCart {
491
432
  }
492
433
 
493
434
  // Showing warrnings if extra unknown parameters are found
494
- const { error: warrning } = PosCartValidator.applyCoupon().validate(
495
- { body, i, b, p, id, buyNow },
435
+ const { error: warrning } = PosCartValidator.getAddressById().validate(
436
+ { id, cartId, buyNow, mobileNo, checkoutMode, tags, isDefault },
496
437
  { abortEarly: false, allowUnknown: false }
497
438
  );
498
439
  if (warrning) {
499
440
  Logger({
500
441
  level: "WARN",
501
- message: "Parameter Validation warrnings for applyCoupon",
442
+ message: "Parameter Validation warrnings for getAddressById",
502
443
  });
503
444
  Logger({ level: "WARN", message: warrning });
504
445
  }
505
446
 
506
447
  const query_params = {};
507
- query_params["i"] = i;
508
- query_params["b"] = b;
509
- query_params["p"] = p;
510
- query_params["id"] = id;
448
+ query_params["cart_id"] = cartId;
511
449
  query_params["buy_now"] = buyNow;
450
+ query_params["mobile_no"] = mobileNo;
451
+ query_params["checkout_mode"] = checkoutMode;
452
+ query_params["tags"] = tags;
453
+ query_params["is_default"] = isDefault;
512
454
 
513
455
  const xHeaders = {};
514
456
 
515
457
  const response = await APIClient.execute(
516
458
  this._conf,
517
- "post",
459
+ "get",
518
460
  constructUrl({
519
- url: this._urls["applyCoupon"],
461
+ url: this._urls["getAddressById"],
462
+ params: { id },
463
+ }),
464
+ query_params,
465
+ undefined,
466
+ xHeaders
467
+ );
468
+
469
+ const { error: res_error } = PosCartModel.Address().validate(response, {
470
+ abortEarly: false,
471
+ allowUnknown: false,
472
+ });
473
+
474
+ if (res_error) {
475
+ Logger({
476
+ level: "WARN",
477
+ message: "Response Validation Warnnings for getAddressById",
478
+ });
479
+ Logger({ level: "WARN", message: res_error });
480
+ }
481
+
482
+ return response;
483
+ }
484
+
485
+ /**
486
+ * @param {Object} arg - Arg object.
487
+ * @param {string} [arg.cartId] -
488
+ * @param {boolean} [arg.buyNow] -
489
+ * @param {string} [arg.mobileNo] -
490
+ * @param {string} [arg.checkoutMode] -
491
+ * @param {string} [arg.tags] -
492
+ * @param {boolean} [arg.isDefault] -
493
+ * @returns {Promise<GetAddressesResponse>} - Success response
494
+ * @summary: Fetch address
495
+ * @description: Use this API to get all the addresses associated with an account. If successful, returns a Address resource in the response body specified in GetAddressesResponse.attibutes listed below are optional <ul> <li> <font color="monochrome">uid</font></li> <li> <font color="monochrome">address_id</font></li> <li> <font color="monochrome">mobile_no</font></li> <li> <font color="monochrome">checkout_mode</font></li> <li> <font color="monochrome">tags</font></li> <li> <font color="monochrome">default</font></li> </ul>
496
+ */
497
+ async getAddresses({
498
+ cartId,
499
+ buyNow,
500
+ mobileNo,
501
+ checkoutMode,
502
+ tags,
503
+ isDefault,
504
+ } = {}) {
505
+ const { error } = PosCartValidator.getAddresses().validate(
506
+ { cartId, buyNow, mobileNo, checkoutMode, tags, isDefault },
507
+ { abortEarly: false, allowUnknown: true }
508
+ );
509
+ if (error) {
510
+ return Promise.reject(new FDKClientValidationError(error));
511
+ }
512
+
513
+ // Showing warrnings if extra unknown parameters are found
514
+ const { error: warrning } = PosCartValidator.getAddresses().validate(
515
+ { cartId, buyNow, mobileNo, checkoutMode, tags, isDefault },
516
+ { abortEarly: false, allowUnknown: false }
517
+ );
518
+ if (warrning) {
519
+ Logger({
520
+ level: "WARN",
521
+ message: "Parameter Validation warrnings for getAddresses",
522
+ });
523
+ Logger({ level: "WARN", message: warrning });
524
+ }
525
+
526
+ const query_params = {};
527
+ query_params["cart_id"] = cartId;
528
+ query_params["buy_now"] = buyNow;
529
+ query_params["mobile_no"] = mobileNo;
530
+ query_params["checkout_mode"] = checkoutMode;
531
+ query_params["tags"] = tags;
532
+ query_params["is_default"] = isDefault;
533
+
534
+ const xHeaders = {};
535
+
536
+ const response = await APIClient.execute(
537
+ this._conf,
538
+ "get",
539
+ constructUrl({
540
+ url: this._urls["getAddresses"],
520
541
  params: {},
521
542
  }),
522
543
  query_params,
523
- body,
544
+ undefined,
524
545
  xHeaders
525
546
  );
526
547
 
527
548
  const {
528
549
  error: res_error,
529
- } = PosCartModel.CartDetailResponse().validate(response, {
550
+ } = PosCartModel.GetAddressesResponse().validate(response, {
530
551
  abortEarly: false,
531
552
  allowUnknown: false,
532
553
  });
@@ -534,7 +555,7 @@ class PosCart {
534
555
  if (res_error) {
535
556
  Logger({
536
557
  level: "WARN",
537
- message: "Response Validation Warnnings for applyCoupon",
558
+ message: "Response Validation Warnnings for getAddresses",
538
559
  });
539
560
  Logger({ level: "WARN", message: res_error });
540
561
  }
@@ -544,15 +565,15 @@ class PosCart {
544
565
 
545
566
  /**
546
567
  * @param {Object} arg - Arg object.
568
+ * @param {string} arg.areaCode -
547
569
  * @param {string} [arg.id] -
548
- * @param {boolean} [arg.buyNow] -
549
- * @returns {Promise<CartDetailResponse>} - Success response
550
- * @summary: Remove Coupon Applied
551
- * @description: Remove Coupon applied on the cart by passing uid in request body.
570
+ * @returns {Promise<CartDeliveryModesResponse>} - Success response
571
+ * @summary: Get available delivery modes for cart
572
+ * @description: Use this API to get the delivery modes (home-delivery/store-pickup) along with a list of pickup stores available for a given cart at a given PIN Code. User can then view the address of a pickup store with the help of store-address API.
552
573
  */
553
- async removeCoupon({ id, buyNow } = {}) {
554
- const { error } = PosCartValidator.removeCoupon().validate(
555
- { id, buyNow },
574
+ async getAvailableDeliveryModes({ areaCode, id } = {}) {
575
+ const { error } = PosCartValidator.getAvailableDeliveryModes().validate(
576
+ { areaCode, id },
556
577
  { abortEarly: false, allowUnknown: true }
557
578
  );
558
579
  if (error) {
@@ -560,29 +581,31 @@ class PosCart {
560
581
  }
561
582
 
562
583
  // Showing warrnings if extra unknown parameters are found
563
- const { error: warrning } = PosCartValidator.removeCoupon().validate(
564
- { id, buyNow },
584
+ const {
585
+ error: warrning,
586
+ } = PosCartValidator.getAvailableDeliveryModes().validate(
587
+ { areaCode, id },
565
588
  { abortEarly: false, allowUnknown: false }
566
589
  );
567
590
  if (warrning) {
568
591
  Logger({
569
592
  level: "WARN",
570
- message: "Parameter Validation warrnings for removeCoupon",
593
+ message: "Parameter Validation warrnings for getAvailableDeliveryModes",
571
594
  });
572
595
  Logger({ level: "WARN", message: warrning });
573
596
  }
574
597
 
575
598
  const query_params = {};
599
+ query_params["area_code"] = areaCode;
576
600
  query_params["id"] = id;
577
- query_params["buy_now"] = buyNow;
578
601
 
579
602
  const xHeaders = {};
580
603
 
581
604
  const response = await APIClient.execute(
582
605
  this._conf,
583
- "delete",
606
+ "get",
584
607
  constructUrl({
585
- url: this._urls["removeCoupon"],
608
+ url: this._urls["getAvailableDeliveryModes"],
586
609
  params: {},
587
610
  }),
588
611
  query_params,
@@ -592,7 +615,7 @@ class PosCart {
592
615
 
593
616
  const {
594
617
  error: res_error,
595
- } = PosCartModel.CartDetailResponse().validate(response, {
618
+ } = PosCartModel.CartDeliveryModesResponse().validate(response, {
596
619
  abortEarly: false,
597
620
  allowUnknown: false,
598
621
  });
@@ -600,7 +623,7 @@ class PosCart {
600
623
  if (res_error) {
601
624
  Logger({
602
625
  level: "WARN",
603
- message: "Response Validation Warnnings for removeCoupon",
626
+ message: "Response Validation Warnnings for getAvailableDeliveryModes",
604
627
  });
605
628
  Logger({ level: "WARN", message: res_error });
606
629
  }
@@ -687,15 +710,16 @@ class PosCart {
687
710
  * @param {string} [arg.id] -
688
711
  * @param {boolean} [arg.i] -
689
712
  * @param {boolean} [arg.b] -
713
+ * @param {number} [arg.assignCardId] -
714
+ * @param {string} [arg.areaCode] -
690
715
  * @param {boolean} [arg.buyNow] -
691
- * @param {RewardPointRequest} arg.body
692
716
  * @returns {Promise<CartDetailResponse>} - Success response
693
- * @summary: Apply reward points at cart
694
- * @description: Use this API to redeem a fixed no. of reward points by applying it to the cart.
717
+ * @summary: Fetch all items added to the cart
718
+ * @description: Use this API to get details of all the items added to a cart.
695
719
  */
696
- async applyRewardPoints({ body, id, i, b, buyNow } = {}) {
697
- const { error } = PosCartValidator.applyRewardPoints().validate(
698
- { body, id, i, b, buyNow },
720
+ async getCart({ id, i, b, assignCardId, areaCode, buyNow } = {}) {
721
+ const { error } = PosCartValidator.getCart().validate(
722
+ { id, i, b, assignCardId, areaCode, buyNow },
699
723
  { abortEarly: false, allowUnknown: true }
700
724
  );
701
725
  if (error) {
@@ -703,14 +727,14 @@ class PosCart {
703
727
  }
704
728
 
705
729
  // Showing warrnings if extra unknown parameters are found
706
- const { error: warrning } = PosCartValidator.applyRewardPoints().validate(
707
- { body, id, i, b, buyNow },
730
+ const { error: warrning } = PosCartValidator.getCart().validate(
731
+ { id, i, b, assignCardId, areaCode, buyNow },
708
732
  { abortEarly: false, allowUnknown: false }
709
733
  );
710
734
  if (warrning) {
711
735
  Logger({
712
736
  level: "WARN",
713
- message: "Parameter Validation warrnings for applyRewardPoints",
737
+ message: "Parameter Validation warrnings for getCart",
714
738
  });
715
739
  Logger({ level: "WARN", message: warrning });
716
740
  }
@@ -719,19 +743,21 @@ class PosCart {
719
743
  query_params["id"] = id;
720
744
  query_params["i"] = i;
721
745
  query_params["b"] = b;
746
+ query_params["assign_card_id"] = assignCardId;
747
+ query_params["area_code"] = areaCode;
722
748
  query_params["buy_now"] = buyNow;
723
749
 
724
750
  const xHeaders = {};
725
751
 
726
752
  const response = await APIClient.execute(
727
753
  this._conf,
728
- "post",
754
+ "get",
729
755
  constructUrl({
730
- url: this._urls["applyRewardPoints"],
756
+ url: this._urls["getCart"],
731
757
  params: {},
732
758
  }),
733
759
  query_params,
734
- body,
760
+ undefined,
735
761
  xHeaders
736
762
  );
737
763
 
@@ -745,7 +771,7 @@ class PosCart {
745
771
  if (res_error) {
746
772
  Logger({
747
773
  level: "WARN",
748
- message: "Response Validation Warnnings for applyRewardPoints",
774
+ message: "Response Validation Warnnings for getCart",
749
775
  });
750
776
  Logger({ level: "WARN", message: res_error });
751
777
  }
@@ -755,26 +781,14 @@ class PosCart {
755
781
 
756
782
  /**
757
783
  * @param {Object} arg - Arg object.
758
- * @param {string} [arg.cartId] -
759
- * @param {boolean} [arg.buyNow] -
760
- * @param {string} [arg.mobileNo] -
761
- * @param {string} [arg.checkoutMode] -
762
- * @param {string} [arg.tags] -
763
- * @param {boolean} [arg.isDefault] -
764
- * @returns {Promise<GetAddressesResponse>} - Success response
765
- * @summary: Fetch address
766
- * @description: Use this API to get all the addresses associated with an account. If successful, returns a Address resource in the response body specified in GetAddressesResponse.attibutes listed below are optional <ul> <li> <font color="monochrome">uid</font></li> <li> <font color="monochrome">address_id</font></li> <li> <font color="monochrome">mobile_no</font></li> <li> <font color="monochrome">checkout_mode</font></li> <li> <font color="monochrome">tags</font></li> <li> <font color="monochrome">default</font></li> </ul>
784
+ * @param {string} [arg.id] -
785
+ * @returns {Promise<any>} - Success response
786
+ * @summary: Fetch last-modified timestamp
787
+ * @description: Use this API to fetch Last-Modified timestamp in header metadata.
767
788
  */
768
- async getAddresses({
769
- cartId,
770
- buyNow,
771
- mobileNo,
772
- checkoutMode,
773
- tags,
774
- isDefault,
775
- } = {}) {
776
- const { error } = PosCartValidator.getAddresses().validate(
777
- { cartId, buyNow, mobileNo, checkoutMode, tags, isDefault },
789
+ async getCartLastModified({ id } = {}) {
790
+ const { error } = PosCartValidator.getCartLastModified().validate(
791
+ { id },
778
792
  { abortEarly: false, allowUnknown: true }
779
793
  );
780
794
  if (error) {
@@ -782,33 +796,28 @@ class PosCart {
782
796
  }
783
797
 
784
798
  // Showing warrnings if extra unknown parameters are found
785
- const { error: warrning } = PosCartValidator.getAddresses().validate(
786
- { cartId, buyNow, mobileNo, checkoutMode, tags, isDefault },
799
+ const { error: warrning } = PosCartValidator.getCartLastModified().validate(
800
+ { id },
787
801
  { abortEarly: false, allowUnknown: false }
788
802
  );
789
803
  if (warrning) {
790
804
  Logger({
791
805
  level: "WARN",
792
- message: "Parameter Validation warrnings for getAddresses",
806
+ message: "Parameter Validation warrnings for getCartLastModified",
793
807
  });
794
808
  Logger({ level: "WARN", message: warrning });
795
809
  }
796
810
 
797
811
  const query_params = {};
798
- query_params["cart_id"] = cartId;
799
- query_params["buy_now"] = buyNow;
800
- query_params["mobile_no"] = mobileNo;
801
- query_params["checkout_mode"] = checkoutMode;
802
- query_params["tags"] = tags;
803
- query_params["is_default"] = isDefault;
812
+ query_params["id"] = id;
804
813
 
805
814
  const xHeaders = {};
806
815
 
807
816
  const response = await APIClient.execute(
808
817
  this._conf,
809
- "get",
818
+ "head",
810
819
  constructUrl({
811
- url: this._urls["getAddresses"],
820
+ url: this._urls["getCartLastModified"],
812
821
  params: {},
813
822
  }),
814
823
  query_params,
@@ -816,17 +825,14 @@ class PosCart {
816
825
  xHeaders
817
826
  );
818
827
 
819
- const {
820
- error: res_error,
821
- } = PosCartModel.GetAddressesResponse().validate(response, {
822
- abortEarly: false,
823
- allowUnknown: false,
824
- });
828
+ const { error: res_error } = Joi.string()
829
+ .allow("")
830
+ .validate(response, { abortEarly: false, allowUnknown: false });
825
831
 
826
832
  if (res_error) {
827
833
  Logger({
828
834
  level: "WARN",
829
- message: "Response Validation Warnnings for getAddresses",
835
+ message: "Response Validation Warnnings for getCartLastModified",
830
836
  });
831
837
  Logger({ level: "WARN", message: res_error });
832
838
  }
@@ -836,13 +842,13 @@ class PosCart {
836
842
 
837
843
  /**
838
844
  * @param {Object} arg - Arg object.
839
- * @param {Address} arg.body
840
- * @returns {Promise<SaveAddressResponse>} - Success response
841
- * @summary: Add address to an account
842
- * @description: Use this API to add an address to an account.
845
+ * @param {GetShareCartLinkRequest} arg.body
846
+ * @returns {Promise<GetShareCartLinkResponse>} - Success response
847
+ * @summary: Generate token for sharing the cart
848
+ * @description: Use this API to generate a shared cart snapshot and return a shortlink token. The link can be shared with other users for getting the same items in their cart.
843
849
  */
844
- async addAddress({ body } = {}) {
845
- const { error } = PosCartValidator.addAddress().validate(
850
+ async getCartShareLink({ body } = {}) {
851
+ const { error } = PosCartValidator.getCartShareLink().validate(
846
852
  { body },
847
853
  { abortEarly: false, allowUnknown: true }
848
854
  );
@@ -851,14 +857,14 @@ class PosCart {
851
857
  }
852
858
 
853
859
  // Showing warrnings if extra unknown parameters are found
854
- const { error: warrning } = PosCartValidator.addAddress().validate(
860
+ const { error: warrning } = PosCartValidator.getCartShareLink().validate(
855
861
  { body },
856
862
  { abortEarly: false, allowUnknown: false }
857
863
  );
858
864
  if (warrning) {
859
865
  Logger({
860
866
  level: "WARN",
861
- message: "Parameter Validation warrnings for addAddress",
867
+ message: "Parameter Validation warrnings for getCartShareLink",
862
868
  });
863
869
  Logger({ level: "WARN", message: warrning });
864
870
  }
@@ -871,7 +877,7 @@ class PosCart {
871
877
  this._conf,
872
878
  "post",
873
879
  constructUrl({
874
- url: this._urls["addAddress"],
880
+ url: this._urls["getCartShareLink"],
875
881
  params: {},
876
882
  }),
877
883
  query_params,
@@ -881,7 +887,7 @@ class PosCart {
881
887
 
882
888
  const {
883
889
  error: res_error,
884
- } = PosCartModel.SaveAddressResponse().validate(response, {
890
+ } = PosCartModel.GetShareCartLinkResponse().validate(response, {
885
891
  abortEarly: false,
886
892
  allowUnknown: false,
887
893
  });
@@ -889,7 +895,7 @@ class PosCart {
889
895
  if (res_error) {
890
896
  Logger({
891
897
  level: "WARN",
892
- message: "Response Validation Warnnings for addAddress",
898
+ message: "Response Validation Warnnings for getCartShareLink",
893
899
  });
894
900
  Logger({ level: "WARN", message: res_error });
895
901
  }
@@ -899,28 +905,14 @@ class PosCart {
899
905
 
900
906
  /**
901
907
  * @param {Object} arg - Arg object.
902
- * @param {string} arg.id -
903
- * @param {string} [arg.cartId] -
904
- * @param {boolean} [arg.buyNow] -
905
- * @param {string} [arg.mobileNo] -
906
- * @param {string} [arg.checkoutMode] -
907
- * @param {string} [arg.tags] -
908
- * @param {boolean} [arg.isDefault] -
909
- * @returns {Promise<Address>} - Success response
910
- * @summary: Fetch a single address by its ID
911
- * @description: Use this API to get an addresses using its ID. If successful, returns a Address resource in the response body specified in `Address`. Attibutes listed below are optional <ul> <li> <font color="monochrome">mobile_no</font></li> <li> <font color="monochrome">checkout_mode</font></li> <li> <font color="monochrome">tags</font></li> <li> <font color="monochrome">default</font></li> </ul>
908
+ * @param {string} arg.token - Token of the shared short link
909
+ * @returns {Promise<SharedCartResponse>} - Success response
910
+ * @summary: Get details of a shared cart
911
+ * @description: Use this API to get the shared cart details as per the token generated using the share-cart API.
912
912
  */
913
- async getAddressById({
914
- id,
915
- cartId,
916
- buyNow,
917
- mobileNo,
918
- checkoutMode,
919
- tags,
920
- isDefault,
921
- } = {}) {
922
- const { error } = PosCartValidator.getAddressById().validate(
923
- { id, cartId, buyNow, mobileNo, checkoutMode, tags, isDefault },
913
+ async getCartSharedItems({ token } = {}) {
914
+ const { error } = PosCartValidator.getCartSharedItems().validate(
915
+ { token },
924
916
  { abortEarly: false, allowUnknown: true }
925
917
  );
926
918
  if (error) {
@@ -928,25 +920,19 @@ class PosCart {
928
920
  }
929
921
 
930
922
  // Showing warrnings if extra unknown parameters are found
931
- const { error: warrning } = PosCartValidator.getAddressById().validate(
932
- { id, cartId, buyNow, mobileNo, checkoutMode, tags, isDefault },
923
+ const { error: warrning } = PosCartValidator.getCartSharedItems().validate(
924
+ { token },
933
925
  { abortEarly: false, allowUnknown: false }
934
926
  );
935
927
  if (warrning) {
936
928
  Logger({
937
929
  level: "WARN",
938
- message: "Parameter Validation warrnings for getAddressById",
930
+ message: "Parameter Validation warrnings for getCartSharedItems",
939
931
  });
940
932
  Logger({ level: "WARN", message: warrning });
941
933
  }
942
934
 
943
935
  const query_params = {};
944
- query_params["cart_id"] = cartId;
945
- query_params["buy_now"] = buyNow;
946
- query_params["mobile_no"] = mobileNo;
947
- query_params["checkout_mode"] = checkoutMode;
948
- query_params["tags"] = tags;
949
- query_params["is_default"] = isDefault;
950
936
 
951
937
  const xHeaders = {};
952
938
 
@@ -954,15 +940,17 @@ class PosCart {
954
940
  this._conf,
955
941
  "get",
956
942
  constructUrl({
957
- url: this._urls["getAddressById"],
958
- params: { id },
943
+ url: this._urls["getCartSharedItems"],
944
+ params: { token },
959
945
  }),
960
946
  query_params,
961
947
  undefined,
962
948
  xHeaders
963
949
  );
964
950
 
965
- const { error: res_error } = PosCartModel.Address().validate(response, {
951
+ const {
952
+ error: res_error,
953
+ } = PosCartModel.SharedCartResponse().validate(response, {
966
954
  abortEarly: false,
967
955
  allowUnknown: false,
968
956
  });
@@ -970,7 +958,7 @@ class PosCart {
970
958
  if (res_error) {
971
959
  Logger({
972
960
  level: "WARN",
973
- message: "Response Validation Warnnings for getAddressById",
961
+ message: "Response Validation Warnnings for getCartSharedItems",
974
962
  });
975
963
  Logger({ level: "WARN", message: res_error });
976
964
  }
@@ -980,15 +968,15 @@ class PosCart {
980
968
 
981
969
  /**
982
970
  * @param {Object} arg - Arg object.
983
- * @param {string} arg.id - ID allotted to the selected address
984
- * @param {Address} arg.body
985
- * @returns {Promise<UpdateAddressResponse>} - Success response
986
- * @summary: Update address added to an account
987
- * @description: <p>Use this API to update an existing address in the account. Request object should contain attributes mentioned in <font color="blue">Address </font> can be updated. These attributes are:</p> <ul> <li> <font color="monochrome">is_default_address</font></li> <li> <font color="monochrome">landmark</font></li> <li> <font color="monochrome">area</font></li> <li> <font color="monochrome">pincode</font></li> <li> <font color="monochrome">email</font></li> <li> <font color="monochrome">address_type</font></li> <li> <font color="monochrome">name</font></li> <li> <font color="monochrome">address_id</font></li> <li> <font color="monochrome">address</font></li> </ul>
971
+ * @param {string} [arg.id] -
972
+ * @param {boolean} [arg.buyNow] -
973
+ * @returns {Promise<GetCouponResponse>} - Success response
974
+ * @summary: Fetch Coupon
975
+ * @description: Use this API to get a list of available coupons along with their details.
988
976
  */
989
- async updateAddress({ id, body } = {}) {
990
- const { error } = PosCartValidator.updateAddress().validate(
991
- { id, body },
977
+ async getCoupons({ id, buyNow } = {}) {
978
+ const { error } = PosCartValidator.getCoupons().validate(
979
+ { id, buyNow },
992
980
  { abortEarly: false, allowUnknown: true }
993
981
  );
994
982
  if (error) {
@@ -996,37 +984,39 @@ class PosCart {
996
984
  }
997
985
 
998
986
  // Showing warrnings if extra unknown parameters are found
999
- const { error: warrning } = PosCartValidator.updateAddress().validate(
1000
- { id, body },
987
+ const { error: warrning } = PosCartValidator.getCoupons().validate(
988
+ { id, buyNow },
1001
989
  { abortEarly: false, allowUnknown: false }
1002
990
  );
1003
991
  if (warrning) {
1004
992
  Logger({
1005
993
  level: "WARN",
1006
- message: "Parameter Validation warrnings for updateAddress",
994
+ message: "Parameter Validation warrnings for getCoupons",
1007
995
  });
1008
996
  Logger({ level: "WARN", message: warrning });
1009
997
  }
1010
998
 
1011
999
  const query_params = {};
1000
+ query_params["id"] = id;
1001
+ query_params["buy_now"] = buyNow;
1012
1002
 
1013
1003
  const xHeaders = {};
1014
1004
 
1015
1005
  const response = await APIClient.execute(
1016
1006
  this._conf,
1017
- "put",
1007
+ "get",
1018
1008
  constructUrl({
1019
- url: this._urls["updateAddress"],
1020
- params: { id },
1009
+ url: this._urls["getCoupons"],
1010
+ params: {},
1021
1011
  }),
1022
1012
  query_params,
1023
- body,
1013
+ undefined,
1024
1014
  xHeaders
1025
1015
  );
1026
1016
 
1027
1017
  const {
1028
1018
  error: res_error,
1029
- } = PosCartModel.UpdateAddressResponse().validate(response, {
1019
+ } = PosCartModel.GetCouponResponse().validate(response, {
1030
1020
  abortEarly: false,
1031
1021
  allowUnknown: false,
1032
1022
  });
@@ -1034,7 +1024,7 @@ class PosCart {
1034
1024
  if (res_error) {
1035
1025
  Logger({
1036
1026
  level: "WARN",
1037
- message: "Response Validation Warnnings for updateAddress",
1027
+ message: "Response Validation Warnnings for getCoupons",
1038
1028
  });
1039
1029
  Logger({ level: "WARN", message: res_error });
1040
1030
  }
@@ -1044,14 +1034,15 @@ class PosCart {
1044
1034
 
1045
1035
  /**
1046
1036
  * @param {Object} arg - Arg object.
1047
- * @param {string} arg.id - ID allotted to the selected address
1048
- * @returns {Promise<DeleteAddressResponse>} - Success response
1049
- * @summary: Remove address associated with an account
1050
- * @description: Use this API to delete an address by its ID. This will returns an object that will indicate whether the address was deleted successfully or not.
1037
+ * @param {string} [arg.id] - The unique identifier of the cart.
1038
+ * @param {boolean} [arg.buyNow] -
1039
+ * @returns {Promise<CartItemCountResponse>} - Success response
1040
+ * @summary: Count items in the cart
1041
+ * @description: Use this API to get the total number of items present in cart.
1051
1042
  */
1052
- async removeAddress({ id } = {}) {
1053
- const { error } = PosCartValidator.removeAddress().validate(
1054
- { id },
1043
+ async getItemCount({ id, buyNow } = {}) {
1044
+ const { error } = PosCartValidator.getItemCount().validate(
1045
+ { id, buyNow },
1055
1046
  { abortEarly: false, allowUnknown: true }
1056
1047
  );
1057
1048
  if (error) {
@@ -1059,28 +1050,30 @@ class PosCart {
1059
1050
  }
1060
1051
 
1061
1052
  // Showing warrnings if extra unknown parameters are found
1062
- const { error: warrning } = PosCartValidator.removeAddress().validate(
1063
- { id },
1053
+ const { error: warrning } = PosCartValidator.getItemCount().validate(
1054
+ { id, buyNow },
1064
1055
  { abortEarly: false, allowUnknown: false }
1065
1056
  );
1066
1057
  if (warrning) {
1067
1058
  Logger({
1068
1059
  level: "WARN",
1069
- message: "Parameter Validation warrnings for removeAddress",
1060
+ message: "Parameter Validation warrnings for getItemCount",
1070
1061
  });
1071
1062
  Logger({ level: "WARN", message: warrning });
1072
1063
  }
1073
1064
 
1074
1065
  const query_params = {};
1066
+ query_params["id"] = id;
1067
+ query_params["buy_now"] = buyNow;
1075
1068
 
1076
1069
  const xHeaders = {};
1077
1070
 
1078
1071
  const response = await APIClient.execute(
1079
1072
  this._conf,
1080
- "delete",
1073
+ "get",
1081
1074
  constructUrl({
1082
- url: this._urls["removeAddress"],
1083
- params: { id },
1075
+ url: this._urls["getItemCount"],
1076
+ params: {},
1084
1077
  }),
1085
1078
  query_params,
1086
1079
  undefined,
@@ -1089,7 +1082,7 @@ class PosCart {
1089
1082
 
1090
1083
  const {
1091
1084
  error: res_error,
1092
- } = PosCartModel.DeleteAddressResponse().validate(response, {
1085
+ } = PosCartModel.CartItemCountResponse().validate(response, {
1093
1086
  abortEarly: false,
1094
1087
  allowUnknown: false,
1095
1088
  });
@@ -1097,7 +1090,7 @@ class PosCart {
1097
1090
  if (res_error) {
1098
1091
  Logger({
1099
1092
  level: "WARN",
1100
- message: "Response Validation Warnnings for removeAddress",
1093
+ message: "Response Validation Warnnings for getItemCount",
1101
1094
  });
1102
1095
  Logger({ level: "WARN", message: res_error });
1103
1096
  }
@@ -1107,18 +1100,40 @@ class PosCart {
1107
1100
 
1108
1101
  /**
1109
1102
  * @param {Object} arg - Arg object.
1110
- * @param {string} [arg.cartId] -
1111
- * @param {boolean} [arg.buyNow] -
1112
- * @param {boolean} [arg.i] -
1113
- * @param {boolean} [arg.b] -
1114
- * @param {SelectCartAddressRequest} arg.body
1115
- * @returns {Promise<CartDetailResponse>} - Success response
1116
- * @summary: Select an address from available addresses
1117
- * @description: <p>Select Address from all addresses associated with the account in order to ship the cart items to that address, otherwise default address will be selected implicitly. See `SelectCartAddressRequest` in schema of request body for the list of attributes needed to select Address from account. On successful request, this API returns a Cart object. Below address attributes are required. <ul> <li> <font color="monochrome">address_id</font></li> <li> <font color="monochrome">billing_address_id</font></li> <li> <font color="monochrome">uid</font></li> </ul></p>
1103
+ * @param {number} [arg.pickAtStoreUid] -
1104
+ * @param {number} [arg.orderingStoreId] -
1105
+ * @param {boolean} [arg.p] - This is a boolean value. Select `true` for
1106
+ * getting a payment option in response.
1107
+ * @param {string} [arg.id] - The unique identifier of the cart
1108
+ * @param {string} [arg.addressId] - ID allotted to the selected address
1109
+ * @param {string} [arg.areaCode] - The PIN Code of the destination address,
1110
+ * e.g. 400059
1111
+ * @param {string} [arg.orderType] - The order type of shipment HomeDelivery
1112
+ * - If the customer wants the order home-delivered PickAtStore - If the
1113
+ * customer wants the handover of an order at the store itself.
1114
+ * @returns {Promise<CartShipmentsResponse>} - Success response
1115
+ * @summary: Get delivery date and options before checkout
1116
+ * @description: Use this API to get shipment details, expected delivery date, items and price breakup of the shipment.
1118
1117
  */
1119
- async selectAddress({ body, cartId, buyNow, i, b } = {}) {
1120
- const { error } = PosCartValidator.selectAddress().validate(
1121
- { body, cartId, buyNow, i, b },
1118
+ async getShipments({
1119
+ pickAtStoreUid,
1120
+ orderingStoreId,
1121
+ p,
1122
+ id,
1123
+ addressId,
1124
+ areaCode,
1125
+ orderType,
1126
+ } = {}) {
1127
+ const { error } = PosCartValidator.getShipments().validate(
1128
+ {
1129
+ pickAtStoreUid,
1130
+ orderingStoreId,
1131
+ p,
1132
+ id,
1133
+ addressId,
1134
+ areaCode,
1135
+ orderType,
1136
+ },
1122
1137
  { abortEarly: false, allowUnknown: true }
1123
1138
  );
1124
1139
  if (error) {
@@ -1126,41 +1141,52 @@ class PosCart {
1126
1141
  }
1127
1142
 
1128
1143
  // Showing warrnings if extra unknown parameters are found
1129
- const { error: warrning } = PosCartValidator.selectAddress().validate(
1130
- { body, cartId, buyNow, i, b },
1144
+ const { error: warrning } = PosCartValidator.getShipments().validate(
1145
+ {
1146
+ pickAtStoreUid,
1147
+ orderingStoreId,
1148
+ p,
1149
+ id,
1150
+ addressId,
1151
+ areaCode,
1152
+ orderType,
1153
+ },
1131
1154
  { abortEarly: false, allowUnknown: false }
1132
1155
  );
1133
1156
  if (warrning) {
1134
1157
  Logger({
1135
1158
  level: "WARN",
1136
- message: "Parameter Validation warrnings for selectAddress",
1159
+ message: "Parameter Validation warrnings for getShipments",
1137
1160
  });
1138
1161
  Logger({ level: "WARN", message: warrning });
1139
1162
  }
1140
1163
 
1141
1164
  const query_params = {};
1142
- query_params["cart_id"] = cartId;
1143
- query_params["buy_now"] = buyNow;
1144
- query_params["i"] = i;
1145
- query_params["b"] = b;
1165
+ query_params["pick_at_store_uid"] = pickAtStoreUid;
1166
+ query_params["ordering_store_id"] = orderingStoreId;
1167
+ query_params["p"] = p;
1168
+ query_params["id"] = id;
1169
+ query_params["address_id"] = addressId;
1170
+ query_params["area_code"] = areaCode;
1171
+ query_params["order_type"] = orderType;
1146
1172
 
1147
1173
  const xHeaders = {};
1148
1174
 
1149
1175
  const response = await APIClient.execute(
1150
1176
  this._conf,
1151
- "post",
1177
+ "get",
1152
1178
  constructUrl({
1153
- url: this._urls["selectAddress"],
1179
+ url: this._urls["getShipments"],
1154
1180
  params: {},
1155
1181
  }),
1156
1182
  query_params,
1157
- body,
1183
+ undefined,
1158
1184
  xHeaders
1159
1185
  );
1160
1186
 
1161
1187
  const {
1162
1188
  error: res_error,
1163
- } = PosCartModel.CartDetailResponse().validate(response, {
1189
+ } = PosCartModel.CartShipmentsResponse().validate(response, {
1164
1190
  abortEarly: false,
1165
1191
  allowUnknown: false,
1166
1192
  });
@@ -1168,7 +1194,7 @@ class PosCart {
1168
1194
  if (res_error) {
1169
1195
  Logger({
1170
1196
  level: "WARN",
1171
- message: "Response Validation Warnnings for selectAddress",
1197
+ message: "Response Validation Warnnings for getShipments",
1172
1198
  });
1173
1199
  Logger({ level: "WARN", message: res_error });
1174
1200
  }
@@ -1178,16 +1204,14 @@ class PosCart {
1178
1204
 
1179
1205
  /**
1180
1206
  * @param {Object} arg - Arg object.
1181
- * @param {string} [arg.id] -
1182
- * @param {boolean} [arg.buyNow] -
1183
- * @param {UpdateCartPaymentRequest} arg.body
1184
- * @returns {Promise<CartDetailResponse>} - Success response
1185
- * @summary: Update cart payment
1186
- * @description: Use this API to update cart payment.
1207
+ * @param {number} arg.storeUid -
1208
+ * @returns {Promise<StoreDetailsResponse>} - Success response
1209
+ * @summary: Get list of stores for give uids
1210
+ * @description: Use this API to get the store details by entering the unique identifier of the pickup stores shown in the response of available-delivery-mode API.
1187
1211
  */
1188
- async selectPaymentMode({ body, id, buyNow } = {}) {
1189
- const { error } = PosCartValidator.selectPaymentMode().validate(
1190
- { body, id, buyNow },
1212
+ async getStoreAddressByUid({ storeUid } = {}) {
1213
+ const { error } = PosCartValidator.getStoreAddressByUid().validate(
1214
+ { storeUid },
1191
1215
  { abortEarly: false, allowUnknown: true }
1192
1216
  );
1193
1217
  if (error) {
@@ -1195,39 +1219,40 @@ class PosCart {
1195
1219
  }
1196
1220
 
1197
1221
  // Showing warrnings if extra unknown parameters are found
1198
- const { error: warrning } = PosCartValidator.selectPaymentMode().validate(
1199
- { body, id, buyNow },
1222
+ const {
1223
+ error: warrning,
1224
+ } = PosCartValidator.getStoreAddressByUid().validate(
1225
+ { storeUid },
1200
1226
  { abortEarly: false, allowUnknown: false }
1201
1227
  );
1202
1228
  if (warrning) {
1203
1229
  Logger({
1204
1230
  level: "WARN",
1205
- message: "Parameter Validation warrnings for selectPaymentMode",
1231
+ message: "Parameter Validation warrnings for getStoreAddressByUid",
1206
1232
  });
1207
1233
  Logger({ level: "WARN", message: warrning });
1208
1234
  }
1209
1235
 
1210
1236
  const query_params = {};
1211
- query_params["id"] = id;
1212
- query_params["buy_now"] = buyNow;
1237
+ query_params["store_uid"] = storeUid;
1213
1238
 
1214
1239
  const xHeaders = {};
1215
1240
 
1216
1241
  const response = await APIClient.execute(
1217
1242
  this._conf,
1218
- "put",
1243
+ "get",
1219
1244
  constructUrl({
1220
- url: this._urls["selectPaymentMode"],
1245
+ url: this._urls["getStoreAddressByUid"],
1221
1246
  params: {},
1222
1247
  }),
1223
1248
  query_params,
1224
- body,
1249
+ undefined,
1225
1250
  xHeaders
1226
1251
  );
1227
1252
 
1228
1253
  const {
1229
1254
  error: res_error,
1230
- } = PosCartModel.CartDetailResponse().validate(response, {
1255
+ } = PosCartModel.StoreDetailsResponse().validate(response, {
1231
1256
  abortEarly: false,
1232
1257
  allowUnknown: false,
1233
1258
  });
@@ -1235,7 +1260,7 @@ class PosCart {
1235
1260
  if (res_error) {
1236
1261
  Logger({
1237
1262
  level: "WARN",
1238
- message: "Response Validation Warnnings for selectPaymentMode",
1263
+ message: "Response Validation Warnnings for getStoreAddressByUid",
1239
1264
  });
1240
1265
  Logger({ level: "WARN", message: res_error });
1241
1266
  }
@@ -1245,36 +1270,14 @@ class PosCart {
1245
1270
 
1246
1271
  /**
1247
1272
  * @param {Object} arg - Arg object.
1248
- * @param {string} [arg.id] -
1249
- * @param {boolean} [arg.buyNow] -
1250
- * @param {string} [arg.addressId] -
1251
- * @param {string} [arg.paymentMode] -
1252
- * @param {string} [arg.paymentIdentifier] -
1253
- * @param {string} [arg.aggregatorName] -
1254
- * @param {string} [arg.merchantCode] -
1255
- * @returns {Promise<PaymentCouponValidate>} - Success response
1256
- * @summary: Verify the coupon eligibility against the payment mode
1257
- * @description: Use this API to validate a coupon against the payment mode such as NetBanking, Wallet, UPI etc.
1273
+ * @param {string} arg.id - ID allotted to the selected address
1274
+ * @returns {Promise<DeleteAddressResponse>} - Success response
1275
+ * @summary: Remove address associated with an account
1276
+ * @description: Use this API to delete an address by its ID. This will returns an object that will indicate whether the address was deleted successfully or not.
1258
1277
  */
1259
- async validateCouponForPayment({
1260
- id,
1261
- buyNow,
1262
- addressId,
1263
- paymentMode,
1264
- paymentIdentifier,
1265
- aggregatorName,
1266
- merchantCode,
1267
- } = {}) {
1268
- const { error } = PosCartValidator.validateCouponForPayment().validate(
1269
- {
1270
- id,
1271
- buyNow,
1272
- addressId,
1273
- paymentMode,
1274
- paymentIdentifier,
1275
- aggregatorName,
1276
- merchantCode,
1277
- },
1278
+ async removeAddress({ id } = {}) {
1279
+ const { error } = PosCartValidator.removeAddress().validate(
1280
+ { id },
1278
1281
  { abortEarly: false, allowUnknown: true }
1279
1282
  );
1280
1283
  if (error) {
@@ -1282,45 +1285,28 @@ class PosCart {
1282
1285
  }
1283
1286
 
1284
1287
  // Showing warrnings if extra unknown parameters are found
1285
- const {
1286
- error: warrning,
1287
- } = PosCartValidator.validateCouponForPayment().validate(
1288
- {
1289
- id,
1290
- buyNow,
1291
- addressId,
1292
- paymentMode,
1293
- paymentIdentifier,
1294
- aggregatorName,
1295
- merchantCode,
1296
- },
1288
+ const { error: warrning } = PosCartValidator.removeAddress().validate(
1289
+ { id },
1297
1290
  { abortEarly: false, allowUnknown: false }
1298
1291
  );
1299
1292
  if (warrning) {
1300
1293
  Logger({
1301
1294
  level: "WARN",
1302
- message: "Parameter Validation warrnings for validateCouponForPayment",
1295
+ message: "Parameter Validation warrnings for removeAddress",
1303
1296
  });
1304
1297
  Logger({ level: "WARN", message: warrning });
1305
1298
  }
1306
1299
 
1307
1300
  const query_params = {};
1308
- query_params["id"] = id;
1309
- query_params["buy_now"] = buyNow;
1310
- query_params["address_id"] = addressId;
1311
- query_params["payment_mode"] = paymentMode;
1312
- query_params["payment_identifier"] = paymentIdentifier;
1313
- query_params["aggregator_name"] = aggregatorName;
1314
- query_params["merchant_code"] = merchantCode;
1315
1301
 
1316
1302
  const xHeaders = {};
1317
1303
 
1318
1304
  const response = await APIClient.execute(
1319
1305
  this._conf,
1320
- "get",
1306
+ "delete",
1321
1307
  constructUrl({
1322
- url: this._urls["validateCouponForPayment"],
1323
- params: {},
1308
+ url: this._urls["removeAddress"],
1309
+ params: { id },
1324
1310
  }),
1325
1311
  query_params,
1326
1312
  undefined,
@@ -1329,7 +1315,7 @@ class PosCart {
1329
1315
 
1330
1316
  const {
1331
1317
  error: res_error,
1332
- } = PosCartModel.PaymentCouponValidate().validate(response, {
1318
+ } = PosCartModel.DeleteAddressResponse().validate(response, {
1333
1319
  abortEarly: false,
1334
1320
  allowUnknown: false,
1335
1321
  });
@@ -1337,7 +1323,7 @@ class PosCart {
1337
1323
  if (res_error) {
1338
1324
  Logger({
1339
1325
  level: "WARN",
1340
- message: "Response Validation Warnnings for validateCouponForPayment",
1326
+ message: "Response Validation Warnnings for removeAddress",
1341
1327
  });
1342
1328
  Logger({ level: "WARN", message: res_error });
1343
1329
  }
@@ -1347,40 +1333,15 @@ class PosCart {
1347
1333
 
1348
1334
  /**
1349
1335
  * @param {Object} arg - Arg object.
1350
- * @param {number} [arg.pickAtStoreUid] -
1351
- * @param {number} [arg.orderingStoreId] -
1352
- * @param {boolean} [arg.p] - This is a boolean value. Select `true` for
1353
- * getting a payment option in response.
1354
- * @param {string} [arg.id] - The unique identifier of the cart
1355
- * @param {string} [arg.addressId] - ID allotted to the selected address
1356
- * @param {string} [arg.areaCode] - The PIN Code of the destination address,
1357
- * e.g. 400059
1358
- * @param {string} [arg.orderType] - The order type of shipment HomeDelivery
1359
- * - If the customer wants the order home-delivered PickAtStore - If the
1360
- * customer wants the handover of an order at the store itself.
1361
- * @returns {Promise<CartShipmentsResponse>} - Success response
1362
- * @summary: Get delivery date and options before checkout
1363
- * @description: Use this API to get shipment details, expected delivery date, items and price breakup of the shipment.
1336
+ * @param {string} [arg.id] -
1337
+ * @param {boolean} [arg.buyNow] -
1338
+ * @returns {Promise<CartDetailResponse>} - Success response
1339
+ * @summary: Remove Coupon Applied
1340
+ * @description: Remove Coupon applied on the cart by passing uid in request body.
1364
1341
  */
1365
- async getShipments({
1366
- pickAtStoreUid,
1367
- orderingStoreId,
1368
- p,
1369
- id,
1370
- addressId,
1371
- areaCode,
1372
- orderType,
1373
- } = {}) {
1374
- const { error } = PosCartValidator.getShipments().validate(
1375
- {
1376
- pickAtStoreUid,
1377
- orderingStoreId,
1378
- p,
1379
- id,
1380
- addressId,
1381
- areaCode,
1382
- orderType,
1383
- },
1342
+ async removeCoupon({ id, buyNow } = {}) {
1343
+ const { error } = PosCartValidator.removeCoupon().validate(
1344
+ { id, buyNow },
1384
1345
  { abortEarly: false, allowUnknown: true }
1385
1346
  );
1386
1347
  if (error) {
@@ -1388,42 +1349,29 @@ class PosCart {
1388
1349
  }
1389
1350
 
1390
1351
  // Showing warrnings if extra unknown parameters are found
1391
- const { error: warrning } = PosCartValidator.getShipments().validate(
1392
- {
1393
- pickAtStoreUid,
1394
- orderingStoreId,
1395
- p,
1396
- id,
1397
- addressId,
1398
- areaCode,
1399
- orderType,
1400
- },
1352
+ const { error: warrning } = PosCartValidator.removeCoupon().validate(
1353
+ { id, buyNow },
1401
1354
  { abortEarly: false, allowUnknown: false }
1402
1355
  );
1403
1356
  if (warrning) {
1404
1357
  Logger({
1405
1358
  level: "WARN",
1406
- message: "Parameter Validation warrnings for getShipments",
1359
+ message: "Parameter Validation warrnings for removeCoupon",
1407
1360
  });
1408
1361
  Logger({ level: "WARN", message: warrning });
1409
1362
  }
1410
1363
 
1411
1364
  const query_params = {};
1412
- query_params["pick_at_store_uid"] = pickAtStoreUid;
1413
- query_params["ordering_store_id"] = orderingStoreId;
1414
- query_params["p"] = p;
1415
1365
  query_params["id"] = id;
1416
- query_params["address_id"] = addressId;
1417
- query_params["area_code"] = areaCode;
1418
- query_params["order_type"] = orderType;
1366
+ query_params["buy_now"] = buyNow;
1419
1367
 
1420
1368
  const xHeaders = {};
1421
1369
 
1422
1370
  const response = await APIClient.execute(
1423
1371
  this._conf,
1424
- "get",
1372
+ "delete",
1425
1373
  constructUrl({
1426
- url: this._urls["getShipments"],
1374
+ url: this._urls["removeCoupon"],
1427
1375
  params: {},
1428
1376
  }),
1429
1377
  query_params,
@@ -1433,7 +1381,7 @@ class PosCart {
1433
1381
 
1434
1382
  const {
1435
1383
  error: res_error,
1436
- } = PosCartModel.CartShipmentsResponse().validate(response, {
1384
+ } = PosCartModel.CartDetailResponse().validate(response, {
1437
1385
  abortEarly: false,
1438
1386
  allowUnknown: false,
1439
1387
  });
@@ -1441,7 +1389,7 @@ class PosCart {
1441
1389
  if (res_error) {
1442
1390
  Logger({
1443
1391
  level: "WARN",
1444
- message: "Response Validation Warnnings for getShipments",
1392
+ message: "Response Validation Warnnings for removeCoupon",
1445
1393
  });
1446
1394
  Logger({ level: "WARN", message: res_error });
1447
1395
  }
@@ -1451,23 +1399,18 @@ class PosCart {
1451
1399
 
1452
1400
  /**
1453
1401
  * @param {Object} arg - Arg object.
1454
- * @param {boolean} [arg.i] - This is a boolean value. Select `true` to
1455
- * retrieve all the items added in the cart.
1456
- * @param {boolean} [arg.p] - This is a boolean value. Select `true` for
1457
- * getting a payment option in response.
1458
- * @param {string} [arg.id] - The unique identifier of the cart
1459
- * @param {string} [arg.addressId] - ID allotted to an address
1460
- * @param {string} [arg.orderType] - The order type of shipment HomeDelivery
1461
- * - If the customer wants the order home-delivered PickAtStore - If the
1462
- * customer wants the handover of an order at the store itself.
1463
- * @param {UpdateCartShipmentRequest} arg.body
1464
- * @returns {Promise<CartShipmentsResponse>} - Success response
1465
- * @summary: Update shipment delivery type and quantity before checkout
1466
- * @description: Use this API to update the delivery type and quantity as per customer's preference for either store pick-up or home-delivery.
1402
+ * @param {string} [arg.cartId] -
1403
+ * @param {boolean} [arg.buyNow] -
1404
+ * @param {boolean} [arg.i] -
1405
+ * @param {boolean} [arg.b] -
1406
+ * @param {SelectCartAddressRequest} arg.body
1407
+ * @returns {Promise<CartDetailResponse>} - Success response
1408
+ * @summary: Select an address from available addresses
1409
+ * @description: <p>Select Address from all addresses associated with the account in order to ship the cart items to that address, otherwise default address will be selected implicitly. See `SelectCartAddressRequest` in schema of request body for the list of attributes needed to select Address from account. On successful request, this API returns a Cart object. Below address attributes are required. <ul> <li> <font color="monochrome">address_id</font></li> <li> <font color="monochrome">billing_address_id</font></li> <li> <font color="monochrome">uid</font></li> </ul></p>
1467
1410
  */
1468
- async updateShipments({ body, i, p, id, addressId, orderType } = {}) {
1469
- const { error } = PosCartValidator.updateShipments().validate(
1470
- { body, i, p, id, addressId, orderType },
1411
+ async selectAddress({ body, cartId, buyNow, i, b } = {}) {
1412
+ const { error } = PosCartValidator.selectAddress().validate(
1413
+ { body, cartId, buyNow, i, b },
1471
1414
  { abortEarly: false, allowUnknown: true }
1472
1415
  );
1473
1416
  if (error) {
@@ -1475,32 +1418,31 @@ class PosCart {
1475
1418
  }
1476
1419
 
1477
1420
  // Showing warrnings if extra unknown parameters are found
1478
- const { error: warrning } = PosCartValidator.updateShipments().validate(
1479
- { body, i, p, id, addressId, orderType },
1421
+ const { error: warrning } = PosCartValidator.selectAddress().validate(
1422
+ { body, cartId, buyNow, i, b },
1480
1423
  { abortEarly: false, allowUnknown: false }
1481
1424
  );
1482
1425
  if (warrning) {
1483
1426
  Logger({
1484
1427
  level: "WARN",
1485
- message: "Parameter Validation warrnings for updateShipments",
1428
+ message: "Parameter Validation warrnings for selectAddress",
1486
1429
  });
1487
1430
  Logger({ level: "WARN", message: warrning });
1488
1431
  }
1489
1432
 
1490
1433
  const query_params = {};
1434
+ query_params["cart_id"] = cartId;
1435
+ query_params["buy_now"] = buyNow;
1491
1436
  query_params["i"] = i;
1492
- query_params["p"] = p;
1493
- query_params["id"] = id;
1494
- query_params["address_id"] = addressId;
1495
- query_params["order_type"] = orderType;
1437
+ query_params["b"] = b;
1496
1438
 
1497
1439
  const xHeaders = {};
1498
1440
 
1499
1441
  const response = await APIClient.execute(
1500
1442
  this._conf,
1501
- "put",
1443
+ "post",
1502
1444
  constructUrl({
1503
- url: this._urls["updateShipments"],
1445
+ url: this._urls["selectAddress"],
1504
1446
  params: {},
1505
1447
  }),
1506
1448
  query_params,
@@ -1510,7 +1452,7 @@ class PosCart {
1510
1452
 
1511
1453
  const {
1512
1454
  error: res_error,
1513
- } = PosCartModel.CartShipmentsResponse().validate(response, {
1455
+ } = PosCartModel.CartDetailResponse().validate(response, {
1514
1456
  abortEarly: false,
1515
1457
  allowUnknown: false,
1516
1458
  });
@@ -1518,7 +1460,7 @@ class PosCart {
1518
1460
  if (res_error) {
1519
1461
  Logger({
1520
1462
  level: "WARN",
1521
- message: "Response Validation Warnnings for updateShipments",
1463
+ message: "Response Validation Warnnings for selectAddress",
1522
1464
  });
1523
1465
  Logger({ level: "WARN", message: res_error });
1524
1466
  }
@@ -1529,14 +1471,15 @@ class PosCart {
1529
1471
  /**
1530
1472
  * @param {Object} arg - Arg object.
1531
1473
  * @param {string} [arg.id] -
1532
- * @param {CartPosCheckoutDetailRequest} arg.body
1533
- * @returns {Promise<CartCheckoutResponse>} - Success response
1534
- * @summary: Checkout all items in the cart
1535
- * @description: Use this API to checkout all items in the cart for payment and order generation. For COD, order will be generated directly, whereas for other checkout modes, user will be redirected to a payment gateway.
1474
+ * @param {boolean} [arg.buyNow] -
1475
+ * @param {UpdateCartPaymentRequest} arg.body
1476
+ * @returns {Promise<CartDetailResponse>} - Success response
1477
+ * @summary: Update cart payment
1478
+ * @description: Use this API to update cart payment.
1536
1479
  */
1537
- async checkoutCart({ body, id } = {}) {
1538
- const { error } = PosCartValidator.checkoutCart().validate(
1539
- { body, id },
1480
+ async selectPaymentMode({ body, id, buyNow } = {}) {
1481
+ const { error } = PosCartValidator.selectPaymentMode().validate(
1482
+ { body, id, buyNow },
1540
1483
  { abortEarly: false, allowUnknown: true }
1541
1484
  );
1542
1485
  if (error) {
@@ -1544,28 +1487,29 @@ class PosCart {
1544
1487
  }
1545
1488
 
1546
1489
  // Showing warrnings if extra unknown parameters are found
1547
- const { error: warrning } = PosCartValidator.checkoutCart().validate(
1548
- { body, id },
1490
+ const { error: warrning } = PosCartValidator.selectPaymentMode().validate(
1491
+ { body, id, buyNow },
1549
1492
  { abortEarly: false, allowUnknown: false }
1550
1493
  );
1551
1494
  if (warrning) {
1552
1495
  Logger({
1553
1496
  level: "WARN",
1554
- message: "Parameter Validation warrnings for checkoutCart",
1497
+ message: "Parameter Validation warrnings for selectPaymentMode",
1555
1498
  });
1556
1499
  Logger({ level: "WARN", message: warrning });
1557
1500
  }
1558
1501
 
1559
1502
  const query_params = {};
1560
1503
  query_params["id"] = id;
1504
+ query_params["buy_now"] = buyNow;
1561
1505
 
1562
1506
  const xHeaders = {};
1563
1507
 
1564
1508
  const response = await APIClient.execute(
1565
1509
  this._conf,
1566
- "post",
1510
+ "put",
1567
1511
  constructUrl({
1568
- url: this._urls["checkoutCart"],
1512
+ url: this._urls["selectPaymentMode"],
1569
1513
  params: {},
1570
1514
  }),
1571
1515
  query_params,
@@ -1575,7 +1519,7 @@ class PosCart {
1575
1519
 
1576
1520
  const {
1577
1521
  error: res_error,
1578
- } = PosCartModel.CartCheckoutResponse().validate(response, {
1522
+ } = PosCartModel.CartDetailResponse().validate(response, {
1579
1523
  abortEarly: false,
1580
1524
  allowUnknown: false,
1581
1525
  });
@@ -1583,7 +1527,7 @@ class PosCart {
1583
1527
  if (res_error) {
1584
1528
  Logger({
1585
1529
  level: "WARN",
1586
- message: "Response Validation Warnnings for checkoutCart",
1530
+ message: "Response Validation Warnnings for selectPaymentMode",
1587
1531
  });
1588
1532
  Logger({ level: "WARN", message: res_error });
1589
1533
  }
@@ -1591,18 +1535,17 @@ class PosCart {
1591
1535
  return response;
1592
1536
  }
1593
1537
 
1594
- /**
1595
- * @param {Object} arg - Arg object.
1596
- * @param {string} [arg.id] -
1597
- * @param {boolean} [arg.buyNow] -
1598
- * @param {CartMetaRequest} arg.body
1599
- * @returns {Promise<CartMetaResponse>} - Success response
1600
- * @summary: Update the cart meta
1601
- * @description: Use this API to update cart meta like checkout_mode and gstin.
1538
+ /**
1539
+ * @param {Object} arg - Arg object.
1540
+ * @param {string} arg.id - ID allotted to the selected address
1541
+ * @param {Address} arg.body
1542
+ * @returns {Promise<UpdateAddressResponse>} - Success response
1543
+ * @summary: Update address added to an account
1544
+ * @description: <p>Use this API to update an existing address in the account. Request object should contain attributes mentioned in <font color="blue">Address </font> can be updated. These attributes are:</p> <ul> <li> <font color="monochrome">is_default_address</font></li> <li> <font color="monochrome">landmark</font></li> <li> <font color="monochrome">area</font></li> <li> <font color="monochrome">pincode</font></li> <li> <font color="monochrome">email</font></li> <li> <font color="monochrome">address_type</font></li> <li> <font color="monochrome">name</font></li> <li> <font color="monochrome">address_id</font></li> <li> <font color="monochrome">address</font></li> </ul>
1602
1545
  */
1603
- async updateCartMeta({ body, id, buyNow } = {}) {
1604
- const { error } = PosCartValidator.updateCartMeta().validate(
1605
- { body, id, buyNow },
1546
+ async updateAddress({ id, body } = {}) {
1547
+ const { error } = PosCartValidator.updateAddress().validate(
1548
+ { id, body },
1606
1549
  { abortEarly: false, allowUnknown: true }
1607
1550
  );
1608
1551
  if (error) {
@@ -1610,21 +1553,19 @@ class PosCart {
1610
1553
  }
1611
1554
 
1612
1555
  // Showing warrnings if extra unknown parameters are found
1613
- const { error: warrning } = PosCartValidator.updateCartMeta().validate(
1614
- { body, id, buyNow },
1556
+ const { error: warrning } = PosCartValidator.updateAddress().validate(
1557
+ { id, body },
1615
1558
  { abortEarly: false, allowUnknown: false }
1616
1559
  );
1617
1560
  if (warrning) {
1618
1561
  Logger({
1619
1562
  level: "WARN",
1620
- message: "Parameter Validation warrnings for updateCartMeta",
1563
+ message: "Parameter Validation warrnings for updateAddress",
1621
1564
  });
1622
1565
  Logger({ level: "WARN", message: warrning });
1623
1566
  }
1624
1567
 
1625
1568
  const query_params = {};
1626
- query_params["id"] = id;
1627
- query_params["buy_now"] = buyNow;
1628
1569
 
1629
1570
  const xHeaders = {};
1630
1571
 
@@ -1632,8 +1573,8 @@ class PosCart {
1632
1573
  this._conf,
1633
1574
  "put",
1634
1575
  constructUrl({
1635
- url: this._urls["updateCartMeta"],
1636
- params: {},
1576
+ url: this._urls["updateAddress"],
1577
+ params: { id },
1637
1578
  }),
1638
1579
  query_params,
1639
1580
  body,
@@ -1642,7 +1583,7 @@ class PosCart {
1642
1583
 
1643
1584
  const {
1644
1585
  error: res_error,
1645
- } = PosCartModel.CartMetaResponse().validate(response, {
1586
+ } = PosCartModel.UpdateAddressResponse().validate(response, {
1646
1587
  abortEarly: false,
1647
1588
  allowUnknown: false,
1648
1589
  });
@@ -1650,7 +1591,7 @@ class PosCart {
1650
1591
  if (res_error) {
1651
1592
  Logger({
1652
1593
  level: "WARN",
1653
- message: "Response Validation Warnnings for updateCartMeta",
1594
+ message: "Response Validation Warnnings for updateAddress",
1654
1595
  });
1655
1596
  Logger({ level: "WARN", message: res_error });
1656
1597
  }
@@ -1660,15 +1601,19 @@ class PosCart {
1660
1601
 
1661
1602
  /**
1662
1603
  * @param {Object} arg - Arg object.
1663
- * @param {string} arg.areaCode -
1664
1604
  * @param {string} [arg.id] -
1665
- * @returns {Promise<CartDeliveryModesResponse>} - Success response
1666
- * @summary: Get available delivery modes for cart
1667
- * @description: Use this API to get the delivery modes (home-delivery/store-pickup) along with a list of pickup stores available for a given cart at a given PIN Code. User can then view the address of a pickup store with the help of store-address API.
1605
+ * @param {boolean} [arg.i] -
1606
+ * @param {boolean} [arg.b] -
1607
+ * @param {string} [arg.areaCode] -
1608
+ * @param {boolean} [arg.buyNow] -
1609
+ * @param {UpdateCartRequest} arg.body
1610
+ * @returns {Promise<UpdateCartDetailResponse>} - Success response
1611
+ * @summary: Update items in the cart
1612
+ * @description: <p>Use this API to update items added to the cart with the help of a request object containing attributes like item_quantity and item_size. These attributes will be fetched from the following APIs</p> <ul> <li><font color="monochrome">operation</font> Operation for current api call. <b>update_item</b> for update items. <b>remove_item</b> for removing items.</li> <li> <font color="monochrome">item_id</font> "/platform/content/v1/products/"</li> <li> <font color="monochrome">item_size</font> "/platform/content/v1/products/:slug/sizes/"</li> <li> <font color="monochrome">quantity</font> item quantity (must be greater than or equal to 1)</li> <li> <font color="monochrome">article_id</font> "/content​/v1​/products​/:identifier​/sizes​/price​/"</li> <li> <font color="monochrome">item_index</font> item position in the cart (must be greater than or equal to 0)</li> </ul>
1668
1613
  */
1669
- async getAvailableDeliveryModes({ areaCode, id } = {}) {
1670
- const { error } = PosCartValidator.getAvailableDeliveryModes().validate(
1671
- { areaCode, id },
1614
+ async updateCart({ body, id, i, b, areaCode, buyNow } = {}) {
1615
+ const { error } = PosCartValidator.updateCart().validate(
1616
+ { body, id, i, b, areaCode, buyNow },
1672
1617
  { abortEarly: false, allowUnknown: true }
1673
1618
  );
1674
1619
  if (error) {
@@ -1676,41 +1621,42 @@ class PosCart {
1676
1621
  }
1677
1622
 
1678
1623
  // Showing warrnings if extra unknown parameters are found
1679
- const {
1680
- error: warrning,
1681
- } = PosCartValidator.getAvailableDeliveryModes().validate(
1682
- { areaCode, id },
1624
+ const { error: warrning } = PosCartValidator.updateCart().validate(
1625
+ { body, id, i, b, areaCode, buyNow },
1683
1626
  { abortEarly: false, allowUnknown: false }
1684
1627
  );
1685
1628
  if (warrning) {
1686
1629
  Logger({
1687
1630
  level: "WARN",
1688
- message: "Parameter Validation warrnings for getAvailableDeliveryModes",
1631
+ message: "Parameter Validation warrnings for updateCart",
1689
1632
  });
1690
1633
  Logger({ level: "WARN", message: warrning });
1691
1634
  }
1692
1635
 
1693
1636
  const query_params = {};
1694
- query_params["area_code"] = areaCode;
1695
1637
  query_params["id"] = id;
1638
+ query_params["i"] = i;
1639
+ query_params["b"] = b;
1640
+ query_params["area_code"] = areaCode;
1641
+ query_params["buy_now"] = buyNow;
1696
1642
 
1697
1643
  const xHeaders = {};
1698
1644
 
1699
1645
  const response = await APIClient.execute(
1700
1646
  this._conf,
1701
- "get",
1647
+ "put",
1702
1648
  constructUrl({
1703
- url: this._urls["getAvailableDeliveryModes"],
1649
+ url: this._urls["updateCart"],
1704
1650
  params: {},
1705
1651
  }),
1706
1652
  query_params,
1707
- undefined,
1653
+ body,
1708
1654
  xHeaders
1709
1655
  );
1710
1656
 
1711
1657
  const {
1712
1658
  error: res_error,
1713
- } = PosCartModel.CartDeliveryModesResponse().validate(response, {
1659
+ } = PosCartModel.UpdateCartDetailResponse().validate(response, {
1714
1660
  abortEarly: false,
1715
1661
  allowUnknown: false,
1716
1662
  });
@@ -1718,7 +1664,7 @@ class PosCart {
1718
1664
  if (res_error) {
1719
1665
  Logger({
1720
1666
  level: "WARN",
1721
- message: "Response Validation Warnnings for getAvailableDeliveryModes",
1667
+ message: "Response Validation Warnnings for updateCart",
1722
1668
  });
1723
1669
  Logger({ level: "WARN", message: res_error });
1724
1670
  }
@@ -1728,14 +1674,16 @@ class PosCart {
1728
1674
 
1729
1675
  /**
1730
1676
  * @param {Object} arg - Arg object.
1731
- * @param {number} arg.storeUid -
1732
- * @returns {Promise<StoreDetailsResponse>} - Success response
1733
- * @summary: Get list of stores for give uids
1734
- * @description: Use this API to get the store details by entering the unique identifier of the pickup stores shown in the response of available-delivery-mode API.
1677
+ * @param {string} [arg.id] -
1678
+ * @param {boolean} [arg.buyNow] -
1679
+ * @param {CartMetaRequest} arg.body
1680
+ * @returns {Promise<CartMetaResponse>} - Success response
1681
+ * @summary: Update the cart meta
1682
+ * @description: Use this API to update cart meta like checkout_mode and gstin.
1735
1683
  */
1736
- async getStoreAddressByUid({ storeUid } = {}) {
1737
- const { error } = PosCartValidator.getStoreAddressByUid().validate(
1738
- { storeUid },
1684
+ async updateCartMeta({ body, id, buyNow } = {}) {
1685
+ const { error } = PosCartValidator.updateCartMeta().validate(
1686
+ { body, id, buyNow },
1739
1687
  { abortEarly: false, allowUnknown: true }
1740
1688
  );
1741
1689
  if (error) {
@@ -1743,40 +1691,39 @@ class PosCart {
1743
1691
  }
1744
1692
 
1745
1693
  // Showing warrnings if extra unknown parameters are found
1746
- const {
1747
- error: warrning,
1748
- } = PosCartValidator.getStoreAddressByUid().validate(
1749
- { storeUid },
1694
+ const { error: warrning } = PosCartValidator.updateCartMeta().validate(
1695
+ { body, id, buyNow },
1750
1696
  { abortEarly: false, allowUnknown: false }
1751
1697
  );
1752
1698
  if (warrning) {
1753
1699
  Logger({
1754
1700
  level: "WARN",
1755
- message: "Parameter Validation warrnings for getStoreAddressByUid",
1701
+ message: "Parameter Validation warrnings for updateCartMeta",
1756
1702
  });
1757
1703
  Logger({ level: "WARN", message: warrning });
1758
1704
  }
1759
1705
 
1760
1706
  const query_params = {};
1761
- query_params["store_uid"] = storeUid;
1707
+ query_params["id"] = id;
1708
+ query_params["buy_now"] = buyNow;
1762
1709
 
1763
1710
  const xHeaders = {};
1764
1711
 
1765
1712
  const response = await APIClient.execute(
1766
1713
  this._conf,
1767
- "get",
1714
+ "put",
1768
1715
  constructUrl({
1769
- url: this._urls["getStoreAddressByUid"],
1716
+ url: this._urls["updateCartMeta"],
1770
1717
  params: {},
1771
1718
  }),
1772
1719
  query_params,
1773
- undefined,
1720
+ body,
1774
1721
  xHeaders
1775
1722
  );
1776
1723
 
1777
1724
  const {
1778
1725
  error: res_error,
1779
- } = PosCartModel.StoreDetailsResponse().validate(response, {
1726
+ } = PosCartModel.CartMetaResponse().validate(response, {
1780
1727
  abortEarly: false,
1781
1728
  allowUnknown: false,
1782
1729
  });
@@ -1784,7 +1731,7 @@ class PosCart {
1784
1731
  if (res_error) {
1785
1732
  Logger({
1786
1733
  level: "WARN",
1787
- message: "Response Validation Warnnings for getStoreAddressByUid",
1734
+ message: "Response Validation Warnnings for updateCartMeta",
1788
1735
  });
1789
1736
  Logger({ level: "WARN", message: res_error });
1790
1737
  }
@@ -1794,14 +1741,16 @@ class PosCart {
1794
1741
 
1795
1742
  /**
1796
1743
  * @param {Object} arg - Arg object.
1797
- * @param {GetShareCartLinkRequest} arg.body
1798
- * @returns {Promise<GetShareCartLinkResponse>} - Success response
1799
- * @summary: Generate token for sharing the cart
1800
- * @description: Use this API to generate a shared cart snapshot and return a shortlink token. The link can be shared with other users for getting the same items in their cart.
1744
+ * @param {string} arg.token - Token of the shared short link
1745
+ * @param {string} arg.action - Operation to perform on the existing cart
1746
+ * merge or replace.
1747
+ * @returns {Promise<SharedCartResponse>} - Success response
1748
+ * @summary: Merge or replace existing cart
1749
+ * @description: Use this API to merge the shared cart with existing cart, or replace the existing cart with the shared cart. The `action` parameter is used to indicate the operation Merge or Replace.
1801
1750
  */
1802
- async getCartShareLink({ body } = {}) {
1803
- const { error } = PosCartValidator.getCartShareLink().validate(
1804
- { body },
1751
+ async updateCartWithSharedItems({ token, action } = {}) {
1752
+ const { error } = PosCartValidator.updateCartWithSharedItems().validate(
1753
+ { token, action },
1805
1754
  { abortEarly: false, allowUnknown: true }
1806
1755
  );
1807
1756
  if (error) {
@@ -1809,14 +1758,16 @@ class PosCart {
1809
1758
  }
1810
1759
 
1811
1760
  // Showing warrnings if extra unknown parameters are found
1812
- const { error: warrning } = PosCartValidator.getCartShareLink().validate(
1813
- { body },
1761
+ const {
1762
+ error: warrning,
1763
+ } = PosCartValidator.updateCartWithSharedItems().validate(
1764
+ { token, action },
1814
1765
  { abortEarly: false, allowUnknown: false }
1815
1766
  );
1816
1767
  if (warrning) {
1817
1768
  Logger({
1818
1769
  level: "WARN",
1819
- message: "Parameter Validation warrnings for getCartShareLink",
1770
+ message: "Parameter Validation warrnings for updateCartWithSharedItems",
1820
1771
  });
1821
1772
  Logger({ level: "WARN", message: warrning });
1822
1773
  }
@@ -1829,17 +1780,17 @@ class PosCart {
1829
1780
  this._conf,
1830
1781
  "post",
1831
1782
  constructUrl({
1832
- url: this._urls["getCartShareLink"],
1833
- params: {},
1783
+ url: this._urls["updateCartWithSharedItems"],
1784
+ params: { token, action },
1834
1785
  }),
1835
1786
  query_params,
1836
- body,
1787
+ undefined,
1837
1788
  xHeaders
1838
1789
  );
1839
1790
 
1840
1791
  const {
1841
1792
  error: res_error,
1842
- } = PosCartModel.GetShareCartLinkResponse().validate(response, {
1793
+ } = PosCartModel.SharedCartResponse().validate(response, {
1843
1794
  abortEarly: false,
1844
1795
  allowUnknown: false,
1845
1796
  });
@@ -1847,7 +1798,7 @@ class PosCart {
1847
1798
  if (res_error) {
1848
1799
  Logger({
1849
1800
  level: "WARN",
1850
- message: "Response Validation Warnnings for getCartShareLink",
1801
+ message: "Response Validation Warnnings for updateCartWithSharedItems",
1851
1802
  });
1852
1803
  Logger({ level: "WARN", message: res_error });
1853
1804
  }
@@ -1857,14 +1808,23 @@ class PosCart {
1857
1808
 
1858
1809
  /**
1859
1810
  * @param {Object} arg - Arg object.
1860
- * @param {string} arg.token - Token of the shared short link
1861
- * @returns {Promise<SharedCartResponse>} - Success response
1862
- * @summary: Get details of a shared cart
1863
- * @description: Use this API to get the shared cart details as per the token generated using the share-cart API.
1811
+ * @param {boolean} [arg.i] - This is a boolean value. Select `true` to
1812
+ * retrieve all the items added in the cart.
1813
+ * @param {boolean} [arg.p] - This is a boolean value. Select `true` for
1814
+ * getting a payment option in response.
1815
+ * @param {string} [arg.id] - The unique identifier of the cart
1816
+ * @param {string} [arg.addressId] - ID allotted to an address
1817
+ * @param {string} [arg.orderType] - The order type of shipment HomeDelivery
1818
+ * - If the customer wants the order home-delivered PickAtStore - If the
1819
+ * customer wants the handover of an order at the store itself.
1820
+ * @param {UpdateCartShipmentRequest} arg.body
1821
+ * @returns {Promise<CartShipmentsResponse>} - Success response
1822
+ * @summary: Update shipment delivery type and quantity before checkout
1823
+ * @description: Use this API to update the delivery type and quantity as per customer's preference for either store pick-up or home-delivery.
1864
1824
  */
1865
- async getCartSharedItems({ token } = {}) {
1866
- const { error } = PosCartValidator.getCartSharedItems().validate(
1867
- { token },
1825
+ async updateShipments({ body, i, p, id, addressId, orderType } = {}) {
1826
+ const { error } = PosCartValidator.updateShipments().validate(
1827
+ { body, i, p, id, addressId, orderType },
1868
1828
  { abortEarly: false, allowUnknown: true }
1869
1829
  );
1870
1830
  if (error) {
@@ -1872,37 +1832,42 @@ class PosCart {
1872
1832
  }
1873
1833
 
1874
1834
  // Showing warrnings if extra unknown parameters are found
1875
- const { error: warrning } = PosCartValidator.getCartSharedItems().validate(
1876
- { token },
1835
+ const { error: warrning } = PosCartValidator.updateShipments().validate(
1836
+ { body, i, p, id, addressId, orderType },
1877
1837
  { abortEarly: false, allowUnknown: false }
1878
1838
  );
1879
1839
  if (warrning) {
1880
1840
  Logger({
1881
1841
  level: "WARN",
1882
- message: "Parameter Validation warrnings for getCartSharedItems",
1842
+ message: "Parameter Validation warrnings for updateShipments",
1883
1843
  });
1884
1844
  Logger({ level: "WARN", message: warrning });
1885
1845
  }
1886
1846
 
1887
1847
  const query_params = {};
1848
+ query_params["i"] = i;
1849
+ query_params["p"] = p;
1850
+ query_params["id"] = id;
1851
+ query_params["address_id"] = addressId;
1852
+ query_params["order_type"] = orderType;
1888
1853
 
1889
1854
  const xHeaders = {};
1890
1855
 
1891
1856
  const response = await APIClient.execute(
1892
1857
  this._conf,
1893
- "get",
1858
+ "put",
1894
1859
  constructUrl({
1895
- url: this._urls["getCartSharedItems"],
1896
- params: { token },
1860
+ url: this._urls["updateShipments"],
1861
+ params: {},
1897
1862
  }),
1898
1863
  query_params,
1899
- undefined,
1864
+ body,
1900
1865
  xHeaders
1901
1866
  );
1902
1867
 
1903
1868
  const {
1904
1869
  error: res_error,
1905
- } = PosCartModel.SharedCartResponse().validate(response, {
1870
+ } = PosCartModel.CartShipmentsResponse().validate(response, {
1906
1871
  abortEarly: false,
1907
1872
  allowUnknown: false,
1908
1873
  });
@@ -1910,7 +1875,7 @@ class PosCart {
1910
1875
  if (res_error) {
1911
1876
  Logger({
1912
1877
  level: "WARN",
1913
- message: "Response Validation Warnnings for getCartSharedItems",
1878
+ message: "Response Validation Warnnings for updateShipments",
1914
1879
  });
1915
1880
  Logger({ level: "WARN", message: res_error });
1916
1881
  }
@@ -1920,16 +1885,36 @@ class PosCart {
1920
1885
 
1921
1886
  /**
1922
1887
  * @param {Object} arg - Arg object.
1923
- * @param {string} arg.token - Token of the shared short link
1924
- * @param {string} arg.action - Operation to perform on the existing cart
1925
- * merge or replace.
1926
- * @returns {Promise<SharedCartResponse>} - Success response
1927
- * @summary: Merge or replace existing cart
1928
- * @description: Use this API to merge the shared cart with existing cart, or replace the existing cart with the shared cart. The `action` parameter is used to indicate the operation Merge or Replace.
1888
+ * @param {string} [arg.id] -
1889
+ * @param {boolean} [arg.buyNow] -
1890
+ * @param {string} [arg.addressId] -
1891
+ * @param {string} [arg.paymentMode] -
1892
+ * @param {string} [arg.paymentIdentifier] -
1893
+ * @param {string} [arg.aggregatorName] -
1894
+ * @param {string} [arg.merchantCode] -
1895
+ * @returns {Promise<PaymentCouponValidate>} - Success response
1896
+ * @summary: Verify the coupon eligibility against the payment mode
1897
+ * @description: Use this API to validate a coupon against the payment mode such as NetBanking, Wallet, UPI etc.
1929
1898
  */
1930
- async updateCartWithSharedItems({ token, action } = {}) {
1931
- const { error } = PosCartValidator.updateCartWithSharedItems().validate(
1932
- { token, action },
1899
+ async validateCouponForPayment({
1900
+ id,
1901
+ buyNow,
1902
+ addressId,
1903
+ paymentMode,
1904
+ paymentIdentifier,
1905
+ aggregatorName,
1906
+ merchantCode,
1907
+ } = {}) {
1908
+ const { error } = PosCartValidator.validateCouponForPayment().validate(
1909
+ {
1910
+ id,
1911
+ buyNow,
1912
+ addressId,
1913
+ paymentMode,
1914
+ paymentIdentifier,
1915
+ aggregatorName,
1916
+ merchantCode,
1917
+ },
1933
1918
  { abortEarly: false, allowUnknown: true }
1934
1919
  );
1935
1920
  if (error) {
@@ -1939,28 +1924,43 @@ class PosCart {
1939
1924
  // Showing warrnings if extra unknown parameters are found
1940
1925
  const {
1941
1926
  error: warrning,
1942
- } = PosCartValidator.updateCartWithSharedItems().validate(
1943
- { token, action },
1927
+ } = PosCartValidator.validateCouponForPayment().validate(
1928
+ {
1929
+ id,
1930
+ buyNow,
1931
+ addressId,
1932
+ paymentMode,
1933
+ paymentIdentifier,
1934
+ aggregatorName,
1935
+ merchantCode,
1936
+ },
1944
1937
  { abortEarly: false, allowUnknown: false }
1945
1938
  );
1946
1939
  if (warrning) {
1947
1940
  Logger({
1948
1941
  level: "WARN",
1949
- message: "Parameter Validation warrnings for updateCartWithSharedItems",
1942
+ message: "Parameter Validation warrnings for validateCouponForPayment",
1950
1943
  });
1951
1944
  Logger({ level: "WARN", message: warrning });
1952
1945
  }
1953
1946
 
1954
1947
  const query_params = {};
1948
+ query_params["id"] = id;
1949
+ query_params["buy_now"] = buyNow;
1950
+ query_params["address_id"] = addressId;
1951
+ query_params["payment_mode"] = paymentMode;
1952
+ query_params["payment_identifier"] = paymentIdentifier;
1953
+ query_params["aggregator_name"] = aggregatorName;
1954
+ query_params["merchant_code"] = merchantCode;
1955
1955
 
1956
1956
  const xHeaders = {};
1957
1957
 
1958
1958
  const response = await APIClient.execute(
1959
1959
  this._conf,
1960
- "post",
1960
+ "get",
1961
1961
  constructUrl({
1962
- url: this._urls["updateCartWithSharedItems"],
1963
- params: { token, action },
1962
+ url: this._urls["validateCouponForPayment"],
1963
+ params: {},
1964
1964
  }),
1965
1965
  query_params,
1966
1966
  undefined,
@@ -1969,7 +1969,7 @@ class PosCart {
1969
1969
 
1970
1970
  const {
1971
1971
  error: res_error,
1972
- } = PosCartModel.SharedCartResponse().validate(response, {
1972
+ } = PosCartModel.PaymentCouponValidate().validate(response, {
1973
1973
  abortEarly: false,
1974
1974
  allowUnknown: false,
1975
1975
  });
@@ -1977,7 +1977,7 @@ class PosCart {
1977
1977
  if (res_error) {
1978
1978
  Logger({
1979
1979
  level: "WARN",
1980
- message: "Response Validation Warnnings for updateCartWithSharedItems",
1980
+ message: "Response Validation Warnnings for validateCouponForPayment",
1981
1981
  });
1982
1982
  Logger({ level: "WARN", message: res_error });
1983
1983
  }