@gofynd/fdk-client-javascript 3.8.0 → 3.10.0

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.
package/README.md CHANGED
@@ -234,7 +234,7 @@ console.log("Active Theme: ", response.information.name);
234
234
  The above code will log the curl command in the console
235
235
 
236
236
  ```bash
237
- curl --request GET "https://api.fynd.com/service/application/theme/v1.0/applied-theme" --header 'authorization: Bearer <authorization-token>' --header 'x-fp-sdk-version: 3.8.0' --header 'x-fp-date: 20230222T115108Z' --header 'x-fp-signature: v1.1:1e3ab3b02b5bc626e3c32a37ee844266ade02bbcbaafc28fc7a0e46a76a7a1a8'
237
+ curl --request GET "https://api.fynd.com/service/application/theme/v1.0/applied-theme" --header 'authorization: Bearer <authorization-token>' --header 'x-fp-sdk-version: 3.10.0' --header 'x-fp-date: 20230222T115108Z' --header 'x-fp-signature: v1.1:1e3ab3b02b5bc626e3c32a37ee844266ade02bbcbaafc28fc7a0e46a76a7a1a8'
238
238
  Active Theme: Emerge
239
239
  ```
240
240
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gofynd/fdk-client-javascript",
3
- "version": "3.8.0",
3
+ "version": "3.10.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -6,7 +6,7 @@ declare class Cart {
6
6
  addAddress: string;
7
7
  addItems: string;
8
8
  applyCoupon: string;
9
- applyRewardPoints: string;
9
+ applyLoyaltyPoints: string;
10
10
  checkoutCart: string;
11
11
  checkoutCartV2: string;
12
12
  deleteCart: string;
@@ -67,11 +67,11 @@ declare class Cart {
67
67
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
68
68
  * @param {import("../ApplicationAPIClient").Options} - Options
69
69
  * @returns {Promise<CartDetailResult>} - Success response
70
- * @name applyRewardPoints
71
- * @summary: Use reward points
72
- * @description: Users can redeem their accumulated reward points and apply them to the items in their cart, thereby availing discounts on their current purchases. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/application/cart/applyRewardPoints/).
70
+ * @name applyLoyaltyPoints
71
+ * @summary: Use loyalty points
72
+ * @description: Users can redeem their accumulated loyalty points and apply them to the items in their cart, thereby availing discounts on their current purchases. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/application/cart/applyLoyaltyPoints/).
73
73
  */
