@gofynd/fdk-client-javascript 1.2.0 → 1.3.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 +44 -7
- package/package.json +1 -2
- package/sdk/application/ApplicationAPIClient.d.ts +3 -3
- package/sdk/application/ApplicationAPIClient.js +6 -4
- package/sdk/application/ApplicationClient.d.ts +2 -3
- package/sdk/application/ApplicationClient.js +1 -45
- package/sdk/application/ApplicationConfig.d.ts +46 -6
- package/sdk/application/ApplicationConfig.js +15 -16
- package/sdk/application/Cart/CartApplicationClient.d.ts +61 -33
- package/sdk/application/Cart/CartApplicationClient.js +225 -134
- package/sdk/application/Cart/CartApplicationModel.d.ts +4 -4
- package/sdk/application/Cart/CartApplicationModel.js +4 -4
- package/sdk/application/Catalog/CatalogApplicationClient.d.ts +61 -30
- package/sdk/application/Catalog/CatalogApplicationClient.js +234 -146
- package/sdk/application/Catalog/CatalogApplicationModel.d.ts +115 -13
- package/sdk/application/Catalog/CatalogApplicationModel.js +77 -12
- package/sdk/application/Common/CommonApplicationClient.d.ts +5 -3
- package/sdk/application/Common/CommonApplicationClient.js +13 -11
- package/sdk/application/Common/CommonApplicationModel.d.ts +3 -83
- package/sdk/application/Common/CommonApplicationModel.js +2 -58
- package/sdk/application/Communication/CommunicationApplicationClient.d.ts +9 -3
- package/sdk/application/Communication/CommunicationApplicationClient.js +25 -13
- package/sdk/application/Communication/CommunicationApplicationModel.d.ts +1 -34
- package/sdk/application/Communication/CommunicationApplicationModel.js +0 -36
- package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +46 -16
- package/sdk/application/Configuration/ConfigurationApplicationClient.js +144 -68
- package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +1 -219
- package/sdk/application/Configuration/ConfigurationApplicationModel.js +0 -226
- package/sdk/application/Content/ContentApplicationClient.d.ts +49 -21
- package/sdk/application/Content/ContentApplicationClient.js +159 -80
- package/sdk/application/Content/ContentApplicationModel.d.ts +5 -622
- package/sdk/application/Content/ContentApplicationModel.js +11 -763
- package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +6 -3
- package/sdk/application/FileStorage/FileStorageApplicationClient.js +20 -14
- package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +1 -152
- package/sdk/application/FileStorage/FileStorageApplicationModel.js +0 -180
- package/sdk/application/Lead/LeadApplicationClient.d.ts +14 -7
- package/sdk/application/Lead/LeadApplicationClient.js +50 -31
- package/sdk/application/Lead/LeadApplicationModel.d.ts +22 -741
- package/sdk/application/Lead/LeadApplicationModel.js +21 -481
- package/sdk/application/Logistic/LogisticApplicationClient.d.ts +11 -5
- package/sdk/application/Logistic/LogisticApplicationClient.js +41 -20
- package/sdk/application/Order/OrderApplicationClient.d.ts +24 -12
- package/sdk/application/Order/OrderApplicationClient.js +88 -56
- package/sdk/application/Payment/PaymentApplicationClient.d.ts +91 -42
- package/sdk/application/Payment/PaymentApplicationClient.js +293 -194
- package/sdk/application/Payment/PaymentApplicationModel.d.ts +36 -36
- package/sdk/application/Payment/PaymentApplicationModel.js +36 -36
- package/sdk/application/PosCart/PosCartApplicationClient.d.ts +59 -32
- package/sdk/application/PosCart/PosCartApplicationClient.js +214 -130
- package/sdk/application/PosCart/PosCartApplicationModel.d.ts +2 -2
- package/sdk/application/PosCart/PosCartApplicationModel.js +2 -2
- package/sdk/application/Rewards/RewardsApplicationClient.d.ts +16 -7
- package/sdk/application/Rewards/RewardsApplicationClient.js +56 -29
- package/sdk/application/Share/ShareApplicationClient.d.ts +15 -7
- package/sdk/application/Share/ShareApplicationClient.js +51 -31
- package/sdk/application/Share/ShareApplicationModel.d.ts +1 -33
- package/sdk/application/Share/ShareApplicationModel.js +0 -38
- package/sdk/application/Theme/ThemeApplicationClient.d.ts +9 -4
- package/sdk/application/Theme/ThemeApplicationClient.js +35 -18
- package/sdk/application/Theme/ThemeApplicationModel.d.ts +982 -312
- package/sdk/application/Theme/ThemeApplicationModel.js +621 -284
- package/sdk/application/User/UserApplicationClient.d.ts +74 -35
- package/sdk/application/User/UserApplicationClient.js +252 -161
- package/sdk/application/User/UserApplicationModel.d.ts +3 -401
- package/sdk/application/User/UserApplicationModel.js +2 -490
- package/sdk/common/AxiosHelper.js +1 -2
- package/sdk/common/FDKError.d.ts +3 -0
- package/sdk/common/FDKError.js +8 -0
- package/sdk/common/utils.d.ts +3 -0
- package/sdk/common/utils.js +29 -0
- package/sdk/partner/PartnerAPIClient.d.ts +5 -4
- package/sdk/partner/PartnerAPIClient.js +7 -4
- package/sdk/partner/PartnerClient.d.ts +2 -0
- package/sdk/partner/PartnerClient.js +3 -0
- package/sdk/partner/Theme/ThemePartnerClient.d.ts +299 -0
- package/sdk/partner/Theme/ThemePartnerClient.js +768 -0
- package/sdk/partner/Theme/ThemePartnerModel.d.ts +1706 -0
- package/sdk/partner/Theme/ThemePartnerModel.js +1409 -0
- package/sdk/partner/Theme/ThemePartnerValidator.d.ts +22 -0
- package/sdk/partner/Theme/ThemePartnerValidator.js +157 -0
- package/sdk/partner/index.d.ts +3 -1
- package/sdk/partner/index.js +3 -1
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +8 -4
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +38 -16
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.d.ts +1 -13
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.js +0 -12
- package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.d.ts +10 -0
- package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.js +4 -0
- package/sdk/platform/Billing/BillingPlatformClient.d.ts +59 -14
- package/sdk/platform/Billing/BillingPlatformClient.js +315 -64
- package/sdk/platform/Billing/BillingPlatformModel.d.ts +56 -196
- package/sdk/platform/Billing/BillingPlatformModel.js +63 -217
- package/sdk/platform/Billing/BillingPlatformValidator.d.ts +23 -1
- package/sdk/platform/Billing/BillingPlatformValidator.js +31 -0
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +124 -63
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +431 -265
- package/sdk/platform/Cart/CartPlatformModel.d.ts +253 -53
- package/sdk/platform/Cart/CartPlatformModel.js +104 -54
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +120 -53
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +398 -247
- package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +155 -78
- package/sdk/platform/Catalog/CatalogPlatformClient.js +561 -355
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +10 -12
- package/sdk/platform/Catalog/CatalogPlatformModel.js +10 -12
- package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +30 -0
- package/sdk/platform/Catalog/CatalogPlatformValidator.js +13 -0
- package/sdk/platform/Common/CommonPlatformClient.d.ts +5 -3
- package/sdk/platform/Common/CommonPlatformClient.js +13 -11
- package/sdk/platform/Common/CommonPlatformModel.d.ts +39 -64
- package/sdk/platform/Common/CommonPlatformModel.js +23 -57
- package/sdk/platform/Common/CommonPlatformValidator.d.ts +5 -10
- package/sdk/platform/Common/CommonPlatformValidator.js +3 -4
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +370 -120
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +2328 -888
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +143 -24
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +179 -15
- package/sdk/platform/Communication/CommunicationPlatformClient.d.ts +2 -1
- package/sdk/platform/Communication/CommunicationPlatformClient.js +6 -5
- package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +386 -308
- package/sdk/platform/Communication/CommunicationPlatformModel.js +415 -355
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +38 -13
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +171 -57
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +53 -1
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +54 -0
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.d.ts +5 -1
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.js +7 -0
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +96 -29
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +311 -126
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.d.ts +5 -1
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.js +7 -0
- package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +36 -18
- package/sdk/platform/Configuration/ConfigurationPlatformClient.js +121 -86
- package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +13 -180
- package/sdk/platform/Configuration/ConfigurationPlatformModel.js +5 -113
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +162 -70
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +528 -309
- package/sdk/platform/Content/ContentPlatformModel.d.ts +9 -198
- package/sdk/platform/Content/ContentPlatformModel.js +8 -231
- package/sdk/platform/Discount/DiscountPlatformClient.d.ts +48 -11
- package/sdk/platform/Discount/DiscountPlatformClient.js +142 -48
- package/sdk/platform/Discount/DiscountPlatformModel.d.ts +40 -1
- package/sdk/platform/Discount/DiscountPlatformModel.js +27 -0
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +84 -18
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +486 -53
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +71 -7
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +81 -5
- package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +13 -18
- package/sdk/platform/FileStorage/FileStoragePlatformClient.js +58 -65
- package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +198 -71
- package/sdk/platform/FileStorage/FileStoragePlatformModel.js +212 -64
- package/sdk/platform/FileStorage/FileStoragePlatformValidator.d.ts +18 -10
- package/sdk/platform/FileStorage/FileStoragePlatformValidator.js +11 -6
- package/sdk/platform/Finance/FinancePlatformClient.d.ts +177 -40
- package/sdk/platform/Finance/FinancePlatformClient.js +1028 -132
- package/sdk/platform/Finance/FinancePlatformModel.d.ts +670 -22
- package/sdk/platform/Finance/FinancePlatformModel.js +809 -23
- package/sdk/platform/Finance/FinancePlatformValidator.d.ts +111 -1
- package/sdk/platform/Finance/FinancePlatformValidator.js +134 -0
- package/sdk/platform/Inventory/InventoryPlatformClient.d.ts +24 -12
- package/sdk/platform/Inventory/InventoryPlatformClient.js +94 -52
- package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +27 -13
- package/sdk/platform/Lead/LeadPlatformApplicationClient.js +101 -55
- package/sdk/platform/Lead/LeadPlatformClient.d.ts +50 -39
- package/sdk/platform/Lead/LeadPlatformClient.js +171 -112
- package/sdk/platform/Lead/LeadPlatformModel.d.ts +32 -390
- package/sdk/platform/Lead/LeadPlatformModel.js +31 -214
- package/sdk/platform/Lead/LeadPlatformValidator.d.ts +33 -33
- package/sdk/platform/Lead/LeadPlatformValidator.js +23 -23
- package/sdk/platform/OAuthClient.js +6 -2
- package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +4 -2
- package/sdk/platform/Order/OrderPlatformApplicationClient.js +12 -10
- package/sdk/platform/Order/OrderPlatformClient.d.ts +165 -71
- package/sdk/platform/Order/OrderPlatformClient.js +738 -205
- package/sdk/platform/Order/OrderPlatformModel.d.ts +261 -3
- package/sdk/platform/Order/OrderPlatformModel.js +225 -2
- package/sdk/platform/Order/OrderPlatformValidator.d.ts +104 -3
- package/sdk/platform/Order/OrderPlatformValidator.js +85 -2
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +4 -22
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +12 -159
- package/sdk/platform/Partner/PartnerPlatformApplicationValidator.d.ts +1 -30
- package/sdk/platform/Partner/PartnerPlatformApplicationValidator.js +0 -26
- package/sdk/platform/Partner/PartnerPlatformModel.d.ts +1 -690
- package/sdk/platform/Partner/PartnerPlatformModel.js +0 -809
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +167 -32
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +793 -145
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +91 -1
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +91 -0
- package/sdk/platform/Payment/PaymentPlatformClient.d.ts +20 -10
- package/sdk/platform/Payment/PaymentPlatformClient.js +68 -47
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +549 -7
- package/sdk/platform/Payment/PaymentPlatformModel.js +305 -6
- package/sdk/platform/PlatformAPIClient.d.ts +3 -3
- package/sdk/platform/PlatformAPIClient.js +2 -2
- package/sdk/platform/PlatformClient.d.ts +2 -2
- package/sdk/platform/PlatformClient.js +4 -4
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +28 -12
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +90 -53
- package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +1 -12
- package/sdk/platform/Rewards/RewardsPlatformModel.js +0 -14
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +62 -26
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +210 -93
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.d.ts +20 -11
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.js +23 -11
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +36 -18
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +142 -78
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +12 -3
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +14 -2
- package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +10 -26
- package/sdk/platform/Share/SharePlatformApplicationClient.js +36 -67
- package/sdk/platform/Share/SharePlatformModel.d.ts +4 -4
- package/sdk/platform/Share/SharePlatformModel.js +4 -4
- package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +127 -57
- package/sdk/platform/Theme/ThemePlatformApplicationClient.js +564 -189
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +63 -26
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +62 -22
- package/sdk/platform/Theme/ThemePlatformClient.d.ts +37 -0
- package/sdk/platform/Theme/ThemePlatformClient.js +235 -0
- package/sdk/platform/Theme/ThemePlatformModel.d.ts +1167 -261
- package/sdk/platform/Theme/ThemePlatformModel.js +801 -244
- package/sdk/platform/Theme/ThemePlatformValidator.d.ts +32 -0
- package/sdk/platform/Theme/ThemePlatformValidator.js +38 -0
- package/sdk/platform/User/UserPlatformApplicationClient.d.ts +35 -17
- package/sdk/platform/User/UserPlatformApplicationClient.js +132 -73
- package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +7 -0
- package/sdk/platform/User/UserPlatformApplicationValidator.js +3 -0
- package/sdk/platform/User/UserPlatformModel.d.ts +1 -738
- package/sdk/platform/User/UserPlatformModel.js +3 -899
- package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +120 -7
- package/sdk/platform/Webhook/WebhookPlatformClient.js +799 -41
- package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +476 -86
- package/sdk/platform/Webhook/WebhookPlatformModel.js +388 -89
- package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +96 -9
- package/sdk/platform/Webhook/WebhookPlatformValidator.js +117 -5
- package/sdk/public/Configuration/ConfigurationPublicClient.d.ts +5 -3
- package/sdk/public/Configuration/ConfigurationPublicClient.js +13 -11
- package/sdk/public/Configuration/ConfigurationPublicModel.d.ts +3 -106
- package/sdk/public/Configuration/ConfigurationPublicModel.js +2 -59
- package/sdk/public/Inventory/InventoryPublicClient.d.ts +12 -6
- package/sdk/public/Inventory/InventoryPublicClient.js +42 -27
- package/sdk/public/Partner/PartnerPublicClient.d.ts +22 -0
- package/sdk/public/Partner/PartnerPublicClient.js +110 -0
- package/sdk/public/Partner/PartnerPublicModel.d.ts +240 -0
- package/sdk/public/Partner/PartnerPublicModel.js +280 -0
- package/sdk/public/Partner/PartnerPublicValidator.d.ts +18 -0
- package/sdk/public/Partner/PartnerPublicValidator.js +19 -0
- package/sdk/public/PublicAPIClient.d.ts +14 -1
- package/sdk/public/PublicAPIClient.js +7 -1
- package/sdk/public/PublicClient.d.ts +2 -0
- package/sdk/public/PublicClient.js +4 -0
- package/sdk/public/Webhook/WebhookPublicClient.d.ts +5 -2
- package/sdk/public/Webhook/WebhookPublicClient.js +15 -9
- package/sdk/public/Webhook/WebhookPublicModel.d.ts +1 -191
- package/sdk/public/Webhook/WebhookPublicModel.js +0 -229
- package/sdk/public/index.d.ts +1 -0
- package/sdk/public/index.js +2 -0
- package/sdk/application/ApplicationModels.d.ts +0 -48
- package/sdk/application/ApplicationModels.js +0 -38
- package/sdk/platform/Partner/PartnerPlatformClient.d.ts +0 -106
- package/sdk/platform/Partner/PartnerPlatformClient.js +0 -878
- package/sdk/platform/Partner/PartnerPlatformValidator.d.ts +0 -208
- package/sdk/platform/Partner/PartnerPlatformValidator.js +0 -169
|
@@ -61,13 +61,17 @@ class PosCart {
|
|
|
61
61
|
|
|
62
62
|
/**
|
|
63
63
|
* @param {PosCartApplicationValidator.AddAddressParam} arg - Arg object.
|
|
64
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
64
65
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
65
66
|
* @returns {Promise<PosCartApplicationModel.SaveAddressResponse>} - Success response
|
|
66
67
|
* @name addAddress
|
|
67
68
|
* @summary: Add address to an account
|
|
68
69
|
* @description: Use this API to add an address to an account. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/poscart/addAddress/).
|
|
69
70
|
*/
|
|
70
|
-
async addAddress(
|
|
71
|
+
async addAddress(
|
|
72
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
73
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
74
|
+
) {
|
|
71
75
|
const { error } = PosCartApplicationValidator.addAddress().validate(
|
|
72
76
|
{ body },
|
|
73
77
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -103,12 +107,12 @@ class PosCart {
|
|
|
103
107
|
}),
|
|
104
108
|
query_params,
|
|
105
109
|
body,
|
|
106
|
-
xHeaders,
|
|
107
|
-
{
|
|
110
|
+
{ ...xHeaders, ...requestHeaders },
|
|
111
|
+
{ responseHeaders }
|
|
108
112
|
);
|
|
109
113
|
|
|
110
114
|
let responseData = response;
|
|
111
|
-
if (
|
|
115
|
+
if (responseHeaders) {
|
|
112
116
|
responseData = response[0];
|
|
113
117
|
}
|
|
114
118
|
|
|
@@ -131,6 +135,7 @@ class PosCart {
|
|
|
131
135
|
|
|
132
136
|
/**
|
|
133
137
|
* @param {PosCartApplicationValidator.AddItemsParam} arg - Arg object.
|
|
138
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
134
139
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
135
140
|
* @returns {Promise<PosCartApplicationModel.AddCartDetailResponse>} -
|
|
136
141
|
* Success response
|
|
@@ -139,8 +144,10 @@ class PosCart {
|
|
|
139
144
|
* @description: Use this API to add items to the cart. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/poscart/addItems/).
|
|
140
145
|
*/
|
|
141
146
|
async addItems(
|
|
142
|
-
{ body, i, b, areaCode, buyNow, id } = {
|
|
143
|
-
|
|
147
|
+
{ body, i, b, areaCode, buyNow, id, requestHeaders } = {
|
|
148
|
+
requestHeaders: {},
|
|
149
|
+
},
|
|
150
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
144
151
|
) {
|
|
145
152
|
const { error } = PosCartApplicationValidator.addItems().validate(
|
|
146
153
|
{ body, i, b, areaCode, buyNow, id },
|
|
@@ -180,12 +187,12 @@ class PosCart {
|
|
|
180
187
|
}),
|
|
181
188
|
query_params,
|
|
182
189
|
body,
|
|
183
|
-
xHeaders,
|
|
184
|
-
{
|
|
190
|
+
{ ...xHeaders, ...requestHeaders },
|
|
191
|
+
{ responseHeaders }
|
|
185
192
|
);
|
|
186
193
|
|
|
187
194
|
let responseData = response;
|
|
188
|
-
if (
|
|
195
|
+
if (responseHeaders) {
|
|
189
196
|
responseData = response[0];
|
|
190
197
|
}
|
|
191
198
|
|
|
@@ -208,6 +215,7 @@ class PosCart {
|
|
|
208
215
|
|
|
209
216
|
/**
|
|
210
217
|
* @param {PosCartApplicationValidator.ApplyCouponParam} arg - Arg object.
|
|
218
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
211
219
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
212
220
|
* @returns {Promise<PosCartApplicationModel.CartDetailResponse>} - Success response
|
|
213
221
|
* @name applyCoupon
|
|
@@ -215,8 +223,8 @@ class PosCart {
|
|
|
215
223
|
* @description: Use this API to apply coupons on items in the cart. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/poscart/applyCoupon/).
|
|
216
224
|
*/
|
|
217
225
|
async applyCoupon(
|
|
218
|
-
{ body, i, b, p, id, buyNow } = {},
|
|
219
|
-
{
|
|
226
|
+
{ body, i, b, p, id, buyNow, requestHeaders } = { requestHeaders: {} },
|
|
227
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
220
228
|
) {
|
|
221
229
|
const { error } = PosCartApplicationValidator.applyCoupon().validate(
|
|
222
230
|
{ body, i, b, p, id, buyNow },
|
|
@@ -258,12 +266,12 @@ class PosCart {
|
|
|
258
266
|
}),
|
|
259
267
|
query_params,
|
|
260
268
|
body,
|
|
261
|
-
xHeaders,
|
|
262
|
-
{
|
|
269
|
+
{ ...xHeaders, ...requestHeaders },
|
|
270
|
+
{ responseHeaders }
|
|
263
271
|
);
|
|
264
272
|
|
|
265
273
|
let responseData = response;
|
|
266
|
-
if (
|
|
274
|
+
if (responseHeaders) {
|
|
267
275
|
responseData = response[0];
|
|
268
276
|
}
|
|
269
277
|
|
|
@@ -286,6 +294,7 @@ class PosCart {
|
|
|
286
294
|
|
|
287
295
|
/**
|
|
288
296
|
* @param {PosCartApplicationValidator.ApplyRewardPointsParam} arg - Arg object.
|
|
297
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
289
298
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
290
299
|
* @returns {Promise<PosCartApplicationModel.CartDetailResponse>} - Success response
|
|
291
300
|
* @name applyRewardPoints
|
|
@@ -293,8 +302,8 @@ class PosCart {
|
|
|
293
302
|
* @description: Use this API to redeem a fixed no. of reward points by applying it to the cart. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/poscart/applyRewardPoints/).
|
|
294
303
|
*/
|
|
295
304
|
async applyRewardPoints(
|
|
296
|
-
{ body, id, i, b, buyNow } = {},
|
|
297
|
-
{
|
|
305
|
+
{ body, id, i, b, buyNow, requestHeaders } = { requestHeaders: {} },
|
|
306
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
298
307
|
) {
|
|
299
308
|
const { error } = PosCartApplicationValidator.applyRewardPoints().validate(
|
|
300
309
|
{ body, id, i, b, buyNow },
|
|
@@ -335,12 +344,12 @@ class PosCart {
|
|
|
335
344
|
}),
|
|
336
345
|
query_params,
|
|
337
346
|
body,
|
|
338
|
-
xHeaders,
|
|
339
|
-
{
|
|
347
|
+
{ ...xHeaders, ...requestHeaders },
|
|
348
|
+
{ responseHeaders }
|
|
340
349
|
);
|
|
341
350
|
|
|
342
351
|
let responseData = response;
|
|
343
|
-
if (
|
|
352
|
+
if (responseHeaders) {
|
|
344
353
|
responseData = response[0];
|
|
345
354
|
}
|
|
346
355
|
|
|
@@ -363,13 +372,17 @@ class PosCart {
|
|
|
363
372
|
|
|
364
373
|
/**
|
|
365
374
|
* @param {PosCartApplicationValidator.CheckoutCartParam} arg - Arg object.
|
|
375
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
366
376
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
367
377
|
* @returns {Promise<PosCartApplicationModel.CartCheckoutResponse>} - Success response
|
|
368
378
|
* @name checkoutCart
|
|
369
379
|
* @summary: Checkout all items in the cart
|
|
370
380
|
* @description: Use this API to checkout all items in the cart for payment and order generation. For COD, order will be generated directly, whereas for other checkout modes, user will be redirected to a payment gateway. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/poscart/checkoutCart/).
|
|
371
381
|
*/
|
|
372
|
-
async checkoutCart(
|
|
382
|
+
async checkoutCart(
|
|
383
|
+
{ body, id, requestHeaders } = { requestHeaders: {} },
|
|
384
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
385
|
+
) {
|
|
373
386
|
const { error } = PosCartApplicationValidator.checkoutCart().validate(
|
|
374
387
|
{ body, id },
|
|
375
388
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -406,12 +419,12 @@ class PosCart {
|
|
|
406
419
|
}),
|
|
407
420
|
query_params,
|
|
408
421
|
body,
|
|
409
|
-
xHeaders,
|
|
410
|
-
{
|
|
422
|
+
{ ...xHeaders, ...requestHeaders },
|
|
423
|
+
{ responseHeaders }
|
|
411
424
|
);
|
|
412
425
|
|
|
413
426
|
let responseData = response;
|
|
414
|
-
if (
|
|
427
|
+
if (responseHeaders) {
|
|
415
428
|
responseData = response[0];
|
|
416
429
|
}
|
|
417
430
|
|
|
@@ -434,15 +447,25 @@ class PosCart {
|
|
|
434
447
|
|
|
435
448
|
/**
|
|
436
449
|
* @param {PosCartApplicationValidator.GetAddressByIdParam} arg - Arg object.
|
|
450
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
437
451
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
438
452
|
* @returns {Promise<PosCartApplicationModel.Address>} - Success response
|
|
439
453
|
* @name getAddressById
|
|
440
454
|
* @summary: Fetch a single address by its ID
|
|
441
|
-
* @description: Use this API to get an addresses using its ID. If successful, returns a Address resource in the response body specified in `Address`. Attibutes listed below are optional
|
|
455
|
+
* @description: Use this API to get an addresses using its ID. If successful, returns a Address resource in the response body specified in `Address`. Attibutes listed below are optional - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/poscart/getAddressById/).
|
|
442
456
|
*/
|
|
443
457
|
async getAddressById(
|
|
444
|
-
{
|
|
445
|
-
|
|
458
|
+
{
|
|
459
|
+
id,
|
|
460
|
+
cartId,
|
|
461
|
+
buyNow,
|
|
462
|
+
mobileNo,
|
|
463
|
+
checkoutMode,
|
|
464
|
+
tags,
|
|
465
|
+
isDefault,
|
|
466
|
+
requestHeaders,
|
|
467
|
+
} = { requestHeaders: {} },
|
|
468
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
446
469
|
) {
|
|
447
470
|
const { error } = PosCartApplicationValidator.getAddressById().validate(
|
|
448
471
|
{ id, cartId, buyNow, mobileNo, checkoutMode, tags, isDefault },
|
|
@@ -485,12 +508,12 @@ class PosCart {
|
|
|
485
508
|
}),
|
|
486
509
|
query_params,
|
|
487
510
|
undefined,
|
|
488
|
-
xHeaders,
|
|
489
|
-
{
|
|
511
|
+
{ ...xHeaders, ...requestHeaders },
|
|
512
|
+
{ responseHeaders }
|
|
490
513
|
);
|
|
491
514
|
|
|
492
515
|
let responseData = response;
|
|
493
|
-
if (
|
|
516
|
+
if (responseHeaders) {
|
|
494
517
|
responseData = response[0];
|
|
495
518
|
}
|
|
496
519
|
|
|
@@ -513,15 +536,24 @@ class PosCart {
|
|
|
513
536
|
|
|
514
537
|
/**
|
|
515
538
|
* @param {PosCartApplicationValidator.GetAddressesParam} arg - Arg object.
|
|
539
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
516
540
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
517
541
|
* @returns {Promise<PosCartApplicationModel.GetAddressesResponse>} - Success response
|
|
518
542
|
* @name getAddresses
|
|
519
543
|
* @summary: Fetch address
|
|
520
|
-
* @description: Use this API to get all the addresses associated with an account. If successful, returns a Address resource in the response body specified in GetAddressesResponse.attibutes listed below are optional
|
|
544
|
+
* @description: Use this API to get all the addresses associated with an account. If successful, returns a Address resource in the response body specified in GetAddressesResponse.attibutes listed below are optional - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/poscart/getAddresses/).
|
|
521
545
|
*/
|
|
522
546
|
async getAddresses(
|
|
523
|
-
{
|
|
524
|
-
|
|
547
|
+
{
|
|
548
|
+
cartId,
|
|
549
|
+
buyNow,
|
|
550
|
+
mobileNo,
|
|
551
|
+
checkoutMode,
|
|
552
|
+
tags,
|
|
553
|
+
isDefault,
|
|
554
|
+
requestHeaders,
|
|
555
|
+
} = { requestHeaders: {} },
|
|
556
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
525
557
|
) {
|
|
526
558
|
const { error } = PosCartApplicationValidator.getAddresses().validate(
|
|
527
559
|
{ cartId, buyNow, mobileNo, checkoutMode, tags, isDefault },
|
|
@@ -564,12 +596,12 @@ class PosCart {
|
|
|
564
596
|
}),
|
|
565
597
|
query_params,
|
|
566
598
|
undefined,
|
|
567
|
-
xHeaders,
|
|
568
|
-
{
|
|
599
|
+
{ ...xHeaders, ...requestHeaders },
|
|
600
|
+
{ responseHeaders }
|
|
569
601
|
);
|
|
570
602
|
|
|
571
603
|
let responseData = response;
|
|
572
|
-
if (
|
|
604
|
+
if (responseHeaders) {
|
|
573
605
|
responseData = response[0];
|
|
574
606
|
}
|
|
575
607
|
|
|
@@ -594,6 +626,7 @@ class PosCart {
|
|
|
594
626
|
* @param {PosCartApplicationValidator.GetAvailableDeliveryModesParam} arg
|
|
595
627
|
* - Arg object.
|
|
596
628
|
*
|
|
629
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
597
630
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
598
631
|
* @returns {Promise<PosCartApplicationModel.CartDeliveryModesResponse>} -
|
|
599
632
|
* Success response
|
|
@@ -602,8 +635,8 @@ class PosCart {
|
|
|
602
635
|
* @description: Use this API to get the delivery modes (home-delivery/store-pickup) along with a list of pickup stores available for a given cart at a given PIN Code. User can then view the address of a pickup store with the help of store-address API. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/poscart/getAvailableDeliveryModes/).
|
|
603
636
|
*/
|
|
604
637
|
async getAvailableDeliveryModes(
|
|
605
|
-
{ areaCode, id } = {},
|
|
606
|
-
{
|
|
638
|
+
{ areaCode, id, requestHeaders } = { requestHeaders: {} },
|
|
639
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
607
640
|
) {
|
|
608
641
|
const {
|
|
609
642
|
error,
|
|
@@ -644,12 +677,12 @@ class PosCart {
|
|
|
644
677
|
}),
|
|
645
678
|
query_params,
|
|
646
679
|
undefined,
|
|
647
|
-
xHeaders,
|
|
648
|
-
{
|
|
680
|
+
{ ...xHeaders, ...requestHeaders },
|
|
681
|
+
{ responseHeaders }
|
|
649
682
|
);
|
|
650
683
|
|
|
651
684
|
let responseData = response;
|
|
652
|
-
if (
|
|
685
|
+
if (responseHeaders) {
|
|
653
686
|
responseData = response[0];
|
|
654
687
|
}
|
|
655
688
|
|
|
@@ -672,6 +705,7 @@ class PosCart {
|
|
|
672
705
|
|
|
673
706
|
/**
|
|
674
707
|
* @param {PosCartApplicationValidator.GetBulkDiscountOffersParam} arg - Arg object.
|
|
708
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
675
709
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
676
710
|
* @returns {Promise<PosCartApplicationModel.BulkPriceResponse>} - Success response
|
|
677
711
|
* @name getBulkDiscountOffers
|
|
@@ -679,8 +713,8 @@ class PosCart {
|
|
|
679
713
|
* @description: Use this API to get a list of applicable offers along with current, next and best offer for given product. Either one of uid, item_id, slug should be present. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/poscart/getBulkDiscountOffers/).
|
|
680
714
|
*/
|
|
681
715
|
async getBulkDiscountOffers(
|
|
682
|
-
{ itemId, articleId, uid, slug } = {},
|
|
683
|
-
{
|
|
716
|
+
{ itemId, articleId, uid, slug, requestHeaders } = { requestHeaders: {} },
|
|
717
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
684
718
|
) {
|
|
685
719
|
const {
|
|
686
720
|
error,
|
|
@@ -723,12 +757,12 @@ class PosCart {
|
|
|
723
757
|
}),
|
|
724
758
|
query_params,
|
|
725
759
|
undefined,
|
|
726
|
-
xHeaders,
|
|
727
|
-
{
|
|
760
|
+
{ ...xHeaders, ...requestHeaders },
|
|
761
|
+
{ responseHeaders }
|
|
728
762
|
);
|
|
729
763
|
|
|
730
764
|
let responseData = response;
|
|
731
|
-
if (
|
|
765
|
+
if (responseHeaders) {
|
|
732
766
|
responseData = response[0];
|
|
733
767
|
}
|
|
734
768
|
|
|
@@ -751,6 +785,7 @@ class PosCart {
|
|
|
751
785
|
|
|
752
786
|
/**
|
|
753
787
|
* @param {PosCartApplicationValidator.GetCartParam} arg - Arg object.
|
|
788
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
754
789
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
755
790
|
* @returns {Promise<PosCartApplicationModel.CartDetailResponse>} - Success response
|
|
756
791
|
* @name getCart
|
|
@@ -758,8 +793,10 @@ class PosCart {
|
|
|
758
793
|
* @description: Use this API to get details of all the items added to a cart. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/poscart/getCart/).
|
|
759
794
|
*/
|
|
760
795
|
async getCart(
|
|
761
|
-
{ id, i, b, assignCardId, areaCode, buyNow } = {
|
|
762
|
-
|
|
796
|
+
{ id, i, b, assignCardId, areaCode, buyNow, requestHeaders } = {
|
|
797
|
+
requestHeaders: {},
|
|
798
|
+
},
|
|
799
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
763
800
|
) {
|
|
764
801
|
const { error } = PosCartApplicationValidator.getCart().validate(
|
|
765
802
|
{ id, i, b, assignCardId, areaCode, buyNow },
|
|
@@ -800,12 +837,12 @@ class PosCart {
|
|
|
800
837
|
}),
|
|
801
838
|
query_params,
|
|
802
839
|
undefined,
|
|
803
|
-
xHeaders,
|
|
804
|
-
{
|
|
840
|
+
{ ...xHeaders, ...requestHeaders },
|
|
841
|
+
{ responseHeaders }
|
|
805
842
|
);
|
|
806
843
|
|
|
807
844
|
let responseData = response;
|
|
808
|
-
if (
|
|
845
|
+
if (responseHeaders) {
|
|
809
846
|
responseData = response[0];
|
|
810
847
|
}
|
|
811
848
|
|
|
@@ -828,13 +865,17 @@ class PosCart {
|
|
|
828
865
|
|
|
829
866
|
/**
|
|
830
867
|
* @param {PosCartApplicationValidator.GetCartLastModifiedParam} arg - Arg object.
|
|
868
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
831
869
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
832
870
|
* @returns {Promise<any>} - Success response
|
|
833
871
|
* @name getCartLastModified
|
|
834
872
|
* @summary: Fetch last-modified timestamp
|
|
835
873
|
* @description: Use this API to fetch Last-Modified timestamp in header metadata. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/poscart/getCartLastModified/).
|
|
836
874
|
*/
|
|
837
|
-
async getCartLastModified(
|
|
875
|
+
async getCartLastModified(
|
|
876
|
+
{ id, requestHeaders } = { requestHeaders: {} },
|
|
877
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
878
|
+
) {
|
|
838
879
|
const {
|
|
839
880
|
error,
|
|
840
881
|
} = PosCartApplicationValidator.getCartLastModified().validate(
|
|
@@ -873,12 +914,12 @@ class PosCart {
|
|
|
873
914
|
}),
|
|
874
915
|
query_params,
|
|
875
916
|
undefined,
|
|
876
|
-
xHeaders,
|
|
877
|
-
{
|
|
917
|
+
{ ...xHeaders, ...requestHeaders },
|
|
918
|
+
{ responseHeaders }
|
|
878
919
|
);
|
|
879
920
|
|
|
880
921
|
let responseData = response;
|
|
881
|
-
if (
|
|
922
|
+
if (responseHeaders) {
|
|
882
923
|
responseData = response[0];
|
|
883
924
|
}
|
|
884
925
|
|
|
@@ -898,6 +939,7 @@ class PosCart {
|
|
|
898
939
|
|
|
899
940
|
/**
|
|
900
941
|
* @param {PosCartApplicationValidator.GetCartShareLinkParam} arg - Arg object.
|
|
942
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
901
943
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
902
944
|
* @returns {Promise<PosCartApplicationModel.GetShareCartLinkResponse>} -
|
|
903
945
|
* Success response
|
|
@@ -905,7 +947,10 @@ class PosCart {
|
|
|
905
947
|
* @summary: Generate token for sharing the cart
|
|
906
948
|
* @description: Use this API to generate a shared cart snapshot and return a shortlink token. The link can be shared with other users for getting the same items in their cart. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/poscart/getCartShareLink/).
|
|
907
949
|
*/
|
|
908
|
-
async getCartShareLink(
|
|
950
|
+
async getCartShareLink(
|
|
951
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
952
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
953
|
+
) {
|
|
909
954
|
const { error } = PosCartApplicationValidator.getCartShareLink().validate(
|
|
910
955
|
{ body },
|
|
911
956
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -941,12 +986,12 @@ class PosCart {
|
|
|
941
986
|
}),
|
|
942
987
|
query_params,
|
|
943
988
|
body,
|
|
944
|
-
xHeaders,
|
|
945
|
-
{
|
|
989
|
+
{ ...xHeaders, ...requestHeaders },
|
|
990
|
+
{ responseHeaders }
|
|
946
991
|
);
|
|
947
992
|
|
|
948
993
|
let responseData = response;
|
|
949
|
-
if (
|
|
994
|
+
if (responseHeaders) {
|
|
950
995
|
responseData = response[0];
|
|
951
996
|
}
|
|
952
997
|
|
|
@@ -969,13 +1014,17 @@ class PosCart {
|
|
|
969
1014
|
|
|
970
1015
|
/**
|
|
971
1016
|
* @param {PosCartApplicationValidator.GetCartSharedItemsParam} arg - Arg object.
|
|
1017
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
972
1018
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
973
1019
|
* @returns {Promise<PosCartApplicationModel.SharedCartResponse>} - Success response
|
|
974
1020
|
* @name getCartSharedItems
|
|
975
1021
|
* @summary: Get details of a shared cart
|
|
976
1022
|
* @description: Use this API to get the shared cart details as per the token generated using the share-cart API. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/poscart/getCartSharedItems/).
|
|
977
1023
|
*/
|
|
978
|
-
async getCartSharedItems(
|
|
1024
|
+
async getCartSharedItems(
|
|
1025
|
+
{ token, requestHeaders } = { requestHeaders: {} },
|
|
1026
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
1027
|
+
) {
|
|
979
1028
|
const { error } = PosCartApplicationValidator.getCartSharedItems().validate(
|
|
980
1029
|
{ token },
|
|
981
1030
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -1011,12 +1060,12 @@ class PosCart {
|
|
|
1011
1060
|
}),
|
|
1012
1061
|
query_params,
|
|
1013
1062
|
undefined,
|
|
1014
|
-
xHeaders,
|
|
1015
|
-
{
|
|
1063
|
+
{ ...xHeaders, ...requestHeaders },
|
|
1064
|
+
{ responseHeaders }
|
|
1016
1065
|
);
|
|
1017
1066
|
|
|
1018
1067
|
let responseData = response;
|
|
1019
|
-
if (
|
|
1068
|
+
if (responseHeaders) {
|
|
1020
1069
|
responseData = response[0];
|
|
1021
1070
|
}
|
|
1022
1071
|
|
|
@@ -1039,13 +1088,17 @@ class PosCart {
|
|
|
1039
1088
|
|
|
1040
1089
|
/**
|
|
1041
1090
|
* @param {PosCartApplicationValidator.GetCouponsParam} arg - Arg object.
|
|
1091
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1042
1092
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1043
1093
|
* @returns {Promise<PosCartApplicationModel.GetCouponResponse>} - Success response
|
|
1044
1094
|
* @name getCoupons
|
|
1045
1095
|
* @summary: Fetch Coupon
|
|
1046
1096
|
* @description: Use this API to get a list of available coupons along with their details. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/poscart/getCoupons/).
|
|
1047
1097
|
*/
|
|
1048
|
-
async getCoupons(
|
|
1098
|
+
async getCoupons(
|
|
1099
|
+
{ id, buyNow, requestHeaders } = { requestHeaders: {} },
|
|
1100
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
1101
|
+
) {
|
|
1049
1102
|
const { error } = PosCartApplicationValidator.getCoupons().validate(
|
|
1050
1103
|
{ id, buyNow },
|
|
1051
1104
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -1083,12 +1136,12 @@ class PosCart {
|
|
|
1083
1136
|
}),
|
|
1084
1137
|
query_params,
|
|
1085
1138
|
undefined,
|
|
1086
|
-
xHeaders,
|
|
1087
|
-
{
|
|
1139
|
+
{ ...xHeaders, ...requestHeaders },
|
|
1140
|
+
{ responseHeaders }
|
|
1088
1141
|
);
|
|
1089
1142
|
|
|
1090
1143
|
let responseData = response;
|
|
1091
|
-
if (
|
|
1144
|
+
if (responseHeaders) {
|
|
1092
1145
|
responseData = response[0];
|
|
1093
1146
|
}
|
|
1094
1147
|
|
|
@@ -1111,6 +1164,7 @@ class PosCart {
|
|
|
1111
1164
|
|
|
1112
1165
|
/**
|
|
1113
1166
|
* @param {PosCartApplicationValidator.GetItemCountParam} arg - Arg object.
|
|
1167
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1114
1168
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1115
1169
|
* @returns {Promise<PosCartApplicationModel.CartItemCountResponse>} -
|
|
1116
1170
|
* Success response
|
|
@@ -1118,7 +1172,10 @@ class PosCart {
|
|
|
1118
1172
|
* @summary: Count items in the cart
|
|
1119
1173
|
* @description: Use this API to get the total number of items present in cart. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/poscart/getItemCount/).
|
|
1120
1174
|
*/
|
|
1121
|
-
async getItemCount(
|
|
1175
|
+
async getItemCount(
|
|
1176
|
+
{ id, buyNow, requestHeaders } = { requestHeaders: {} },
|
|
1177
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
1178
|
+
) {
|
|
1122
1179
|
const { error } = PosCartApplicationValidator.getItemCount().validate(
|
|
1123
1180
|
{ id, buyNow },
|
|
1124
1181
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -1156,12 +1213,12 @@ class PosCart {
|
|
|
1156
1213
|
}),
|
|
1157
1214
|
query_params,
|
|
1158
1215
|
undefined,
|
|
1159
|
-
xHeaders,
|
|
1160
|
-
{
|
|
1216
|
+
{ ...xHeaders, ...requestHeaders },
|
|
1217
|
+
{ responseHeaders }
|
|
1161
1218
|
);
|
|
1162
1219
|
|
|
1163
1220
|
let responseData = response;
|
|
1164
|
-
if (
|
|
1221
|
+
if (responseHeaders) {
|
|
1165
1222
|
responseData = response[0];
|
|
1166
1223
|
}
|
|
1167
1224
|
|
|
@@ -1184,6 +1241,7 @@ class PosCart {
|
|
|
1184
1241
|
|
|
1185
1242
|
/**
|
|
1186
1243
|
* @param {PosCartApplicationValidator.GetShipmentsParam} arg - Arg object.
|
|
1244
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1187
1245
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1188
1246
|
* @returns {Promise<PosCartApplicationModel.CartShipmentsResponse>} -
|
|
1189
1247
|
* Success response
|
|
@@ -1200,8 +1258,9 @@ class PosCart {
|
|
|
1200
1258
|
addressId,
|
|
1201
1259
|
areaCode,
|
|
1202
1260
|
orderType,
|
|
1203
|
-
|
|
1204
|
-
|
|
1261
|
+
requestHeaders,
|
|
1262
|
+
} = { requestHeaders: {} },
|
|
1263
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
1205
1264
|
) {
|
|
1206
1265
|
const { error } = PosCartApplicationValidator.getShipments().validate(
|
|
1207
1266
|
{
|
|
@@ -1261,12 +1320,12 @@ class PosCart {
|
|
|
1261
1320
|
}),
|
|
1262
1321
|
query_params,
|
|
1263
1322
|
undefined,
|
|
1264
|
-
xHeaders,
|
|
1265
|
-
{
|
|
1323
|
+
{ ...xHeaders, ...requestHeaders },
|
|
1324
|
+
{ responseHeaders }
|
|
1266
1325
|
);
|
|
1267
1326
|
|
|
1268
1327
|
let responseData = response;
|
|
1269
|
-
if (
|
|
1328
|
+
if (responseHeaders) {
|
|
1270
1329
|
responseData = response[0];
|
|
1271
1330
|
}
|
|
1272
1331
|
|
|
@@ -1289,6 +1348,7 @@ class PosCart {
|
|
|
1289
1348
|
|
|
1290
1349
|
/**
|
|
1291
1350
|
* @param {PosCartApplicationValidator.GetStoreAddressByUidParam} arg - Arg object.
|
|
1351
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1292
1352
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1293
1353
|
* @returns {Promise<PosCartApplicationModel.StoreDetailsResponse>} - Success response
|
|
1294
1354
|
* @name getStoreAddressByUid
|
|
@@ -1296,8 +1356,8 @@ class PosCart {
|
|
|
1296
1356
|
* @description: Use this API to get the store details by entering the unique identifier of the pickup stores shown in the response of available-delivery-mode API. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/poscart/getStoreAddressByUid/).
|
|
1297
1357
|
*/
|
|
1298
1358
|
async getStoreAddressByUid(
|
|
1299
|
-
{ storeUid } = {},
|
|
1300
|
-
{
|
|
1359
|
+
{ storeUid, requestHeaders } = { requestHeaders: {} },
|
|
1360
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
1301
1361
|
) {
|
|
1302
1362
|
const {
|
|
1303
1363
|
error,
|
|
@@ -1337,12 +1397,12 @@ class PosCart {
|
|
|
1337
1397
|
}),
|
|
1338
1398
|
query_params,
|
|
1339
1399
|
undefined,
|
|
1340
|
-
xHeaders,
|
|
1341
|
-
{
|
|
1400
|
+
{ ...xHeaders, ...requestHeaders },
|
|
1401
|
+
{ responseHeaders }
|
|
1342
1402
|
);
|
|
1343
1403
|
|
|
1344
1404
|
let responseData = response;
|
|
1345
|
-
if (
|
|
1405
|
+
if (responseHeaders) {
|
|
1346
1406
|
responseData = response[0];
|
|
1347
1407
|
}
|
|
1348
1408
|
|
|
@@ -1365,6 +1425,7 @@ class PosCart {
|
|
|
1365
1425
|
|
|
1366
1426
|
/**
|
|
1367
1427
|
* @param {PosCartApplicationValidator.RemoveAddressParam} arg - Arg object.
|
|
1428
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1368
1429
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1369
1430
|
* @returns {Promise<PosCartApplicationModel.DeleteAddressResponse>} -
|
|
1370
1431
|
* Success response
|
|
@@ -1372,7 +1433,10 @@ class PosCart {
|
|
|
1372
1433
|
* @summary: Remove address associated with an account
|
|
1373
1434
|
* @description: Use this API to delete an address by its ID. This will returns an object that will indicate whether the address was deleted successfully or not. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/poscart/removeAddress/).
|
|
1374
1435
|
*/
|
|
1375
|
-
async removeAddress(
|
|
1436
|
+
async removeAddress(
|
|
1437
|
+
{ id, requestHeaders } = { requestHeaders: {} },
|
|
1438
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
1439
|
+
) {
|
|
1376
1440
|
const { error } = PosCartApplicationValidator.removeAddress().validate(
|
|
1377
1441
|
{ id },
|
|
1378
1442
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -1408,12 +1472,12 @@ class PosCart {
|
|
|
1408
1472
|
}),
|
|
1409
1473
|
query_params,
|
|
1410
1474
|
undefined,
|
|
1411
|
-
xHeaders,
|
|
1412
|
-
{
|
|
1475
|
+
{ ...xHeaders, ...requestHeaders },
|
|
1476
|
+
{ responseHeaders }
|
|
1413
1477
|
);
|
|
1414
1478
|
|
|
1415
1479
|
let responseData = response;
|
|
1416
|
-
if (
|
|
1480
|
+
if (responseHeaders) {
|
|
1417
1481
|
responseData = response[0];
|
|
1418
1482
|
}
|
|
1419
1483
|
|
|
@@ -1436,13 +1500,17 @@ class PosCart {
|
|
|
1436
1500
|
|
|
1437
1501
|
/**
|
|
1438
1502
|
* @param {PosCartApplicationValidator.RemoveCouponParam} arg - Arg object.
|
|
1503
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1439
1504
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1440
1505
|
* @returns {Promise<PosCartApplicationModel.CartDetailResponse>} - Success response
|
|
1441
1506
|
* @name removeCoupon
|
|
1442
1507
|
* @summary: Remove Coupon Applied
|
|
1443
1508
|
* @description: Remove Coupon applied on the cart by passing uid in request body. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/poscart/removeCoupon/).
|
|
1444
1509
|
*/
|
|
1445
|
-
async removeCoupon(
|
|
1510
|
+
async removeCoupon(
|
|
1511
|
+
{ id, buyNow, requestHeaders } = { requestHeaders: {} },
|
|
1512
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
1513
|
+
) {
|
|
1446
1514
|
const { error } = PosCartApplicationValidator.removeCoupon().validate(
|
|
1447
1515
|
{ id, buyNow },
|
|
1448
1516
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -1480,12 +1548,12 @@ class PosCart {
|
|
|
1480
1548
|
}),
|
|
1481
1549
|
query_params,
|
|
1482
1550
|
undefined,
|
|
1483
|
-
xHeaders,
|
|
1484
|
-
{
|
|
1551
|
+
{ ...xHeaders, ...requestHeaders },
|
|
1552
|
+
{ responseHeaders }
|
|
1485
1553
|
);
|
|
1486
1554
|
|
|
1487
1555
|
let responseData = response;
|
|
1488
|
-
if (
|
|
1556
|
+
if (responseHeaders) {
|
|
1489
1557
|
responseData = response[0];
|
|
1490
1558
|
}
|
|
1491
1559
|
|
|
@@ -1508,15 +1576,16 @@ class PosCart {
|
|
|
1508
1576
|
|
|
1509
1577
|
/**
|
|
1510
1578
|
* @param {PosCartApplicationValidator.SelectAddressParam} arg - Arg object.
|
|
1579
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1511
1580
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1512
1581
|
* @returns {Promise<PosCartApplicationModel.CartDetailResponse>} - Success response
|
|
1513
1582
|
* @name selectAddress
|
|
1514
1583
|
* @summary: Select an address from available addresses
|
|
1515
|
-
* @description:
|
|
1584
|
+
* @description: Select Address from all addresses associated with the account in order to ship the cart items to that address, otherwise default address will be selected implicitly. See `SelectCartAddressRequest` in schema of request body for the list of attributes needed to select Address from account. On successful request, this API returns a Cart object. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/poscart/selectAddress/).
|
|
1516
1585
|
*/
|
|
1517
1586
|
async selectAddress(
|
|
1518
|
-
{ body, cartId, buyNow, i, b } = {},
|
|
1519
|
-
{
|
|
1587
|
+
{ body, cartId, buyNow, i, b, requestHeaders } = { requestHeaders: {} },
|
|
1588
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
1520
1589
|
) {
|
|
1521
1590
|
const { error } = PosCartApplicationValidator.selectAddress().validate(
|
|
1522
1591
|
{ body, cartId, buyNow, i, b },
|
|
@@ -1557,12 +1626,12 @@ class PosCart {
|
|
|
1557
1626
|
}),
|
|
1558
1627
|
query_params,
|
|
1559
1628
|
body,
|
|
1560
|
-
xHeaders,
|
|
1561
|
-
{
|
|
1629
|
+
{ ...xHeaders, ...requestHeaders },
|
|
1630
|
+
{ responseHeaders }
|
|
1562
1631
|
);
|
|
1563
1632
|
|
|
1564
1633
|
let responseData = response;
|
|
1565
|
-
if (
|
|
1634
|
+
if (responseHeaders) {
|
|
1566
1635
|
responseData = response[0];
|
|
1567
1636
|
}
|
|
1568
1637
|
|
|
@@ -1585,6 +1654,7 @@ class PosCart {
|
|
|
1585
1654
|
|
|
1586
1655
|
/**
|
|
1587
1656
|
* @param {PosCartApplicationValidator.SelectPaymentModeParam} arg - Arg object.
|
|
1657
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1588
1658
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1589
1659
|
* @returns {Promise<PosCartApplicationModel.CartDetailResponse>} - Success response
|
|
1590
1660
|
* @name selectPaymentMode
|
|
@@ -1592,8 +1662,8 @@ class PosCart {
|
|
|
1592
1662
|
* @description: Use this API to update cart payment. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/poscart/selectPaymentMode/).
|
|
1593
1663
|
*/
|
|
1594
1664
|
async selectPaymentMode(
|
|
1595
|
-
{ body, id, buyNow } = {},
|
|
1596
|
-
{
|
|
1665
|
+
{ body, id, buyNow, requestHeaders } = { requestHeaders: {} },
|
|
1666
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
1597
1667
|
) {
|
|
1598
1668
|
const { error } = PosCartApplicationValidator.selectPaymentMode().validate(
|
|
1599
1669
|
{ body, id, buyNow },
|
|
@@ -1632,12 +1702,12 @@ class PosCart {
|
|
|
1632
1702
|
}),
|
|
1633
1703
|
query_params,
|
|
1634
1704
|
body,
|
|
1635
|
-
xHeaders,
|
|
1636
|
-
{
|
|
1705
|
+
{ ...xHeaders, ...requestHeaders },
|
|
1706
|
+
{ responseHeaders }
|
|
1637
1707
|
);
|
|
1638
1708
|
|
|
1639
1709
|
let responseData = response;
|
|
1640
|
-
if (
|
|
1710
|
+
if (responseHeaders) {
|
|
1641
1711
|
responseData = response[0];
|
|
1642
1712
|
}
|
|
1643
1713
|
|
|
@@ -1660,14 +1730,18 @@ class PosCart {
|
|
|
1660
1730
|
|
|
1661
1731
|
/**
|
|
1662
1732
|
* @param {PosCartApplicationValidator.UpdateAddressParam} arg - Arg object.
|
|
1733
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1663
1734
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1664
1735
|
* @returns {Promise<PosCartApplicationModel.UpdateAddressResponse>} -
|
|
1665
1736
|
* Success response
|
|
1666
1737
|
* @name updateAddress
|
|
1667
1738
|
* @summary: Update address added to an account
|
|
1668
|
-
* @description:
|
|
1739
|
+
* @description: Use this API to update an existing address in the account. Request object should contain attributes mentioned in Address can be updated. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/poscart/updateAddress/).
|
|
1669
1740
|
*/
|
|
1670
|
-
async updateAddress(
|
|
1741
|
+
async updateAddress(
|
|
1742
|
+
{ id, body, requestHeaders } = { requestHeaders: {} },
|
|
1743
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
1744
|
+
) {
|
|
1671
1745
|
const { error } = PosCartApplicationValidator.updateAddress().validate(
|
|
1672
1746
|
{ id, body },
|
|
1673
1747
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -1703,12 +1777,12 @@ class PosCart {
|
|
|
1703
1777
|
}),
|
|
1704
1778
|
query_params,
|
|
1705
1779
|
body,
|
|
1706
|
-
xHeaders,
|
|
1707
|
-
{
|
|
1780
|
+
{ ...xHeaders, ...requestHeaders },
|
|
1781
|
+
{ responseHeaders }
|
|
1708
1782
|
);
|
|
1709
1783
|
|
|
1710
1784
|
let responseData = response;
|
|
1711
|
-
if (
|
|
1785
|
+
if (responseHeaders) {
|
|
1712
1786
|
responseData = response[0];
|
|
1713
1787
|
}
|
|
1714
1788
|
|
|
@@ -1731,16 +1805,19 @@ class PosCart {
|
|
|
1731
1805
|
|
|
1732
1806
|
/**
|
|
1733
1807
|
* @param {PosCartApplicationValidator.UpdateCartParam} arg - Arg object.
|
|
1808
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1734
1809
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1735
1810
|
* @returns {Promise<PosCartApplicationModel.UpdateCartDetailResponse>} -
|
|
1736
1811
|
* Success response
|
|
1737
1812
|
* @name updateCart
|
|
1738
1813
|
* @summary: Update items in the cart
|
|
1739
|
-
* @description:
|
|
1814
|
+
* @description: Use this API to update items added to the cart with the help of a request object containing attributes like item_quantity and item_size. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/poscart/updateCart/).
|
|
1740
1815
|
*/
|
|
1741
1816
|
async updateCart(
|
|
1742
|
-
{ body, id, i, b, areaCode, buyNow } = {
|
|
1743
|
-
|
|
1817
|
+
{ body, id, i, b, areaCode, buyNow, requestHeaders } = {
|
|
1818
|
+
requestHeaders: {},
|
|
1819
|
+
},
|
|
1820
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
1744
1821
|
) {
|
|
1745
1822
|
const { error } = PosCartApplicationValidator.updateCart().validate(
|
|
1746
1823
|
{ body, id, i, b, areaCode, buyNow },
|
|
@@ -1782,12 +1859,12 @@ class PosCart {
|
|
|
1782
1859
|
}),
|
|
1783
1860
|
query_params,
|
|
1784
1861
|
body,
|
|
1785
|
-
xHeaders,
|
|
1786
|
-
{
|
|
1862
|
+
{ ...xHeaders, ...requestHeaders },
|
|
1863
|
+
{ responseHeaders }
|
|
1787
1864
|
);
|
|
1788
1865
|
|
|
1789
1866
|
let responseData = response;
|
|
1790
|
-
if (
|
|
1867
|
+
if (responseHeaders) {
|
|
1791
1868
|
responseData = response[0];
|
|
1792
1869
|
}
|
|
1793
1870
|
|
|
@@ -1810,6 +1887,7 @@ class PosCart {
|
|
|
1810
1887
|
|
|
1811
1888
|
/**
|
|
1812
1889
|
* @param {PosCartApplicationValidator.UpdateCartMetaParam} arg - Arg object.
|
|
1890
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1813
1891
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1814
1892
|
* @returns {Promise<PosCartApplicationModel.CartMetaResponse>} - Success response
|
|
1815
1893
|
* @name updateCartMeta
|
|
@@ -1817,8 +1895,8 @@ class PosCart {
|
|
|
1817
1895
|
* @description: Use this API to update cart meta like checkout_mode and gstin. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/poscart/updateCartMeta/).
|
|
1818
1896
|
*/
|
|
1819
1897
|
async updateCartMeta(
|
|
1820
|
-
{ body, id, buyNow } = {},
|
|
1821
|
-
{
|
|
1898
|
+
{ body, id, buyNow, requestHeaders } = { requestHeaders: {} },
|
|
1899
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
1822
1900
|
) {
|
|
1823
1901
|
const { error } = PosCartApplicationValidator.updateCartMeta().validate(
|
|
1824
1902
|
{ body, id, buyNow },
|
|
@@ -1857,12 +1935,12 @@ class PosCart {
|
|
|
1857
1935
|
}),
|
|
1858
1936
|
query_params,
|
|
1859
1937
|
body,
|
|
1860
|
-
xHeaders,
|
|
1861
|
-
{
|
|
1938
|
+
{ ...xHeaders, ...requestHeaders },
|
|
1939
|
+
{ responseHeaders }
|
|
1862
1940
|
);
|
|
1863
1941
|
|
|
1864
1942
|
let responseData = response;
|
|
1865
|
-
if (
|
|
1943
|
+
if (responseHeaders) {
|
|
1866
1944
|
responseData = response[0];
|
|
1867
1945
|
}
|
|
1868
1946
|
|
|
@@ -1887,6 +1965,7 @@ class PosCart {
|
|
|
1887
1965
|
* @param {PosCartApplicationValidator.UpdateCartWithSharedItemsParam} arg
|
|
1888
1966
|
* - Arg object.
|
|
1889
1967
|
*
|
|
1968
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1890
1969
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1891
1970
|
* @returns {Promise<PosCartApplicationModel.SharedCartResponse>} - Success response
|
|
1892
1971
|
* @name updateCartWithSharedItems
|
|
@@ -1894,8 +1973,8 @@ class PosCart {
|
|
|
1894
1973
|
* @description: Use this API to merge the shared cart with existing cart, or replace the existing cart with the shared cart. The `action` parameter is used to indicate the operation Merge or Replace. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/poscart/updateCartWithSharedItems/).
|
|
1895
1974
|
*/
|
|
1896
1975
|
async updateCartWithSharedItems(
|
|
1897
|
-
{ token, action } = {},
|
|
1898
|
-
{
|
|
1976
|
+
{ token, action, requestHeaders } = { requestHeaders: {} },
|
|
1977
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
1899
1978
|
) {
|
|
1900
1979
|
const {
|
|
1901
1980
|
error,
|
|
@@ -1934,12 +2013,12 @@ class PosCart {
|
|
|
1934
2013
|
}),
|
|
1935
2014
|
query_params,
|
|
1936
2015
|
undefined,
|
|
1937
|
-
xHeaders,
|
|
1938
|
-
{
|
|
2016
|
+
{ ...xHeaders, ...requestHeaders },
|
|
2017
|
+
{ responseHeaders }
|
|
1939
2018
|
);
|
|
1940
2019
|
|
|
1941
2020
|
let responseData = response;
|
|
1942
|
-
if (
|
|
2021
|
+
if (responseHeaders) {
|
|
1943
2022
|
responseData = response[0];
|
|
1944
2023
|
}
|
|
1945
2024
|
|
|
@@ -1962,6 +2041,7 @@ class PosCart {
|
|
|
1962
2041
|
|
|
1963
2042
|
/**
|
|
1964
2043
|
* @param {PosCartApplicationValidator.UpdateShipmentsParam} arg - Arg object.
|
|
2044
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1965
2045
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1966
2046
|
* @returns {Promise<PosCartApplicationModel.CartShipmentsResponse>} -
|
|
1967
2047
|
* Success response
|
|
@@ -1970,8 +2050,10 @@ class PosCart {
|
|
|
1970
2050
|
* @description: Use this API to update the delivery type and quantity as per customer's preference for either store pick-up or home-delivery. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/poscart/updateShipments/).
|
|
1971
2051
|
*/
|
|
1972
2052
|
async updateShipments(
|
|
1973
|
-
{ body, i, p, id, addressId, areaCode, orderType } = {
|
|
1974
|
-
|
|
2053
|
+
{ body, i, p, id, addressId, areaCode, orderType, requestHeaders } = {
|
|
2054
|
+
requestHeaders: {},
|
|
2055
|
+
},
|
|
2056
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
1975
2057
|
) {
|
|
1976
2058
|
const { error } = PosCartApplicationValidator.updateShipments().validate(
|
|
1977
2059
|
{ body, i, p, id, addressId, areaCode, orderType },
|
|
@@ -2014,12 +2096,12 @@ class PosCart {
|
|
|
2014
2096
|
}),
|
|
2015
2097
|
query_params,
|
|
2016
2098
|
body,
|
|
2017
|
-
xHeaders,
|
|
2018
|
-
{
|
|
2099
|
+
{ ...xHeaders, ...requestHeaders },
|
|
2100
|
+
{ responseHeaders }
|
|
2019
2101
|
);
|
|
2020
2102
|
|
|
2021
2103
|
let responseData = response;
|
|
2022
|
-
if (
|
|
2104
|
+
if (responseHeaders) {
|
|
2023
2105
|
responseData = response[0];
|
|
2024
2106
|
}
|
|
2025
2107
|
|
|
@@ -2043,6 +2125,7 @@ class PosCart {
|
|
|
2043
2125
|
/**
|
|
2044
2126
|
* @param {PosCartApplicationValidator.ValidateCouponForPaymentParam} arg -
|
|
2045
2127
|
* Arg object.
|
|
2128
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
2046
2129
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
2047
2130
|
* @returns {Promise<PosCartApplicationModel.PaymentCouponValidate>} -
|
|
2048
2131
|
* Success response
|
|
@@ -2063,8 +2146,9 @@ class PosCart {
|
|
|
2063
2146
|
network,
|
|
2064
2147
|
type,
|
|
2065
2148
|
cardId,
|
|
2066
|
-
|
|
2067
|
-
|
|
2149
|
+
requestHeaders,
|
|
2150
|
+
} = { requestHeaders: {} },
|
|
2151
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
2068
2152
|
) {
|
|
2069
2153
|
const {
|
|
2070
2154
|
error,
|
|
@@ -2138,12 +2222,12 @@ class PosCart {
|
|
|
2138
2222
|
}),
|
|
2139
2223
|
query_params,
|
|
2140
2224
|
undefined,
|
|
2141
|
-
xHeaders,
|
|
2142
|
-
{
|
|
2225
|
+
{ ...xHeaders, ...requestHeaders },
|
|
2226
|
+
{ responseHeaders }
|
|
2143
2227
|
);
|
|
2144
2228
|
|
|
2145
2229
|
let responseData = response;
|
|
2146
|
-
if (
|
|
2230
|
+
if (responseHeaders) {
|
|
2147
2231
|
responseData = response[0];
|
|
2148
2232
|
}
|
|
2149
2233
|
|