@gofynd/fdk-client-javascript 1.4.7 → 1.4.8-beta.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 (123) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/sdk/application/Cart/CartApplicationClient.d.ts +16 -3
  4. package/sdk/application/Cart/CartApplicationClient.js +118 -13
  5. package/sdk/application/Cart/CartApplicationModel.d.ts +121 -45
  6. package/sdk/application/Cart/CartApplicationModel.js +98 -26
  7. package/sdk/application/Cart/CartApplicationValidator.d.ts +45 -1
  8. package/sdk/application/Cart/CartApplicationValidator.js +26 -0
  9. package/sdk/application/Catalog/CatalogApplicationModel.d.ts +4 -2
  10. package/sdk/application/Catalog/CatalogApplicationModel.js +4 -2
  11. package/sdk/application/Content/ContentApplicationClient.d.ts +1 -1
  12. package/sdk/application/Content/ContentApplicationClient.js +5 -3
  13. package/sdk/application/Content/ContentApplicationModel.d.ts +7 -18
  14. package/sdk/application/Content/ContentApplicationModel.js +6 -20
  15. package/sdk/application/Content/ContentApplicationValidator.d.ts +10 -0
  16. package/sdk/application/Content/ContentApplicationValidator.js +4 -0
  17. package/sdk/application/Lead/LeadApplicationClient.d.ts +0 -27
  18. package/sdk/application/Lead/LeadApplicationClient.js +0 -167
  19. package/sdk/application/Lead/LeadApplicationModel.d.ts +1 -146
  20. package/sdk/application/Lead/LeadApplicationModel.js +0 -126
  21. package/sdk/application/Lead/LeadApplicationValidator.d.ts +1 -25
  22. package/sdk/application/Lead/LeadApplicationValidator.js +0 -24
  23. package/sdk/application/Logistic/LogisticApplicationClient.js +1 -1
  24. package/sdk/application/Logistic/LogisticApplicationModel.d.ts +2 -0
  25. package/sdk/application/Logistic/LogisticApplicationModel.js +2 -0
  26. package/sdk/application/Order/OrderApplicationModel.d.ts +4 -0
  27. package/sdk/application/Order/OrderApplicationModel.js +4 -0
  28. package/sdk/application/Payment/PaymentApplicationModel.d.ts +9 -2
  29. package/sdk/application/Payment/PaymentApplicationModel.js +5 -2
  30. package/sdk/application/Theme/ThemeApplicationModel.d.ts +2 -0
  31. package/sdk/application/Theme/ThemeApplicationModel.js +2 -0
  32. package/sdk/partner/Lead/LeadPartnerClient.d.ts +0 -23
  33. package/sdk/partner/Lead/LeadPartnerClient.js +0 -157
  34. package/sdk/partner/Lead/LeadPartnerModel.d.ts +12 -581
  35. package/sdk/partner/Lead/LeadPartnerModel.js +14 -403
  36. package/sdk/partner/Lead/LeadPartnerValidator.d.ts +0 -2
  37. package/sdk/partner/Lead/LeadPartnerValidator.js +0 -12
  38. package/sdk/partner/Logistics/LogisticsPartnerClient.js +1 -1
  39. package/sdk/partner/Logistics/LogisticsPartnerModel.d.ts +47 -1
  40. package/sdk/partner/Logistics/LogisticsPartnerModel.js +56 -4
  41. package/sdk/partner/Logistics/LogisticsPartnerValidator.js +2 -2
  42. package/sdk/partner/Theme/ThemePartnerClient.d.ts +22 -0
  43. package/sdk/partner/Theme/ThemePartnerClient.js +162 -0
  44. package/sdk/partner/Theme/ThemePartnerModel.d.ts +119 -1
  45. package/sdk/partner/Theme/ThemePartnerModel.js +142 -0
  46. package/sdk/partner/Theme/ThemePartnerValidator.d.ts +2 -0
  47. package/sdk/partner/Theme/ThemePartnerValidator.js +14 -0
  48. package/sdk/platform/Billing/BillingPlatformClient.d.ts +304 -43
  49. package/sdk/platform/Billing/BillingPlatformClient.js +2218 -118
  50. package/sdk/platform/Billing/BillingPlatformModel.d.ts +1330 -282
  51. package/sdk/platform/Billing/BillingPlatformModel.js +1808 -590
  52. package/sdk/platform/Billing/BillingPlatformValidator.d.ts +324 -16
  53. package/sdk/platform/Billing/BillingPlatformValidator.js +340 -12
  54. package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +28 -5
  55. package/sdk/platform/Cart/CartPlatformApplicationClient.js +198 -5
  56. package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +81 -1
  57. package/sdk/platform/Cart/CartPlatformApplicationValidator.js +48 -0
  58. package/sdk/platform/Cart/CartPlatformModel.d.ts +214 -40
  59. package/sdk/platform/Cart/CartPlatformModel.js +164 -24
  60. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +1 -1
  61. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +20 -0
  62. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +37 -0
  63. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +16 -0
  64. package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +2 -2
  65. package/sdk/platform/Catalog/CatalogPlatformClient.js +18 -2
  66. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +4 -0
  67. package/sdk/platform/Catalog/CatalogPlatformModel.js +4 -0
  68. package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +28 -0
  69. package/sdk/platform/Catalog/CatalogPlatformValidator.js +12 -0
  70. package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +1 -1
  71. package/sdk/platform/Content/ContentPlatformApplicationClient.js +18 -1
  72. package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +25 -0
  73. package/sdk/platform/Content/ContentPlatformApplicationValidator.js +10 -0
  74. package/sdk/platform/Content/ContentPlatformModel.d.ts +8 -4
  75. package/sdk/platform/Content/ContentPlatformModel.js +8 -4
  76. package/sdk/platform/Finance/FinancePlatformClient.d.ts +49 -28
  77. package/sdk/platform/Finance/FinancePlatformClient.js +181 -28
  78. package/sdk/platform/Finance/FinancePlatformModel.d.ts +369 -129
  79. package/sdk/platform/Finance/FinancePlatformModel.js +404 -110
  80. package/sdk/platform/Finance/FinancePlatformValidator.d.ts +56 -43
  81. package/sdk/platform/Finance/FinancePlatformValidator.js +61 -42
  82. package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +0 -47
  83. package/sdk/platform/Lead/LeadPlatformApplicationClient.js +0 -321
  84. package/sdk/platform/Lead/LeadPlatformApplicationValidator.d.ts +1 -46
  85. package/sdk/platform/Lead/LeadPlatformApplicationValidator.js +0 -48
  86. package/sdk/platform/Lead/LeadPlatformClient.d.ts +2 -25
  87. package/sdk/platform/Lead/LeadPlatformClient.js +2 -167
  88. package/sdk/platform/Lead/LeadPlatformModel.d.ts +82 -204
  89. package/sdk/platform/Lead/LeadPlatformModel.js +98 -178
  90. package/sdk/platform/Lead/LeadPlatformValidator.d.ts +1 -25
  91. package/sdk/platform/Lead/LeadPlatformValidator.js +0 -24
  92. package/sdk/platform/Order/OrderPlatformModel.d.ts +126 -15
  93. package/sdk/platform/Order/OrderPlatformModel.js +55 -14
  94. package/sdk/platform/Payment/PaymentPlatformModel.d.ts +12 -0
  95. package/sdk/platform/Payment/PaymentPlatformModel.js +5 -0
  96. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +1 -1
  97. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +4 -4
  98. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +20 -1
  99. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +26 -4
  100. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +4 -4
  101. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +4 -4
  102. package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +12 -0
  103. package/sdk/platform/Theme/ThemePlatformApplicationClient.js +82 -0
  104. package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +18 -1
  105. package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +14 -0
  106. package/sdk/platform/Theme/ThemePlatformModel.d.ts +67 -1
  107. package/sdk/platform/Theme/ThemePlatformModel.js +78 -0
  108. package/sdk/platform/User/UserPlatformModel.d.ts +0 -2
  109. package/sdk/platform/User/UserPlatformModel.js +0 -2
  110. package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +0 -40
  111. package/sdk/platform/Webhook/WebhookPlatformClient.js +0 -307
  112. package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +94 -146
  113. package/sdk/platform/Webhook/WebhookPlatformModel.js +100 -151
  114. package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +9 -35
  115. package/sdk/platform/Webhook/WebhookPlatformValidator.js +8 -46
  116. package/sdk/public/Billing/BillingPublicClient.d.ts +24 -2
  117. package/sdk/public/Billing/BillingPublicClient.js +156 -3
  118. package/sdk/public/Billing/BillingPublicModel.d.ts +368 -26
  119. package/sdk/public/Billing/BillingPublicModel.js +317 -18
  120. package/sdk/public/Billing/BillingPublicValidator.d.ts +19 -3
  121. package/sdk/public/Billing/BillingPublicValidator.js +22 -3
  122. package/sdk/public/Webhook/WebhookPublicModel.d.ts +22 -22
  123. package/sdk/public/Webhook/WebhookPublicModel.js +22 -22
