@gofynd/fdk-client-javascript 3.7.0 → 3.9.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 +1 -1
- package/package.json +1 -1
- package/sdk/application/Cart/CartApplicationClient.d.ts +7 -7
- package/sdk/application/Cart/CartApplicationClient.js +8 -8
- package/sdk/application/Payment/PaymentApplicationClient.d.ts +50 -0
- package/sdk/application/Payment/PaymentApplicationClient.js +210 -0
- package/sdk/application/Theme/ThemeApplicationClient.d.ts +2 -2
- package/sdk/application/Theme/ThemeApplicationClient.js +3 -1
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +11 -1
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +96 -1
- package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +37 -1
- package/sdk/platform/Cart/CartPlatformApplicationValidator.js +24 -0
- package/sdk/platform/Cart/CartPlatformModel.d.ts +155 -29
- package/sdk/platform/Cart/CartPlatformModel.js +83 -14
- package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +124 -6
- package/sdk/platform/Catalog/CatalogPlatformClient.js +1074 -175
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +1072 -45
- package/sdk/platform/Catalog/CatalogPlatformModel.js +714 -5
- package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +193 -19
- package/sdk/platform/Catalog/CatalogPlatformValidator.js +167 -14
- package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +9 -4
- package/sdk/platform/FileStorage/FileStoragePlatformModel.js +4 -4
- package/sdk/platform/Order/OrderPlatformClient.d.ts +1 -1
- package/sdk/platform/Order/OrderPlatformClient.js +1 -1
- package/sdk/platform/Order/OrderPlatformModel.d.ts +55 -3
- package/sdk/platform/Order/OrderPlatformModel.js +31 -1
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +0 -10
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +0 -4
- package/sdk/public/Content/ContentPublicClient.d.ts +2 -2
- package/sdk/public/Content/ContentPublicClient.js +4 -3
- package/sdk/public/Content/ContentPublicModel.d.ts +5 -0
- package/sdk/public/Content/ContentPublicModel.js +2 -0
- package/sdk/public/Content/ContentPublicValidator.d.ts +11 -3
- package/sdk/public/Content/ContentPublicValidator.js +7 -2
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.
|
|
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.9.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
|
@@ -6,7 +6,7 @@ declare class Cart {
|
|
|
6
6
|
addAddress: string;
|
|
7
7
|
addItems: string;
|
|
8
8
|
applyCoupon: string;
|
|
9
|
-
|
|
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
|
|
71
|
-
* @summary: Use
|
|
72
|
-
* @description: Users can redeem their accumulated
|
|
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
|
-
|
|
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,
|
|
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
|
|
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
|
-
|
|
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
|
|
207
|
-
* @summary: Use
|
|
208
|
-
* @description: Users can redeem their accumulated
|
|
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
|
|
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["
|
|
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,
|
|
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
|
|
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 } = {
|
|
@@ -3,8 +3,10 @@ declare class Payment {
|
|
|
3
3
|
constructor(_conf: any);
|
|
4
4
|
_conf: any;
|
|
5
5
|
_relativeUrls: {
|
|
6
|
+
addBeneficiary: string;
|
|
6
7
|
addBeneficiaryDetails: string;
|
|
7
8
|
addRefundBankAccountUsingOTP: string;
|
|
9
|
+
addRefundBeneficiaryUsingOTPSession: string;
|
|
8
10
|
attachCardToCustomer: string;
|
|
9
11
|
cancelPaymentLink: string;
|
|
10
12
|
cardDetails: string;
|
|
@@ -16,6 +18,7 @@ declare class Payment {
|
|
|
16
18
|
createPaymentOrder: string;
|
|
17
19
|
customerCreditSummary: string;
|
|
18
20
|
customerOnboard: string;
|
|
21
|
+
deleteBeneficiary: string;
|
|
19
22
|
deleteUserCard: string;
|
|
20
23
|
delinkWallet: string;
|
|
21
24
|
enableOrDisableRefundTransferMode: string;
|
|
@@ -29,6 +32,8 @@ declare class Payment {
|
|
|
29
32
|
getPaymentModeRoutes: string;
|
|
30
33
|
getPaymentModeRoutesPaymentLink: string;
|
|
31
34
|
getPosPaymentModeRoutes: string;
|
|
35
|
+
getRefundBeneficiaries: string;
|
|
36
|
+
getRefundBeneficiariesUsingOTPSession: string;
|
|
32
37
|
getRupifiBannerDetails: string;
|
|
33
38
|
getUserBeneficiariesDetail: string;
|
|
34
39
|
initialisePayment: string;
|
|
@@ -52,6 +57,15 @@ declare class Payment {
|
|
|
52
57
|
};
|
|
53
58
|
_urls: {};
|
|
54
59
|
updateUrls(urls: any): void;
|
|
60
|
+
/**
|
|
61
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
62
|
+
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
63
|
+
* @returns {Promise<AddBeneficiaryResponseDetails>} - Success response
|
|
64
|
+
* @name addBeneficiary
|
|
65
|
+
* @summary: Add a beneficiary for refunds
|
|
66
|
+
* @description: Adds a bank or UPI beneficiary to the user account for processing refunds. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/application/payment/addBeneficiary/).
|
|
67
|
+
*/
|
|
68
|
+
addBeneficiary({ body, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<AddBeneficiaryResponseDetails>;
|
|
55
69
|
/**
|
|
56
70
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
57
71
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
@@ -70,6 +84,15 @@ declare class Payment {
|
|
|
70
84
|
* @description: Add bank account specifically for refunds, employing OTP verification for security. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/application/payment/addRefundBankAccountUsingOTP/).
|
|
71
85
|
*/
|
|
72
86
|
addRefundBankAccountUsingOTP({ body, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<RefundAccountDetails>;
|
|
87
|
+
/**
|
|
88
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
89
|
+
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
90
|
+
* @returns {Promise<AddBeneficiaryResponseDetails>} - Success response
|
|
91
|
+
* @name addRefundBeneficiaryUsingOTPSession
|
|
92
|
+
* @summary: Add a beneficiary for refunds using OTP session
|
|
93
|
+
* @description: Adds a bank or UPI beneficiary to the user account after completing an OTP verification session. The beneficiary details are securely linked with the user's refund preferences and will be used for processing refunds against specific orders and shipments. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/application/payment/addRefundBeneficiaryUsingOTPSession/).
|
|
94
|
+
*/
|
|
95
|
+
addRefundBeneficiaryUsingOTPSession({ body, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<AddBeneficiaryResponseDetails>;
|
|
73
96
|
/**
|
|
74
97
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
75
98
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
@@ -169,6 +192,15 @@ declare class Payment {
|
|
|
169
192
|
* @description: Initiate the onboarding process for payment services, providing personal, business, and device information, along with marketplace details, to enable customer registration and credit availability. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/application/payment/customerOnboard/).
|
|
170
193
|
*/
|
|
171
194
|
customerOnboard({ body, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<CustomerOnboardingDetails>;
|
|
195
|
+
/**
|
|
196
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
197
|
+
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
198
|
+
* @returns {Promise<DeleteBeneficiaryDetails>} - Success response
|
|
199
|
+
* @name deleteBeneficiary
|
|
200
|
+
* @summary: Delete a refund beneficiary
|
|
201
|
+
* @description: This API endpoint is used to delete a refund beneficiary using their beneficiary ID. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/application/payment/deleteBeneficiary/).
|
|
202
|
+
*/
|
|
203
|
+
deleteBeneficiary({ id, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options, ...args: any[]): Promise<DeleteBeneficiaryDetails>;
|
|
172
204
|
/**
|
|
173
205
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
174
206
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
@@ -286,6 +318,24 @@ declare class Payment {
|
|
|
286
318
|
* @description: Get available payment methods on the payment page for POS, specifying the aggregator for each option, such as 'CARD powered by Juspay' and 'QR powered by Razorpay'. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/application/payment/getPosPaymentModeRoutes/).
|
|
287
319
|
*/
|
|
288
320
|
getPosPaymentModeRoutes({ amount, cartId, pincode, orderType, checkoutMode, refresh, cardReference, userDetails, requestHeaders, }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<PaymentModeRouteDetails>;
|
|
321
|
+
/**
|
|
322
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
323
|
+
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
324
|
+
* @returns {Promise<RefundBeneficiaries>} - Success response
|
|
325
|
+
* @name getRefundBeneficiaries
|
|
326
|
+
* @summary: Get Refund Beneficiaries
|
|
327
|
+
* @description: Returns a list of UPI and Bank refund beneficiaries associated with a user. Both `order_id` and `shipment_id` are optional query parameters. Use the optional filter_by enum parameter to refine the response. When the value of filter_by is order, the API returns only beneficiaries associated with the order. When the value of filter_by is shipment, it returns only beneficiaries associated with the shipment. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/application/payment/getRefundBeneficiaries/).
|
|
328
|
+
*/
|
|
329
|
+
getRefundBeneficiaries({ orderId, shipmentId, filterBy, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<RefundBeneficiaries>;
|
|
330
|
+
/**
|
|
331
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
332
|
+
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
333
|
+
* @returns {Promise<RefundBeneficiaries>} - Success response
|
|
334
|
+
* @name getRefundBeneficiariesUsingOTPSession
|
|
335
|
+
* @summary: Get Refund Beneficiaries using OTP session
|
|
336
|
+
* @description: Returns a list of UPI and Bank refund beneficiaries associated with a user for a given order and shipment. Use the optional filter_by enum parameter to refine the response. When the value of filter_by is order, the API returns only beneficiaries associated with the order. When the value of filter_by is shipment, it returns only beneficiaries associated with the shipment. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/application/payment/getRefundBeneficiariesUsingOTPSession/).
|
|
337
|
+
*/
|
|
338
|
+
getRefundBeneficiariesUsingOTPSession({ orderId, shipmentId, filterBy, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<RefundBeneficiaries>;
|
|
289
339
|
/**
|
|
290
340
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
291
341
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
@@ -12,9 +12,13 @@ class Payment {
|
|
|
12
12
|
constructor(_conf) {
|
|
13
13
|
this._conf = _conf;
|
|
14
14
|
this._relativeUrls = {
|
|
15
|
+
addBeneficiary:
|
|
16
|
+
"/service/application/payment/v2.0/refund/user/beneficiary",
|
|
15
17
|
addBeneficiaryDetails: "/service/application/payment/v1.0/refund/account",
|
|
16
18
|
addRefundBankAccountUsingOTP:
|
|
17
19
|
"/service/application/payment/v1.0/refund/account/otp",
|
|
20
|
+
addRefundBeneficiaryUsingOTPSession:
|
|
21
|
+
"/service/application/payment/v2.0/refund/user/beneficiary-otp",
|
|
18
22
|
attachCardToCustomer: "/service/application/payment/v1.0/card/attach",
|
|
19
23
|
cancelPaymentLink:
|
|
20
24
|
"/service/application/payment/v1.0/cancel-payment-link/",
|
|
@@ -32,6 +36,8 @@ class Payment {
|
|
|
32
36
|
customerCreditSummary:
|
|
33
37
|
"/service/application/payment/v1.0/payment/credit-summary/",
|
|
34
38
|
customerOnboard: "/service/application/payment/v1.0/credit-onboard/",
|
|
39
|
+
deleteBeneficiary:
|
|
40
|
+
"/service/application/payment/v1.0/refund/account/{id}",
|
|
35
41
|
deleteUserCard: "/service/application/payment/v1.0/card/remove",
|
|
36
42
|
delinkWallet:
|
|
37
43
|
"/service/application/payment/v1.0/payment/options/wallet/delink",
|
|
@@ -54,6 +60,10 @@ class Payment {
|
|
|
54
60
|
"/service/application/payment/v1.0/payment/options/link/",
|
|
55
61
|
getPosPaymentModeRoutes:
|
|
56
62
|
"/service/application/payment/v1.0/payment/options/pos",
|
|
63
|
+
getRefundBeneficiaries:
|
|
64
|
+
"/service/application/payment/v2.0/refund/user/beneficiary",
|
|
65
|
+
getRefundBeneficiariesUsingOTPSession:
|
|
66
|
+
"/service/application/payment/v2.0/refund/user/beneficiary-otp",
|
|
57
67
|
getRupifiBannerDetails: "/service/application/payment/v1.0/rupifi/banner",
|
|
58
68
|
getUserBeneficiariesDetail:
|
|
59
69
|
"/service/application/payment/v1.0/refund/user/beneficiary",
|
|
@@ -106,6 +116,43 @@ class Payment {
|
|
|
106
116
|
};
|
|
107
117
|
}
|
|
108
118
|
|
|
119
|
+
/**
|
|
120
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
121
|
+
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
122
|
+
* @returns {Promise<AddBeneficiaryResponseDetails>} - Success response
|
|
123
|
+
* @name addBeneficiary
|
|
124
|
+
* @summary: Add a beneficiary for refunds
|
|
125
|
+
* @description: Adds a bank or UPI beneficiary to the user account for processing refunds. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/application/payment/addBeneficiary/).
|
|
126
|
+
*/
|
|
127
|
+
async addBeneficiary(
|
|
128
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
129
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
130
|
+
) {
|
|
131
|
+
const query_params = {};
|
|
132
|
+
|
|
133
|
+
const xHeaders = {};
|
|
134
|
+
|
|
135
|
+
const response = await ApplicationAPIClient.execute(
|
|
136
|
+
this._conf,
|
|
137
|
+
"post",
|
|
138
|
+
constructUrl({
|
|
139
|
+
url: this._urls["addBeneficiary"],
|
|
140
|
+
params: {},
|
|
141
|
+
}),
|
|
142
|
+
query_params,
|
|
143
|
+
body,
|
|
144
|
+
{ ...xHeaders, ...requestHeaders },
|
|
145
|
+
{ responseHeaders }
|
|
146
|
+
);
|
|
147
|
+
|
|
148
|
+
let responseData = response;
|
|
149
|
+
if (responseHeaders) {
|
|
150
|
+
responseData = response[0];
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
return response;
|
|
154
|
+
}
|
|
155
|
+
|
|
109
156
|
/**
|
|
110
157
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
111
158
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
@@ -180,6 +227,43 @@ class Payment {
|
|
|
180
227
|
return response;
|
|
181
228
|
}
|
|
182
229
|
|
|
230
|
+
/**
|
|
231
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
232
|
+
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
233
|
+
* @returns {Promise<AddBeneficiaryResponseDetails>} - Success response
|
|
234
|
+
* @name addRefundBeneficiaryUsingOTPSession
|
|
235
|
+
* @summary: Add a beneficiary for refunds using OTP session
|
|
236
|
+
* @description: Adds a bank or UPI beneficiary to the user account after completing an OTP verification session. The beneficiary details are securely linked with the user's refund preferences and will be used for processing refunds against specific orders and shipments. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/application/payment/addRefundBeneficiaryUsingOTPSession/).
|
|
237
|
+
*/
|
|
238
|
+
async addRefundBeneficiaryUsingOTPSession(
|
|
239
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
240
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
241
|
+
) {
|
|
242
|
+
const query_params = {};
|
|
243
|
+
|
|
244
|
+
const xHeaders = {};
|
|
245
|
+
|
|
246
|
+
const response = await ApplicationAPIClient.execute(
|
|
247
|
+
this._conf,
|
|
248
|
+
"post",
|
|
249
|
+
constructUrl({
|
|
250
|
+
url: this._urls["addRefundBeneficiaryUsingOTPSession"],
|
|
251
|
+
params: {},
|
|
252
|
+
}),
|
|
253
|
+
query_params,
|
|
254
|
+
body,
|
|
255
|
+
{ ...xHeaders, ...requestHeaders },
|
|
256
|
+
{ responseHeaders }
|
|
257
|
+
);
|
|
258
|
+
|
|
259
|
+
let responseData = response;
|
|
260
|
+
if (responseHeaders) {
|
|
261
|
+
responseData = response[0];
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
return response;
|
|
265
|
+
}
|
|
266
|
+
|
|
183
267
|
/**
|
|
184
268
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
185
269
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
@@ -599,6 +683,52 @@ class Payment {
|
|
|
599
683
|
return response;
|
|
600
684
|
}
|
|
601
685
|
|
|
686
|
+
/**
|
|
687
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
688
|
+
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
689
|
+
* @returns {Promise<DeleteBeneficiaryDetails>} - Success response
|
|
690
|
+
* @name deleteBeneficiary
|
|
691
|
+
* @summary: Delete a refund beneficiary
|
|
692
|
+
* @description: This API endpoint is used to delete a refund beneficiary using their beneficiary ID. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/application/payment/deleteBeneficiary/).
|
|
693
|
+
*/
|
|
694
|
+
async deleteBeneficiary(
|
|
695
|
+
{ id, requestHeaders } = { requestHeaders: {} },
|
|
696
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
697
|
+
) {
|
|
698
|
+
const errors = validateRequiredParams(arguments[0], ["id"]);
|
|
699
|
+
if (errors.length > 0) {
|
|
700
|
+
const error = new FDKClientValidationError({
|
|
701
|
+
message: "Missing required field",
|
|
702
|
+
details: errors,
|
|
703
|
+
});
|
|
704
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
const query_params = {};
|
|
708
|
+
|
|
709
|
+
const xHeaders = {};
|
|
710
|
+
|
|
711
|
+
const response = await ApplicationAPIClient.execute(
|
|
712
|
+
this._conf,
|
|
713
|
+
"delete",
|
|
714
|
+
constructUrl({
|
|
715
|
+
url: this._urls["deleteBeneficiary"],
|
|
716
|
+
params: { id },
|
|
717
|
+
}),
|
|
718
|
+
query_params,
|
|
719
|
+
undefined,
|
|
720
|
+
{ ...xHeaders, ...requestHeaders },
|
|
721
|
+
{ responseHeaders }
|
|
722
|
+
);
|
|
723
|
+
|
|
724
|
+
let responseData = response;
|
|
725
|
+
if (responseHeaders) {
|
|
726
|
+
responseData = response[0];
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
return response;
|
|
730
|
+
}
|
|
731
|
+
|
|
602
732
|
/**
|
|
603
733
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
604
734
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
@@ -1126,6 +1256,86 @@ class Payment {
|
|
|
1126
1256
|
return response;
|
|
1127
1257
|
}
|
|
1128
1258
|
|
|
1259
|
+
/**
|
|
1260
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1261
|
+
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1262
|
+
* @returns {Promise<RefundBeneficiaries>} - Success response
|
|
1263
|
+
* @name getRefundBeneficiaries
|
|
1264
|
+
* @summary: Get Refund Beneficiaries
|
|
1265
|
+
* @description: Returns a list of UPI and Bank refund beneficiaries associated with a user. Both `order_id` and `shipment_id` are optional query parameters. Use the optional filter_by enum parameter to refine the response. When the value of filter_by is order, the API returns only beneficiaries associated with the order. When the value of filter_by is shipment, it returns only beneficiaries associated with the shipment. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/application/payment/getRefundBeneficiaries/).
|
|
1266
|
+
*/
|
|
1267
|
+
async getRefundBeneficiaries(
|
|
1268
|
+
{ orderId, shipmentId, filterBy, requestHeaders } = { requestHeaders: {} },
|
|
1269
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
1270
|
+
) {
|
|
1271
|
+
const query_params = {};
|
|
1272
|
+
query_params["order_id"] = orderId;
|
|
1273
|
+
query_params["shipment_id"] = shipmentId;
|
|
1274
|
+
query_params["filter_by"] = filterBy;
|
|
1275
|
+
|
|
1276
|
+
const xHeaders = {};
|
|
1277
|
+
|
|
1278
|
+
const response = await ApplicationAPIClient.execute(
|
|
1279
|
+
this._conf,
|
|
1280
|
+
"get",
|
|
1281
|
+
constructUrl({
|
|
1282
|
+
url: this._urls["getRefundBeneficiaries"],
|
|
1283
|
+
params: {},
|
|
1284
|
+
}),
|
|
1285
|
+
query_params,
|
|
1286
|
+
undefined,
|
|
1287
|
+
{ ...xHeaders, ...requestHeaders },
|
|
1288
|
+
{ responseHeaders }
|
|
1289
|
+
);
|
|
1290
|
+
|
|
1291
|
+
let responseData = response;
|
|
1292
|
+
if (responseHeaders) {
|
|
1293
|
+
responseData = response[0];
|
|
1294
|
+
}
|
|
1295
|
+
|
|
1296
|
+
return response;
|
|
1297
|
+
}
|
|
1298
|
+
|
|
1299
|
+
/**
|
|
1300
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1301
|
+
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1302
|
+
* @returns {Promise<RefundBeneficiaries>} - Success response
|
|
1303
|
+
* @name getRefundBeneficiariesUsingOTPSession
|
|
1304
|
+
* @summary: Get Refund Beneficiaries using OTP session
|
|
1305
|
+
* @description: Returns a list of UPI and Bank refund beneficiaries associated with a user for a given order and shipment. Use the optional filter_by enum parameter to refine the response. When the value of filter_by is order, the API returns only beneficiaries associated with the order. When the value of filter_by is shipment, it returns only beneficiaries associated with the shipment. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/application/payment/getRefundBeneficiariesUsingOTPSession/).
|
|
1306
|
+
*/
|
|
1307
|
+
async getRefundBeneficiariesUsingOTPSession(
|
|
1308
|
+
{ orderId, shipmentId, filterBy, requestHeaders } = { requestHeaders: {} },
|
|
1309
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
1310
|
+
) {
|
|
1311
|
+
const query_params = {};
|
|
1312
|
+
query_params["order_id"] = orderId;
|
|
1313
|
+
query_params["shipment_id"] = shipmentId;
|
|
1314
|
+
query_params["filter_by"] = filterBy;
|
|
1315
|
+
|
|
1316
|
+
const xHeaders = {};
|
|
1317
|
+
|
|
1318
|
+
const response = await ApplicationAPIClient.execute(
|
|
1319
|
+
this._conf,
|
|
1320
|
+
"get",
|
|
1321
|
+
constructUrl({
|
|
1322
|
+
url: this._urls["getRefundBeneficiariesUsingOTPSession"],
|
|
1323
|
+
params: {},
|
|
1324
|
+
}),
|
|
1325
|
+
query_params,
|
|
1326
|
+
undefined,
|
|
1327
|
+
{ ...xHeaders, ...requestHeaders },
|
|
1328
|
+
{ responseHeaders }
|
|
1329
|
+
);
|
|
1330
|
+
|
|
1331
|
+
let responseData = response;
|
|
1332
|
+
if (responseHeaders) {
|
|
1333
|
+
responseData = response[0];
|
|
1334
|
+
}
|
|
1335
|
+
|
|
1336
|
+
return response;
|
|
1337
|
+
}
|
|
1338
|
+
|
|
1129
1339
|
/**
|
|
1130
1340
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1131
1341
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
@@ -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,
|
|
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,
|
|
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: {} },
|