74
- applyRewardPoints({ body, xOrderingSource, id, i, b, buyNow, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<CartDetailResult>;
74
+ applyLoyaltyPoints({ body, xOrderingSource, id, i, b, buyNow, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<CartDetailResult>;
75
75
  /**
76
76
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
77
77
  * @param {import("../ApplicationAPIClient").Options} - Options
@@ -87,7 +87,7 @@ declare class Cart {
87
87
  * @returns {Promise<CartCheckoutResult>} - Success response
88
88
  * @name checkoutCartV2
89
89
  * @summary: Checkout cart
90
- * @description: The checkout cart initiates the order creation process based on the items in the user's cart, their selected address, and chosen payment methods. It also supports multiple payment method options and revalidates the cart details to ensure a secure and seamless order placement. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/application/cart/checkoutCartV2/).
90
+ * @description: The checkout cart initiates the order creation process based on the items in the user's cart, their selected address, and chosen payment methods. It also supports multiple payment method options and revalidates the cart details to ensure a secure and seamless order placement. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/application/cart/checkoutCartV2/).
91
91
  */
92
92
  checkoutCartV2({ body, xOrderingSource, buyNow, cartType, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<CartCheckoutResult>;
93
93
  /**
@@ -276,7 +276,7 @@ declare class Cart {
276
276
  * @returns {Promise<UpdateCartDetailResult>} - Success response
277
277
  * @name updateCartBreakup
278
278
  * @summary: Update store credits into cart and their items
279
- * @description: Update cart. Customers can adjust the cart breakup by applying or removing store credits as needed. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/application/cart/updateCartBreakup/).
279
+ * @description: Update cart. Customers can adjust the cart breakup by applying or removing store credits as needed. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/application/cart/updateCartBreakup/).
280
280
  */
281
281
  updateCartBreakup({ body, xOrderingSource, id, i, b, buyNow, cartType, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<UpdateCartDetailResult>;
282
282
  /**
@@ -15,7 +15,7 @@ class Cart {
15
15
  addAddress: "/service/application/cart/v1.0/address",
16
16
  addItems: "/service/application/cart/v1.0/detail",
17
17
  applyCoupon: "/service/application/cart/v1.0/coupon",
18
- applyRewardPoints: "/service/application/cart/v1.0/redeem/points/",
18
+ applyLoyaltyPoints: "/service/application/cart/v1.0/redeem",
19
19
  checkoutCart: "/service/application/cart/v1.0/checkout",
20
20
  checkoutCartV2: "/service/application/cart/v2.0/checkout",
21
21
  deleteCart: "/service/application/cart/v1.0/cart_archive",
@@ -203,11 +203,11 @@ class Cart {
203
203
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
204
204
  * @param {import("../ApplicationAPIClient").Options} - Options
205
205
  * @returns {Promise<CartDetailResult>} - Success response
206
- * @name applyRewardPoints
207
- * @summary: Use reward points
208
- * @description: Users can redeem their accumulated reward points and apply them to the items in their cart, thereby availing discounts on their current purchases. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/application/cart/applyRewardPoints/).
206
+ * @name applyLoyaltyPoints
207
+ * @summary: Use loyalty points
208
+ * @description: Users can redeem their accumulated loyalty points and apply them to the items in their cart, thereby availing discounts on their current purchases. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/application/cart/applyLoyaltyPoints/).
209
209
  */
210
- async applyRewardPoints(
210
+ async applyLoyaltyPoints(
211
211
  { body, xOrderingSource, id, i, b, buyNow, requestHeaders } = {
212
212
  requestHeaders: {},
213
213
  },
@@ -226,7 +226,7 @@ class Cart {
226
226
  this._conf,
227
227
  "post",
228
228
  constructUrl({
229
- url: this._urls["applyRewardPoints"],
229
+ url: this._urls["applyLoyaltyPoints"],
230
230
  params: {},
231
231
  }),
232
232
  query_params,
@@ -291,7 +291,7 @@ class Cart {
291
291
  * @returns {Promise<CartCheckoutResult>} - Success response
292
292
  * @name checkoutCartV2
293
293
  * @summary: Checkout cart
294
- * @description: The checkout cart initiates the order creation process based on the items in the user's cart, their selected address, and chosen payment methods. It also supports multiple payment method options and revalidates the cart details to ensure a secure and seamless order placement. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/application/cart/checkoutCartV2/).
294
+ * @description: The checkout cart initiates the order creation process based on the items in the user's cart, their selected address, and chosen payment methods. It also supports multiple payment method options and revalidates the cart details to ensure a secure and seamless order placement. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/application/cart/checkoutCartV2/).
295
295
  */
296
296
  async checkoutCartV2(
297
297
  { body, xOrderingSource, buyNow, cartType, requestHeaders } = {
@@ -1240,7 +1240,7 @@ class Cart {
1240
1240
  * @returns {Promise<UpdateCartDetailResult>} - Success response
1241
1241
  * @name updateCartBreakup
1242
1242
  * @summary: Update store credits into cart and their items
1243
- * @description: Update cart. Customers can adjust the cart breakup by applying or removing store credits as needed. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/application/cart/updateCartBreakup/).
1243
+ * @description: Update cart. Customers can adjust the cart breakup by applying or removing store credits as needed. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/application/cart/updateCartBreakup/).
1244
1244
  */
1245
1245
  async updateCartBreakup(
1246
1246
  { body, xOrderingSource, id, i, b, buyNow, cartType, requestHeaders } = {
@@ -34,9 +34,9 @@ declare class Theme {
34
34
  * @returns {Promise<AvailablePageSchema>} - Success response
35
35
  * @name getPage
36
36
  * @summary: Get theme page
37
- * @description: Get page level configurations, applied sections and seo data of a page by `page_value` received from list pages api. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/application/theme/getPage/).
37
+ * @description: Get page level configurations, applied sections and seo data of a page by `page_value` received from list pages api. Supports dynamic URL parameter for custom sections. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/application/theme/getPage/).
38
38
  */
39
- getPage({ themeId, pageValue, filters, sectionPreviewHash, company, requestHeaders, }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options, ...args: any[]): Promise<AvailablePageSchema>;
39
+ getPage({ themeId, pageValue, filters, sectionPreviewHash, company, urlParams, requestHeaders, }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options, ...args: any[]): Promise<AvailablePageSchema>;
40
40
  /**
41
41
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
42
42
  * @param {import("../ApplicationAPIClient").Options} - Options
@@ -123,7 +123,7 @@ class Theme {
123
123
  * @returns {Promise<AvailablePageSchema>} - Success response
124
124
  * @name getPage
125
125
  * @summary: Get theme page
126
- * @description: Get page level configurations, applied sections and seo data of a page by `page_value` received from list pages api. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/application/theme/getPage/).
126
+ * @description: Get page level configurations, applied sections and seo data of a page by `page_value` received from list pages api. Supports dynamic URL parameter for custom sections. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/application/theme/getPage/).
127
127
  */
128
128
  async getPage(
129
129
  {
@@ -132,6 +132,7 @@ class Theme {
132
132
  filters,
133
133
  sectionPreviewHash,
134
134
  company,
135
+ urlParams,
135
136
  requestHeaders,
136
137
  } = { requestHeaders: {} },
137
138
  { responseHeaders } = { responseHeaders: false }
@@ -152,6 +153,7 @@ class Theme {
152
153
  query_params["filters"] = filters;
153
154
  query_params["section_preview_hash"] = sectionPreviewHash;
154
155
  query_params["company"] = company;
156
+ query_params["url_params"] = urlParams;
155
157
 
156
158
  const xHeaders = {};
157
159
 
@@ -43,6 +43,16 @@ declare class Cart {
43
43
  * @description: Apply a coupon code to the customer's cart to trigger discounts on eligible items - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/cart/applyCoupon/).
44
44
  */
45
45
  applyCoupon({ body, xOrderingSource, i, b, p, id, buyNow, requestHeaders }?: CartPlatformApplicationValidator.ApplyCouponParam, { responseHeaders }?: object): Promise<CartPlatformModel.CartDetailResult>;
46
+ /**
47
+ * @param {CartPlatformApplicationValidator.ApplyLoyaltyPointsParam} arg - Arg object
48
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
49
+ * @param {import("../PlatformAPIClient").Options} - Options
50
+ * @returns {Promise<CartPlatformModel.CartDetailResult>} - Success response
51
+ * @name applyLoyaltyPoints
52
+ * @summary: Redeem loyalty points.
53
+ * @description: Users can redeem their accumulated loyalty points and apply them to the items in their cart, thereby availing discounts on their current purchases. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/cart/applyLoyaltyPoints/).
54
+ */
55
+ applyLoyaltyPoints({ body, xOrderingSource, id, i, b, buyNow, requestHeaders }?: CartPlatformApplicationValidator.ApplyLoyaltyPointsParam, { responseHeaders }?: object): Promise<CartPlatformModel.CartDetailResult>;
46
56
  /**
47
57
  * @param {CartPlatformApplicationValidator.CheckCartServiceabilityParam} arg
48
58
  * - Arg object
@@ -448,7 +458,7 @@ declare class Cart {
448
458
  * @returns {Promise<CartPlatformModel.CartCheckoutDetails>} - Success response
449
459
  * @name platformCheckoutCartV2
450
460
  * @summary: Checkout cart
451
- * @description: The checkout cart initiates the order creation process based on the items in the user’s cart, their selected address, and chosen payment methods. It also supports multiple payment method options and revalidates the cart details to ensure a secure and seamless order placement. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/cart/platformCheckoutCartV2/).
461
+ * @description: The checkout cart initiates the order creation process based on the items in the user’s cart, their selected address, and chosen payment methods. It also supports multiple payment method options and revalidates the cart details to ensure a secure and seamless order placement. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/cart/platformCheckoutCartV2/).
452
462
  */
453
463
  platformCheckoutCartV2({ body, xOrderingSource, id, requestHeaders }?: CartPlatformApplicationValidator.PlatformCheckoutCartV2Param, { responseHeaders }?: object): Promise<CartPlatformModel.CartCheckoutDetails>;
454
464
  /**
@@ -349,6 +349,101 @@ class Cart {
349
349
  return response;
350
350
  }
351
351
 
352
+ /**
353
+ * @param {CartPlatformApplicationValidator.ApplyLoyaltyPointsParam} arg - Arg object
354
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
355
+ * @param {import("../PlatformAPIClient").Options} - Options
356
+ * @returns {Promise<CartPlatformModel.CartDetailResult>} - Success response
357
+ * @name applyLoyaltyPoints
358
+ * @summary: Redeem loyalty points.
359
+ * @description: Users can redeem their accumulated loyalty points and apply them to the items in their cart, thereby availing discounts on their current purchases. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/cart/applyLoyaltyPoints/).
360
+ */
361
+ async applyLoyaltyPoints(
362
+ { body, xOrderingSource, id, i, b, buyNow, requestHeaders } = {
363
+ requestHeaders: {},
364
+ },
365
+ { responseHeaders } = { responseHeaders: false }
366
+ ) {
367
+ const {
368
+ error,
369
+ } = CartPlatformApplicationValidator.applyLoyaltyPoints().validate(
370
+ {
371
+ body,
372
+ xOrderingSource,
373
+ id,
374
+ i,
375
+ b,
376
+ buyNow,
377
+ },
378
+ { abortEarly: false, allowUnknown: true }
379
+ );
380
+ if (error) {
381
+ return Promise.reject(new FDKClientValidationError(error));
382
+ }
383
+
384
+ // Showing warrnings if extra unknown parameters are found
385
+ const {
386
+ error: warrning,
387
+ } = CartPlatformApplicationValidator.applyLoyaltyPoints().validate(
388
+ {
389
+ body,
390
+ xOrderingSource,
391
+ id,
392
+ i,
393
+ b,
394
+ buyNow,
395
+ },
396
+ { abortEarly: false, allowUnknown: false }
397
+ );
398
+ if (warrning) {
399
+ Logger({
400
+ level: "WARN",
401
+ message: `Parameter Validation warrnings for platform > Cart > applyLoyaltyPoints \n ${warrning}`,
402
+ });
403
+ }
404
+
405
+ const query_params = {};
406
+ query_params["id"] = id;
407
+ query_params["i"] = i;
408
+ query_params["b"] = b;
409
+ query_params["buy_now"] = buyNow;
410
+
411
+ const response = await PlatformAPIClient.execute(
412
+ this.config,
413
+ "post",
414
+ `/service/platform/cart/v2.0/company/${this.config.companyId}/application/${this.applicationId}/redeem`,
415
+ query_params,
416
+ body,
417
+ requestHeaders,
418
+ { responseHeaders }
419
+ );
420
+
421
+ let responseData = response;
422
+ if (responseHeaders) {
423
+ responseData = response[0];
424
+ }
425
+
426
+ const {
427
+ error: res_error,
428
+ } = CartPlatformModel.CartDetailResult().validate(responseData, {
429
+ abortEarly: false,
430
+ allowUnknown: true,
431
+ });
432
+
433
+ if (res_error) {
434
+ if (this.config.options.strictResponseCheck === true) {
435
+ return Promise.reject(new FDKResponseValidationError(res_error));
436
+ } else {
437
+ Logger({
438
+ level: "WARN",
439
+ message: `Response Validation Warnings for platform > Cart > applyLoyaltyPoints \n ${res_error}`,
440
+ });
441
+ }
442
+ }
443
+
444
+ return response;
445
+ }
446
+
352
447
  /**
353
448
  * @param {CartPlatformApplicationValidator.CheckCartServiceabilityParam} arg
354
449
  * - Arg object
@@ -3649,7 +3744,7 @@ class Cart {
3649
3744
  * @returns {Promise<CartPlatformModel.CartCheckoutDetails>} - Success response
3650
3745
  * @name platformCheckoutCartV2
3651
3746
  * @summary: Checkout cart
3652
- * @description: The checkout cart initiates the order creation process based on the items in the user’s cart, their selected address, and chosen payment methods. It also supports multiple payment method options and revalidates the cart details to ensure a secure and seamless order placement. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/cart/platformCheckoutCartV2/).
3747
+ * @description: The checkout cart initiates the order creation process based on the items in the user’s cart, their selected address, and chosen payment methods. It also supports multiple payment method options and revalidates the cart details to ensure a secure and seamless order placement. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/cart/platformCheckoutCartV2/).
3653
3748
  */
3654
3749
  async platformCheckoutCartV2(
3655
3750
  { body, xOrderingSource, id, requestHeaders } = { requestHeaders: {} },
@@ -24,6 +24,16 @@ export = CartPlatformApplicationValidator;
24
24
  * @property {boolean} [buyNow]
25
25
  * @property {CartPlatformModel.ApplyCouponDetails} body
26
26
  */
27
+ /**
28
+ * @typedef ApplyLoyaltyPointsParam
29
+ * @property {CartPlatformModel.OrderingSource} [xOrderingSource] - Ordering
30
+ * source header, to be used to identify source of order creation.
31
+ * @property {string} [id] - The unique identifier of the cart.
32
+ * @property {boolean} [i] - Select `true` to retrieve all the items added in the cart.
33
+ * @property {boolean} [b] - Select `true` to retrieve the price breakup of cart items.
34
+ * @property {boolean} [buyNow] - This is boolean to get buy_now cart.
35
+ * @property {CartPlatformModel.RedeemLoyaltyPoints} body
36
+ */
27
37
  /**
28
38
  * @typedef CheckCartServiceabilityParam
29
39
  * @property {CartPlatformModel.OrderingSource} [xOrderingSource] - Ordering
@@ -444,6 +454,8 @@ declare class CartPlatformApplicationValidator {
444
454
  static addPriceAdjustment(): AddPriceAdjustmentParam;
445
455
  /** @returns {ApplyCouponParam} */
446
456
  static applyCoupon(): ApplyCouponParam;
457
+ /** @returns {ApplyLoyaltyPointsParam} */
458
+ static applyLoyaltyPoints(): ApplyLoyaltyPointsParam;
447
459
  /** @returns {CheckCartServiceabilityParam} */
448
460
  static checkCartServiceability(): CheckCartServiceabilityParam;
449
461
  /** @returns {CheckoutCartParam} */
@@ -562,7 +574,7 @@ declare class CartPlatformApplicationValidator {
562
574
  static validateCouponForPayment(): ValidateCouponForPaymentParam;
563
575
  }
564
576
  declare namespace CartPlatformApplicationValidator {
565
- export { AddAddressParam, AddItemsParam, AddPriceAdjustmentParam, ApplyCouponParam, CheckCartServiceabilityParam, CheckoutCartParam, CreateCartMetaConfigParam, CreateCouponParam, CreatePromotionParam, DeleteCartParam, DeleteCouponParam, DeletePromotionParam, FetchAndvalidateCartItemsParam, FetchCartMetaConfigParam, GetAbandonedCartParam, GetAbandonedCartDetailsParam, GetAddressByIdParam, GetAddressesParam, GetAppCouponsParam, GetAvailableDeliveryModesParam, GetCartParam, GetCartListParam, GetCartShareLinkParam, GetCartSharedItemsParam, GetCouponByIdParam, GetCouponCodeExistsParam, GetCouponOptionValuesParam, GetCouponsParam, GetItemCountParam, GetPriceAdjustmentsParam, GetPromosCouponConfigParam, GetPromotionByIdParam, GetPromotionCodeExistsParam, GetPromotionOffersParam, GetPromotionPaymentOffersParam, GetPromotionsParam, GetShipmentsParam, GetStoreAddressByUidParam, OverrideCartParam, PlatformAddItemsParam, PlatformCheckoutCartParam, PlatformCheckoutCartV2Param, PlatformUpdateCartParam, RemoveAddressParam, RemoveCouponParam, RemovePriceAdjustmentParam, SelectAddressParam, SelectPaymentModeParam, SelectPaymentModeV2Param, UpdateAddressParam, UpdateCartParam, UpdateCartMetaParam, UpdateCartMetaConfigParam, UpdateCartUserParam, UpdateCartWithSharedItemsParam, UpdateCouponParam, UpdateCouponPartiallyParam, UpdatePriceAdjustmentParam, UpdatePromotionParam, UpdatePromotionPartiallyParam, UpdateShipmentsParam, ValidateCouponForPaymentParam };
577
+ export { AddAddressParam, AddItemsParam, AddPriceAdjustmentParam, ApplyCouponParam, ApplyLoyaltyPointsParam, CheckCartServiceabilityParam, CheckoutCartParam, CreateCartMetaConfigParam, CreateCouponParam, CreatePromotionParam, DeleteCartParam, DeleteCouponParam, DeletePromotionParam, FetchAndvalidateCartItemsParam, FetchCartMetaConfigParam, GetAbandonedCartParam, GetAbandonedCartDetailsParam, GetAddressByIdParam, GetAddressesParam, GetAppCouponsParam, GetAvailableDeliveryModesParam, GetCartParam, GetCartListParam, GetCartShareLinkParam, GetCartSharedItemsParam, GetCouponByIdParam, GetCouponCodeExistsParam, GetCouponOptionValuesParam, GetCouponsParam, GetItemCountParam, GetPriceAdjustmentsParam, GetPromosCouponConfigParam, GetPromotionByIdParam, GetPromotionCodeExistsParam, GetPromotionOffersParam, GetPromotionPaymentOffersParam, GetPromotionsParam, GetShipmentsParam, GetStoreAddressByUidParam, OverrideCartParam, PlatformAddItemsParam, PlatformCheckoutCartParam, PlatformCheckoutCartV2Param, PlatformUpdateCartParam, RemoveAddressParam, RemoveCouponParam, RemovePriceAdjustmentParam, SelectAddressParam, SelectPaymentModeParam, SelectPaymentModeV2Param, UpdateAddressParam, UpdateCartParam, UpdateCartMetaParam, UpdateCartMetaConfigParam, UpdateCartUserParam, UpdateCartWithSharedItemsParam, UpdateCouponParam, UpdateCouponPartiallyParam, UpdatePriceAdjustmentParam, UpdatePromotionParam, UpdatePromotionPartiallyParam, UpdateShipmentsParam, ValidateCouponForPaymentParam };
566
578
  }
567
579
  type AddAddressParam = {
568
580
  body: CartPlatformModel.PlatformAddress;
@@ -591,6 +603,30 @@ type ApplyCouponParam = {
591
603
  buyNow?: boolean;
592
604
  body: CartPlatformModel.ApplyCouponDetails;
593
605
  };
606
+ type ApplyLoyaltyPointsParam = {
607
+ /**
608
+ * - Ordering
609
+ * source header, to be used to identify source of order creation.
610
+ */
611
+ xOrderingSource?: CartPlatformModel.OrderingSource;
612
+ /**
613
+ * - The unique identifier of the cart.
614
+ */
615
+ id?: string;
616
+ /**
617
+ * - Select `true` to retrieve all the items added in the cart.
618
+ */
619
+ i?: boolean;
620
+ /**
621
+ * - Select `true` to retrieve the price breakup of cart items.
622
+ */
623
+ b?: boolean;
624
+ /**
625
+ * - This is boolean to get buy_now cart.
626
+ */
627
+ buyNow?: boolean;
628
+ body: CartPlatformModel.RedeemLoyaltyPoints;
629
+ };
594
630
  type CheckCartServiceabilityParam = {
595
631
  /**
596
632
  * - Ordering
@@ -31,6 +31,17 @@ const CartPlatformModel = require("./CartPlatformModel");
31
31
  * @property {CartPlatformModel.ApplyCouponDetails} body
32
32
  */
33
33
 
34
+ /**
35
+ * @typedef ApplyLoyaltyPointsParam
36
+ * @property {CartPlatformModel.OrderingSource} [xOrderingSource] - Ordering
37
+ * source header, to be used to identify source of order creation.
38
+ * @property {string} [id] - The unique identifier of the cart.
39
+ * @property {boolean} [i] - Select `true` to retrieve all the items added in the cart.
40
+ * @property {boolean} [b] - Select `true` to retrieve the price breakup of cart items.
41
+ * @property {boolean} [buyNow] - This is boolean to get buy_now cart.
42
+ * @property {CartPlatformModel.RedeemLoyaltyPoints} body
43
+ */
44
+
34
45
  /**
35
46
  * @typedef CheckCartServiceabilityParam
36
47
  * @property {CartPlatformModel.OrderingSource} [xOrderingSource] - Ordering
@@ -538,6 +549,19 @@ class CartPlatformApplicationValidator {
538
549
  }).required();
539
550
  }
540
551
 
552
+ /** @returns {ApplyLoyaltyPointsParam} */
553
+ static applyLoyaltyPoints() {
554
+ return Joi.object({
555
+ xOrderingSource: CartPlatformModel.OrderingSource(),
556
+
557
+ id: Joi.string().allow(""),
558
+ i: Joi.boolean(),
559
+ b: Joi.boolean(),
560
+ buyNow: Joi.boolean(),
561
+ body: CartPlatformModel.RedeemLoyaltyPoints().required(),
562
+ }).required();
563
+ }
564
+
541
565
  /** @returns {CheckCartServiceabilityParam} */
542
566
  static checkCartServiceability() {
543
567
  return Joi.object({