package/README.md CHANGED
@@ -214,7 +214,7 @@ console.log("Active Theme: ", response.information.name);
214
214
  The above code will log the curl command in the console
215
215
 
216
216
  ```bash
217
- curl --request GET "https://api.fynd.com/service/application/theme/v1.0/applied-theme" --header 'authorization: Bearer <authorization-token>' --header 'x-fp-sdk-version: 1.4.7' --header 'x-fp-date: 20230222T115108Z' --header 'x-fp-signature: v1.1:1e3ab3b02b5bc626e3c32a37ee844266ade02bbcbaafc28fc7a0e46a76a7a1a8'
217
+ curl --request GET "https://api.fynd.com/service/application/theme/v1.0/applied-theme" --header 'authorization: Bearer <authorization-token>' --header 'x-fp-sdk-version: 1.4.8-beta.3' --header 'x-fp-date: 20230222T115108Z' --header 'x-fp-signature: v1.1:1e3ab3b02b5bc626e3c32a37ee844266ade02bbcbaafc28fc7a0e46a76a7a1a8'
218
218
  Active Theme: Emerge
219
219
  ```
220
220
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gofynd/fdk-client-javascript",
3
- "version": "1.4.7",
3
+ "version": "1.4.8-beta.3",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -21,6 +21,7 @@ declare class Cart {
21
21
  getItemCount: string;
22
22
  getLadderOffers: string;
23
23
  getPromotionOffers: string;
24
+ getPromotionPaymentOffers: string;
24
25
  getShipments: string;
25
26
  removeAddress: string;
26
27
  removeCoupon: string;
@@ -53,7 +54,7 @@ declare class Cart {
53
54
  * @summary: Add items to a cart
54
55
  * @description: Add product items to the customer's existing shopping cart. If there is no existing cart associated with the customer, it creates a new one and adds the items to it. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/addItems/).
55
56
  */
56
- addItems({ body, i, b, areaCode, buyNow, id, requestHeaders }?: CartApplicationValidator.AddItemsParam, { responseHeaders }?: object): Promise<CartApplicationModel.AddCartDetailResponse>;
57
+ addItems({ body, i, b, areaCode, buyNow, id, orderType, requestHeaders }?: CartApplicationValidator.AddItemsParam, { responseHeaders }?: object): Promise<CartApplicationModel.AddCartDetailResponse>;
57
58
  /**
58
59
  * @param {CartApplicationValidator.ApplyCouponParam} arg - Arg object.
59
60
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
@@ -144,7 +145,7 @@ declare class Cart {
144
145
  * @summary: Get a cart
145
146
  * @description: Retrieve details of a cart linked to a specific customer using either the customer's ID or a unique cart ID. It offers an overview of the items, quantities, prices, and other relevant information associated with the cart. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/getCart/).
146
147
  */
147
- getCart({ id, i, b, c, assignCardId, areaCode, buyNow, requestHeaders }?: CartApplicationValidator.GetCartParam, { responseHeaders }?: object): Promise<CartApplicationModel.CartDetailResponse>;
148
+ getCart({ id, i, b, c, assignCardId, areaCode, buyNow, orderType, requestHeaders, }?: CartApplicationValidator.GetCartParam, { responseHeaders }?: object): Promise<CartApplicationModel.CartDetailResponse>;
148
149
  /**
149
150
  * @param {CartApplicationValidator.GetCartLastModifiedParam} arg - Arg object.
150
151
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
@@ -216,6 +217,18 @@ declare class Cart {
216
217
  * @description: Retrieve a list of all promotional offers available for the items in the cart, including details such as offer text, unique promotion ID, and validity period. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/getPromotionOffers/).
217
218
  */
218
219
  getPromotionOffers({ slug, pageSize, promotionGroup, storeId, cartType, requestHeaders }?: CartApplicationValidator.GetPromotionOffersParam, { responseHeaders }?: object): Promise<CartApplicationModel.PromotionOffersResponse>;
220
+ /**
221
+ * @param {CartApplicationValidator.GetPromotionPaymentOffersParam} arg - Arg object.
222
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
223
+ * @param {import("../ApplicationAPIClient").Options} - Options
224
+ * @returns {Promise<CartApplicationModel.PromotionPaymentOffersResponse>}
225
+ * - Success response
226
+ *
227
+ * @name getPromotionPaymentOffers
228
+ * @summary: Fetch available promotions payment offers
229
+ * @description: Use this API to get top 5 payment offers available for current product - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/getPromotionPaymentOffers/).
230
+ */
231
+ getPromotionPaymentOffers({ id, uid, requestHeaders }?: CartApplicationValidator.GetPromotionPaymentOffersParam, { responseHeaders }?: object): Promise<CartApplicationModel.PromotionPaymentOffersResponse>;
219
232
  /**
220
233
  * @param {CartApplicationValidator.GetShipmentsParam} arg - Arg object.
221
234
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
@@ -286,7 +299,7 @@ declare class Cart {
286
299
  * @summary: Update cart items
287
300
  * @description: Customers can modify added product attributes such as quantity and size, as well as remove items from the cart. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/updateCart/).
288
301
  */
289
- updateCart({ body, id, i, b, areaCode, buyNow, cartType, requestHeaders }?: CartApplicationValidator.UpdateCartParam, { responseHeaders }?: object): Promise<CartApplicationModel.UpdateCartDetailResponse>;
302
+ updateCart({ body, id, i, b, areaCode, buyNow, cartType, orderType, requestHeaders, }?: CartApplicationValidator.UpdateCartParam, { responseHeaders }?: object): Promise<CartApplicationModel.UpdateCartDetailResponse>;
290
303
  /**
291
304
  * @param {CartApplicationValidator.UpdateCartMetaParam} arg - Arg object.
292
305
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
@@ -32,6 +32,8 @@ class Cart {
32
32
  getItemCount: "/service/application/cart/v1.0/basic",
33
33
  getLadderOffers: "/service/application/cart/v1.0/available-ladder-prices",
34
34
  getPromotionOffers: "/service/application/cart/v1.0/available-promotions",
35
+ getPromotionPaymentOffers:
36
+ "/service/application/cart/v1.0/available-payment-offers",
35
37
  getShipments: "/service/application/cart/v1.0/shipment",
36
38
  removeAddress: "/service/application/cart/v1.0/address/{id}",
37
39
  removeCoupon: "/service/application/cart/v1.0/coupon",
@@ -147,13 +149,13 @@ class Cart {
147
149
  * @description: Add product items to the customer's existing shopping cart. If there is no existing cart associated with the customer, it creates a new one and adds the items to it. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/addItems/).
148
150
  */
149
151
  async addItems(
150
- { body, i, b, areaCode, buyNow, id, requestHeaders } = {
152
+ { body, i, b, areaCode, buyNow, id, orderType, requestHeaders } = {
151
153
  requestHeaders: {},
152
154
  },
153
155
  { responseHeaders } = { responseHeaders: false }
154
156
  ) {
155
157
  const { error } = CartApplicationValidator.addItems().validate(
156
- { body, i, b, areaCode, buyNow, id },
158
+ { body, i, b, areaCode, buyNow, id, orderType },
157
159
  { abortEarly: false, allowUnknown: true }
158
160
  );
159
161
  if (error) {
@@ -162,7 +164,7 @@ class Cart {
162
164
 
163
165
  // Showing warrnings if extra unknown parameters are found
164
166
  const { error: warrning } = CartApplicationValidator.addItems().validate(
165
- { body, i, b, areaCode, buyNow, id },
167
+ { body, i, b, areaCode, buyNow, id, orderType },
166
168
  { abortEarly: false, allowUnknown: false }
167
169
  );
168
170
  if (warrning) {
@@ -178,6 +180,7 @@ class Cart {
178
180
  query_params["area_code"] = areaCode;
179
181
  query_params["buy_now"] = buyNow;
180
182
  query_params["id"] = id;
183
+ query_params["order_type"] = orderType;
181
184
 
182
185
  const xHeaders = {};
183
186
 
@@ -901,13 +904,21 @@ class Cart {
901
904
  * @description: Retrieve details of a cart linked to a specific customer using either the customer's ID or a unique cart ID. It offers an overview of the items, quantities, prices, and other relevant information associated with the cart. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/getCart/).
902
905
  */
903
906
  async getCart(
904
- { id, i, b, c, assignCardId, areaCode, buyNow, requestHeaders } = {
905
- requestHeaders: {},
906
- },
907
+ {
908
+ id,
909
+ i,
910
+ b,
911
+ c,
912
+ assignCardId,
913
+ areaCode,
914
+ buyNow,
915
+ orderType,
916
+ requestHeaders,
917
+ } = { requestHeaders: {} },
907
918
  { responseHeaders } = { responseHeaders: false }
908
919
  ) {
909
920
  const { error } = CartApplicationValidator.getCart().validate(
910
- { id, i, b, c, assignCardId, areaCode, buyNow },
921
+ { id, i, b, c, assignCardId, areaCode, buyNow, orderType },
911
922
  { abortEarly: false, allowUnknown: true }
912
923
  );
913
924
  if (error) {
@@ -916,7 +927,7 @@ class Cart {
916
927
 
917
928
  // Showing warrnings if extra unknown parameters are found
918
929
  const { error: warrning } = CartApplicationValidator.getCart().validate(
919
- { id, i, b, c, assignCardId, areaCode, buyNow },
930
+ { id, i, b, c, assignCardId, areaCode, buyNow, orderType },
920
931
  { abortEarly: false, allowUnknown: false }
921
932
  );
922
933
  if (warrning) {
@@ -934,6 +945,7 @@ class Cart {
934
945
  query_params["assign_card_id"] = assignCardId;
935
946
  query_params["area_code"] = areaCode;
936
947
  query_params["buy_now"] = buyNow;
948
+ query_params["order_type"] = orderType;
937
949
 
938
950
  const xHeaders = {};
939
951
 
@@ -1538,6 +1550,90 @@ class Cart {
1538
1550
  return response;
1539
1551
  }
1540
1552
 
1553
+ /**
1554
+ * @param {CartApplicationValidator.GetPromotionPaymentOffersParam} arg - Arg object.
1555
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1556
+ * @param {import("../ApplicationAPIClient").Options} - Options
1557
+ * @returns {Promise<CartApplicationModel.PromotionPaymentOffersResponse>}
1558
+ * - Success response
1559
+ *
1560
+ * @name getPromotionPaymentOffers
1561
+ * @summary: Fetch available promotions payment offers
1562
+ * @description: Use this API to get top 5 payment offers available for current product - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/getPromotionPaymentOffers/).
1563
+ */
1564
+ async getPromotionPaymentOffers(
1565
+ { id, uid, requestHeaders } = { requestHeaders: {} },
1566
+ { responseHeaders } = { responseHeaders: false }
1567
+ ) {
1568
+ const {
1569
+ error,
1570
+ } = CartApplicationValidator.getPromotionPaymentOffers().validate(
1571
+ { id, uid },
1572
+ { abortEarly: false, allowUnknown: true }
1573
+ );
1574
+ if (error) {
1575
+ return Promise.reject(new FDKClientValidationError(error));
1576
+ }
1577
+
1578
+ // Showing warrnings if extra unknown parameters are found
1579
+ const {
1580
+ error: warrning,
1581
+ } = CartApplicationValidator.getPromotionPaymentOffers().validate(
1582
+ { id, uid },
1583
+ { abortEarly: false, allowUnknown: false }
1584
+ );
1585
+ if (warrning) {
1586
+ Logger({
1587
+ level: "WARN",
1588
+ message: `Parameter Validation warrnings for application > Cart > getPromotionPaymentOffers \n ${warrning}`,
1589
+ });
1590
+ }
1591
+
1592
+ const query_params = {};
1593
+ query_params["id"] = id;
1594
+ query_params["uid"] = uid;
1595
+
1596
+ const xHeaders = {};
1597
+
1598
+ const response = await ApplicationAPIClient.execute(
1599
+ this._conf,
1600
+ "get",
1601
+ constructUrl({
1602
+ url: this._urls["getPromotionPaymentOffers"],
1603
+ params: {},
1604
+ }),
1605
+ query_params,
1606
+ undefined,
1607
+ { ...xHeaders, ...requestHeaders },
1608
+ { responseHeaders }
1609
+ );
1610
+
1611
+ let responseData = response;
1612
+ if (responseHeaders) {
1613
+ responseData = response[0];
1614
+ }
1615
+
1616
+ const {
1617
+ error: res_error,
1618
+ } = CartApplicationModel.PromotionPaymentOffersResponse().validate(
1619
+ responseData,
1620
+ { abortEarly: false, allowUnknown: true }
1621
+ );
1622
+
1623
+ if (res_error) {
1624
+ if (this._conf.options.strictResponseCheck === true) {
1625
+ return Promise.reject(new FDKResponseValidationError(res_error));
1626
+ } else {
1627
+ Logger({
1628
+ level: "WARN",
1629
+ message: `Response Validation Warnings for application > Cart > getPromotionPaymentOffers \n ${res_error}`,
1630
+ });
1631
+ }
1632
+ }
1633
+
1634
+ return response;
1635
+ }
1636
+
1541
1637
  /**
1542
1638
  * @param {CartApplicationValidator.GetShipmentsParam} arg - Arg object.
1543
1639
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
@@ -2033,13 +2129,21 @@ class Cart {
2033
2129
  * @description: Customers can modify added product attributes such as quantity and size, as well as remove items from the cart. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/updateCart/).
2034
2130
  */
2035
2131
  async updateCart(
2036
- { body, id, i, b, areaCode, buyNow, cartType, requestHeaders } = {
2037
- requestHeaders: {},
2038
- },
2132
+ {
2133
+ body,
2134
+ id,
2135
+ i,
2136
+ b,
2137
+ areaCode,
2138
+ buyNow,
2139
+ cartType,
2140
+ orderType,
2141
+ requestHeaders,
2142
+ } = { requestHeaders: {} },
2039
2143
  { responseHeaders } = { responseHeaders: false }
2040
2144
  ) {
2041
2145
  const { error } = CartApplicationValidator.updateCart().validate(
2042
- { body, id, i, b, areaCode, buyNow, cartType },
2146
+ { body, id, i, b, areaCode, buyNow, cartType, orderType },
2043
2147
  { abortEarly: false, allowUnknown: true }
2044
2148
  );
2045
2149
  if (error) {
@@ -2048,7 +2152,7 @@ class Cart {
2048
2152
 
2049
2153
  // Showing warrnings if extra unknown parameters are found
2050
2154
  const { error: warrning } = CartApplicationValidator.updateCart().validate(
2051
- { body, id, i, b, areaCode, buyNow, cartType },
2155
+ { body, id, i, b, areaCode, buyNow, cartType, orderType },
2052
2156
  { abortEarly: false, allowUnknown: false }
2053
2157
  );
2054
2158
  if (warrning) {
@@ -2065,6 +2169,7 @@ class Cart {
2065
2169
  query_params["area_code"] = areaCode;
2066
2170
  query_params["buy_now"] = buyNow;
2067
2171
  query_params["cart_type"] = cartType;
2172
+ query_params["order_type"] = orderType;
2068
2173
 
2069
2174
  const xHeaders = {};
2070
2175
 
@@ -16,18 +16,9 @@ export = CartApplicationModel;
16
16
  * @property {string} [payable_category] - Promo amount payable category
17
17
  * @property {string} [payable_by] - Promo amount bearable party
18
18
  */
19
- /**
20
- * @typedef FreeGiftItem
21
- * @property {string} [item_slug] - Item slug
22
- * @property {string} [item_name] - Item name
23
- * @property {Object} [item_price_details] - Item price details
24
- * @property {string} [item_brand_name] - Item brand name
25
- * @property {number} [item_id] - Item id
26
- * @property {string[]} [item_images_url] - Item images URL
27
- */
28
19
  /**
29
20
  * @typedef AppliedFreeArticles
30
- * @property {FreeGiftItem} [free_gift_item_details] - Free gift items details
21
+ * @property {FreeGiftItems} [free_gift_item_details] - Free gift items details
31
22
  * @property {string} [parent_item_identifier] - Parent item identifier for free article
32
23
  * @property {number} [quantity] - Free article quantity
33
24
  * @property {string} [article_id] - Free article id
@@ -388,6 +379,7 @@ export = CartApplicationModel;
388
379
  * @property {string} [coupon_text]
389
380
  * @property {boolean} [buy_now]
390
381
  * @property {Object} [pan_config]
382
+ * @property {Object} [custom_cart_meta]
391
383
  */
392
384
  /**
393
385
  * @typedef AddProductCart
@@ -482,6 +474,8 @@ export = CartApplicationModel;
482
474
  * @property {string} [start_date]
483
475
  * @property {string} [end_date]
484
476
  * @property {string} [coupon_applicable_message]
477
+ * @property {string} [offer_text]
478
+ * @property {boolean} [is_bank_offer]
485
479
  */
486
480
  /**
487
481
  * @typedef GetCouponResponse
@@ -654,6 +648,7 @@ export = CartApplicationModel;
654
648
  * @property {string} [comment]
655
649
  * @property {boolean} [buy_now]
656
650
  * @property {string} [uid]
651
+ * @property {Object} [custom_cart_meta]
657
652
  */
658
653
  /**
659
654
  * @typedef CartCheckoutCustomMeta
@@ -732,6 +727,7 @@ export = CartApplicationModel;
732
727
  * @property {string} [coupon_text]
733
728
  * @property {boolean} [buy_now]
734
729
  * @property {number} [cod_charges]
730
+ * @property {Object} [custom_cart_meta]
735
731
  */
736
732
  /**
737
733
  * @typedef CartCheckoutResponse
@@ -762,6 +758,7 @@ export = CartApplicationModel;
762
758
  * @property {string} [checkout_mode]
763
759
  * @property {string} [comment]
764
760
  * @property {string} [gstin]
761
+ * @property {Object} [custom_cart_meta]
765
762
  */
766
763
  /**
767
764
  * @typedef CartMetaResponse
@@ -812,17 +809,29 @@ export = CartApplicationModel;
812
809
  * @property {CartCurrency} [currency]
813
810
  * @property {string} [coupon_text]
814
811
  * @property {boolean} [buy_now]
812
+ * @property {Object} [custom_cart_meta]
815
813
  */
816
814
  /**
817
815
  * @typedef SharedCartResponse
818
816
  * @property {string} [error]
819
817
  * @property {SharedCart} [cart]
820
818
  */
819
+ /**
820
+ * @typedef PriceMinMax
821
+ * @property {number} [min]
822
+ * @property {number} [max]
823
+ */
824
+ /**
825
+ * @typedef ItemPriceDetails
826
+ * @property {PriceMinMax} [marked]
827
+ * @property {PriceMinMax} [effective]
828
+ * @property {string} [currency]
829
+ */
821
830
  /**
822
831
  * @typedef FreeGiftItems
823
832
  * @property {string} [item_slug] - Item slug
824
833
  * @property {string} [item_name] - Item name
825
- * @property {Object} [item_price_details] - Item price details
834
+ * @property {ItemPriceDetails} [item_price_details]
826
835
  * @property {string} [item_brand_name] - Item brand name
827
836
  * @property {number} [item_id] - Item id
828
837
  * @property {string[]} [item_images_url] - Item images URL
@@ -832,6 +841,8 @@ export = CartApplicationModel;
832
841
  * @property {string} [id] - Promotion id
833
842
  * @property {Object} [buy_rules] - Buy rules of promotions
834
843
  * @property {string} [offer_text] - Offer title
844
+ * @property {string} [promotion_type] - Promotion type
845
+ * @property {string} [promotion_name] - Name of the promotion
835
846
  * @property {string} [promotion_group] - Group of promotion belongs to
836
847
  * @property {string} [valid_till] - Datetime ISOString for promotion end date
837
848
  * @property {Object[]} [discount_rules] - Discount rules of promotions
@@ -842,6 +853,24 @@ export = CartApplicationModel;
842
853
  * @typedef PromotionOffersResponse
843
854
  * @property {PromotionOffer[]} [available_promotions]
844
855
  */
856
+ /**
857
+ * @typedef PromotionPaymentOffer
858
+ * @property {string} [application_id] - Application id
859
+ * @property {Object[]} [buy_rules] - Buy rules of promotions
860
+ * @property {string} [calculate_on] - Price on which promotion calculated
861
+ * @property {string} [description] - Offer details including T&C
862
+ * @property {Object[]} [discount_rules] - Discount rules of promotions
863
+ * @property {string} [id] - Promotion id
864
+ * @property {string} [offer_text] - Offer title
865
+ * @property {string} [promotion_group] - Group of promotion belongs to
866
+ * @property {string} [promotion_type] - Promotion type
867
+ * @property {string} [promotion_name] - Name of the promotion
868
+ */
869
+ /**
870
+ * @typedef PromotionPaymentOffersResponse
871
+ * @property {boolean} [success]
872
+ * @property {PromotionPaymentOffer[]} [promotions]
873
+ */
845
874
  /**
846
875
  * @typedef OperationErrorResponse
847
876
  * @property {string} [message]
@@ -936,7 +965,7 @@ export = CartApplicationModel;
936
965
  declare class CartApplicationModel {
937
966
  }
938
967
  declare namespace CartApplicationModel {
939
- export { BuyRules, DiscountRulesApp, Ownership, FreeGiftItem, AppliedFreeArticles, AppliedPromotion, PaymentSelectionLock, PromiseFormatted, PromiseISOFormat, PromiseTimestamp, ShipmentPromise, BasePrice, ArticlePriceInfo, BaseInfo, StoreInfo, ProductArticle, CartProductIdentifer, PromoMeta, ChargesAmount, Charges, ProductPrice, ProductPriceInfo, ProductPricePerUnit, ProductPricePerUnitInfo, ProductAvailabilitySize, ProductAvailability, ActionQuery, ProductAction, Tags, ProductImage, CategoryInfo, CartProduct, CouponDetails, CartProductInfo, DisplayBreakup, RawBreakup, CouponBreakup, LoyaltyPoints, CartBreakup, CartCurrency, CartDetailCoupon, ChargesThreshold, DeliveryChargesConfig, CartCommonConfig, CartDetailResponse, AddProductCart, AddCartRequest, AddCartDetailResponse, UpdateProductCart, UpdateCartRequest, UpdateCartDetailResponse, DeleteCartDetailResponse, CartItemCountResponse, PageCoupon, Coupon, GetCouponResponse, ApplyCouponRequest, OfferPrice, OfferItem, OfferSeller, BulkPriceOffer, BulkPriceResponse, RewardPointRequest, GeoLocation, Address, GetAddressesResponse, SaveAddressResponse, UpdateAddressResponse, DeleteAddressResponse, SelectCartAddressRequest, UpdateCartPaymentRequest, CouponValidity, PaymentCouponValidate, ShipmentResponse, CartShipmentsResponse, CartCheckoutCustomMeta, CustomerDetails, StaffCheckout, CartCheckoutDetailRequest, CheckCart, CartCheckoutResponse, GiftDetail, ArticleGiftDetail, CartMetaRequest, CartMetaResponse, CartMetaMissingResponse, GetShareCartLinkRequest, GetShareCartLinkResponse, SharedCartDetails, SharedCart, SharedCartResponse, FreeGiftItems, PromotionOffer, PromotionOffersResponse, OperationErrorResponse, LadderPrice, LadderOfferItem, LadderPriceOffer, CurrencyInfo, LadderPriceOffers, PaymentMeta, PaymentMethod, CartCheckoutDetailV2Request };
968
+ export { BuyRules, DiscountRulesApp, Ownership, AppliedFreeArticles, AppliedPromotion, PaymentSelectionLock, PromiseFormatted, PromiseISOFormat, PromiseTimestamp, ShipmentPromise, BasePrice, ArticlePriceInfo, BaseInfo, StoreInfo, ProductArticle, CartProductIdentifer, PromoMeta, ChargesAmount, Charges, ProductPrice, ProductPriceInfo, ProductPricePerUnit, ProductPricePerUnitInfo, ProductAvailabilitySize, ProductAvailability, ActionQuery, ProductAction, Tags, ProductImage, CategoryInfo, CartProduct, CouponDetails, CartProductInfo, DisplayBreakup, RawBreakup, CouponBreakup, LoyaltyPoints, CartBreakup, CartCurrency, CartDetailCoupon, ChargesThreshold, DeliveryChargesConfig, CartCommonConfig, CartDetailResponse, AddProductCart, AddCartRequest, AddCartDetailResponse, UpdateProductCart, UpdateCartRequest, UpdateCartDetailResponse, DeleteCartDetailResponse, CartItemCountResponse, PageCoupon, Coupon, GetCouponResponse, ApplyCouponRequest, OfferPrice, OfferItem, OfferSeller, BulkPriceOffer, BulkPriceResponse, RewardPointRequest, GeoLocation, Address, GetAddressesResponse, SaveAddressResponse, UpdateAddressResponse, DeleteAddressResponse, SelectCartAddressRequest, UpdateCartPaymentRequest, CouponValidity, PaymentCouponValidate, ShipmentResponse, CartShipmentsResponse, CartCheckoutCustomMeta, CustomerDetails, StaffCheckout, CartCheckoutDetailRequest, CheckCart, CartCheckoutResponse, GiftDetail, ArticleGiftDetail, CartMetaRequest, CartMetaResponse, CartMetaMissingResponse, GetShareCartLinkRequest, GetShareCartLinkResponse, SharedCartDetails, SharedCart, SharedCartResponse, PriceMinMax, ItemPriceDetails, FreeGiftItems, PromotionOffer, PromotionOffersResponse, PromotionPaymentOffer, PromotionPaymentOffersResponse, OperationErrorResponse, LadderPrice, LadderOfferItem, LadderPriceOffer, CurrencyInfo, LadderPriceOffers, PaymentMeta, PaymentMethod, CartCheckoutDetailV2Request };
940
969
  }
941
970
  /** @returns {BuyRules} */
942
971
  declare function BuyRules(): BuyRules;
@@ -982,41 +1011,13 @@ type Ownership = {
982
1011
  */
983
1012
  payable_by?: string;
984
1013
  };
985
- /** @returns {FreeGiftItem} */
986
- declare function FreeGiftItem(): FreeGiftItem;
987
- type FreeGiftItem = {
988
- /**
989
- * - Item slug
990
- */
991
- item_slug?: string;
992
- /**
993
- * - Item name
994
- */
995
- item_name?: string;
996
- /**
997
- * - Item price details
998
- */
999
- item_price_details?: any;
1000
- /**
1001
- * - Item brand name
1002
- */
1003
- item_brand_name?: string;
1004
- /**
1005
- * - Item id
1006
- */
1007
- item_id?: number;
1008
- /**
1009
- * - Item images URL
1010
- */
1011
- item_images_url?: string[];
1012
- };
1013
1014
  /** @returns {AppliedFreeArticles} */
1014
1015
  declare function AppliedFreeArticles(): AppliedFreeArticles;
1015
1016
  type AppliedFreeArticles = {
1016
1017
  /**
1017
1018
  * - Free gift items details
1018
1019
  */
1019
- free_gift_item_details?: FreeGiftItem;
1020
+ free_gift_item_details?: FreeGiftItems;
1020
1021
  /**
1021
1022
  * - Parent item identifier for free article
1022
1023
  */
@@ -1513,6 +1514,7 @@ type CartDetailResponse = {
1513
1514
  coupon_text?: string;
1514
1515
  buy_now?: boolean;
1515
1516
  pan_config?: any;
1517
+ custom_cart_meta?: any;
1516
1518
  };
1517
1519
  /** @returns {AddProductCart} */
1518
1520
  declare function AddProductCart(): AddProductCart;
@@ -1638,6 +1640,8 @@ type Coupon = {
1638
1640
  start_date?: string;
1639
1641
  end_date?: string;
1640
1642
  coupon_applicable_message?: string;
1643
+ offer_text?: string;
1644
+ is_bank_offer?: boolean;
1641
1645
  };
1642
1646
  /** @returns {GetCouponResponse} */
1643
1647
  declare function GetCouponResponse(): GetCouponResponse;
@@ -1875,6 +1879,7 @@ type CartShipmentsResponse = {
1875
1879
  comment?: string;
1876
1880
  buy_now?: boolean;
1877
1881
  uid?: string;
1882
+ custom_cart_meta?: any;
1878
1883
  };
1879
1884
  /** @returns {CartCheckoutCustomMeta} */
1880
1885
  declare function CartCheckoutCustomMeta(): CartCheckoutCustomMeta;
@@ -1961,6 +1966,7 @@ type CheckCart = {
1961
1966
  coupon_text?: string;
1962
1967
  buy_now?: boolean;
1963
1968
  cod_charges?: number;
1969
+ custom_cart_meta?: any;
1964
1970
  };
1965
1971
  /** @returns {CartCheckoutResponse} */
1966
1972
  declare function CartCheckoutResponse(): CartCheckoutResponse;
@@ -1998,6 +2004,7 @@ type CartMetaRequest = {
1998
2004
  checkout_mode?: string;
1999
2005
  comment?: string;
2000
2006
  gstin?: string;
2007
+ custom_cart_meta?: any;
2001
2008
  };
2002
2009
  /** @returns {CartMetaResponse} */
2003
2010
  declare function CartMetaResponse(): CartMetaResponse;
@@ -2078,6 +2085,7 @@ type SharedCart = {
2078
2085
  currency?: CartCurrency;
2079
2086
  coupon_text?: string;
2080
2087
  buy_now?: boolean;
2088
+ custom_cart_meta?: any;
2081
2089
  };
2082
2090
  /** @returns {SharedCartResponse} */
2083
2091
  declare function SharedCartResponse(): SharedCartResponse;
@@ -2085,6 +2093,19 @@ type SharedCartResponse = {
2085
2093
  error?: string;
2086
2094
  cart?: SharedCart;
2087
2095
  };
2096
+ /** @returns {PriceMinMax} */
2097
+ declare function PriceMinMax(): PriceMinMax;
2098
+ type PriceMinMax = {
2099
+ min?: number;
2100
+ max?: number;
2101
+ };
2102
+ /** @returns {ItemPriceDetails} */
2103
+ declare function ItemPriceDetails(): ItemPriceDetails;
2104
+ type ItemPriceDetails = {
2105
+ marked?: PriceMinMax;
2106
+ effective?: PriceMinMax;
2107
+ currency?: string;
2108
+ };
2088
2109
  /** @returns {FreeGiftItems} */
2089
2110
  declare function FreeGiftItems(): FreeGiftItems;
2090
2111
  type FreeGiftItems = {
@@ -2096,10 +2117,7 @@ type FreeGiftItems = {
2096
2117
  * - Item name
2097
2118
  */
2098
2119
  item_name?: string;
2099
- /**
2100
- * - Item price details
2101
- */
2102
- item_price_details?: any;
2120
+ item_price_details?: ItemPriceDetails;
2103
2121
  /**
2104
2122
  * - Item brand name
2105
2123
  */
@@ -2128,6 +2146,14 @@ type PromotionOffer = {
2128
2146
  * - Offer title
2129
2147
  */
2130
2148
  offer_text?: string;
2149
+ /**
2150
+ * - Promotion type
2151
+ */
2152
+ promotion_type?: string;
2153
+ /**
2154
+ * - Name of the promotion
2155
+ */
2156
+ promotion_name?: string;
2131
2157
  /**
2132
2158
  * - Group of promotion belongs to
2133
2159
  */
@@ -2154,6 +2180,56 @@ declare function PromotionOffersResponse(): PromotionOffersResponse;
2154
2180
  type PromotionOffersResponse = {
2155
2181
  available_promotions?: PromotionOffer[];
2156
2182
  };
2183
+ /** @returns {PromotionPaymentOffer} */
2184
+ declare function PromotionPaymentOffer(): PromotionPaymentOffer;
2185
+ type PromotionPaymentOffer = {
2186
+ /**
2187
+ * - Application id
2188
+ */
2189
+ application_id?: string;
2190
+ /**
2191
+ * - Buy rules of promotions
2192
+ */
2193
+ buy_rules?: any[];
2194
+ /**
2195
+ * - Price on which promotion calculated
2196
+ */
2197
+ calculate_on?: string;
2198
+ /**
2199
+ * - Offer details including T&C
2200
+ */
2201
+ description?: string;
2202
+ /**
2203
+ * - Discount rules of promotions
2204
+ */
2205
+ discount_rules?: any[];
2206
+ /**
2207
+ * - Promotion id
2208
+ */
2209
+ id?: string;
2210
+ /**
2211
+ * - Offer title
2212
+ */
2213
+ offer_text?: string;
2214
+ /**
2215
+ * - Group of promotion belongs to
2216
+ */
2217
+ promotion_group?: string;
2218
+ /**
2219
+ * - Promotion type
2220
+ */
2221
+ promotion_type?: string;
2222
+ /**
2223
+ * - Name of the promotion
2224
+ */
2225
+ promotion_name?: string;
2226
+ };
2227
+ /** @returns {PromotionPaymentOffersResponse} */
2228
+ declare function PromotionPaymentOffersResponse(): PromotionPaymentOffersResponse;
2229
+ type PromotionPaymentOffersResponse = {
2230
+ success?: boolean;
2231
+ promotions?: PromotionPaymentOffer[];
2232
+ };
2157
2233
  /** @returns {OperationErrorResponse} */
2158
2234
  declare function OperationErrorResponse(): OperationErrorResponse;
2159
2235
  type OperationErrorResponse = {