@wix/auto_sdk_ecom_checkout 1.0.14 → 1.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. package/build/{es/src/ecom-v1-checkout-checkout.types.d.ts → ecom-v1-checkout-checkout.universal-C4Y04uL3.d.mts} +658 -376
  2. package/build/{cjs/src/ecom-v1-checkout-checkout.types.d.ts → ecom-v1-checkout-checkout.universal-C4Y04uL3.d.ts} +658 -376
  3. package/build/index.d.mts +211 -0
  4. package/build/index.d.ts +211 -0
  5. package/build/index.js +2781 -0
  6. package/build/index.js.map +1 -0
  7. package/build/index.mjs +2707 -0
  8. package/build/index.mjs.map +1 -0
  9. package/build/internal/{cjs/src/ecom-v1-checkout-checkout.types.d.ts → ecom-v1-checkout-checkout.universal-ClmAJ_ss.d.mts} +867 -376
  10. package/build/internal/{es/src/ecom-v1-checkout-checkout.types.d.ts → ecom-v1-checkout-checkout.universal-ClmAJ_ss.d.ts} +867 -376
  11. package/build/internal/index.d.mts +252 -0
  12. package/build/internal/index.d.ts +252 -0
  13. package/build/internal/index.js +2781 -0
  14. package/build/internal/index.js.map +1 -0
  15. package/build/internal/index.mjs +2707 -0
  16. package/build/internal/index.mjs.map +1 -0
  17. package/build/internal/meta.d.mts +2322 -0
  18. package/build/internal/meta.d.ts +2322 -0
  19. package/build/internal/meta.js +1587 -0
  20. package/build/internal/meta.js.map +1 -0
  21. package/build/internal/meta.mjs +1544 -0
  22. package/build/internal/meta.mjs.map +1 -0
  23. package/build/meta.d.mts +2322 -0
  24. package/build/meta.d.ts +2322 -0
  25. package/build/meta.js +1587 -0
  26. package/build/meta.js.map +1 -0
  27. package/build/meta.mjs +1544 -0
  28. package/build/meta.mjs.map +1 -0
  29. package/package.json +13 -12
  30. package/build/cjs/index.d.ts +0 -1
  31. package/build/cjs/index.js +0 -18
  32. package/build/cjs/index.js.map +0 -1
  33. package/build/cjs/index.typings.d.ts +0 -1
  34. package/build/cjs/index.typings.js +0 -18
  35. package/build/cjs/index.typings.js.map +0 -1
  36. package/build/cjs/meta.d.ts +0 -1
  37. package/build/cjs/meta.js +0 -18
  38. package/build/cjs/meta.js.map +0 -1
  39. package/build/cjs/src/ecom-v1-checkout-checkout.context.d.ts +0 -34
  40. package/build/cjs/src/ecom-v1-checkout-checkout.context.js +0 -77
  41. package/build/cjs/src/ecom-v1-checkout-checkout.context.js.map +0 -1
  42. package/build/cjs/src/ecom-v1-checkout-checkout.http.d.ts +0 -122
  43. package/build/cjs/src/ecom-v1-checkout-checkout.http.js +0 -1338
  44. package/build/cjs/src/ecom-v1-checkout-checkout.http.js.map +0 -1
  45. package/build/cjs/src/ecom-v1-checkout-checkout.meta.d.ts +0 -59
  46. package/build/cjs/src/ecom-v1-checkout-checkout.meta.js +0 -351
  47. package/build/cjs/src/ecom-v1-checkout-checkout.meta.js.map +0 -1
  48. package/build/cjs/src/ecom-v1-checkout-checkout.public.d.ts +0 -186
  49. package/build/cjs/src/ecom-v1-checkout-checkout.public.js +0 -358
  50. package/build/cjs/src/ecom-v1-checkout-checkout.public.js.map +0 -1
  51. package/build/cjs/src/ecom-v1-checkout-checkout.types.js +0 -301
  52. package/build/cjs/src/ecom-v1-checkout-checkout.types.js.map +0 -1
  53. package/build/cjs/src/ecom-v1-checkout-checkout.universal.d.ts +0 -4211
  54. package/build/cjs/src/ecom-v1-checkout-checkout.universal.js +0 -1597
  55. package/build/cjs/src/ecom-v1-checkout-checkout.universal.js.map +0 -1
  56. package/build/es/index.d.ts +0 -1
  57. package/build/es/index.js +0 -2
  58. package/build/es/index.js.map +0 -1
  59. package/build/es/index.typings.d.ts +0 -1
  60. package/build/es/index.typings.js +0 -2
  61. package/build/es/index.typings.js.map +0 -1
  62. package/build/es/meta.d.ts +0 -1
  63. package/build/es/meta.js +0 -2
  64. package/build/es/meta.js.map +0 -1
  65. package/build/es/package.json +0 -3
  66. package/build/es/src/ecom-v1-checkout-checkout.context.d.ts +0 -34
  67. package/build/es/src/ecom-v1-checkout-checkout.context.js +0 -42
  68. package/build/es/src/ecom-v1-checkout-checkout.context.js.map +0 -1
  69. package/build/es/src/ecom-v1-checkout-checkout.http.d.ts +0 -122
  70. package/build/es/src/ecom-v1-checkout-checkout.http.js +0 -1318
  71. package/build/es/src/ecom-v1-checkout-checkout.http.js.map +0 -1
  72. package/build/es/src/ecom-v1-checkout-checkout.meta.d.ts +0 -59
  73. package/build/es/src/ecom-v1-checkout-checkout.meta.js +0 -308
  74. package/build/es/src/ecom-v1-checkout-checkout.meta.js.map +0 -1
  75. package/build/es/src/ecom-v1-checkout-checkout.public.d.ts +0 -186
  76. package/build/es/src/ecom-v1-checkout-checkout.public.js +0 -306
  77. package/build/es/src/ecom-v1-checkout-checkout.public.js.map +0 -1
  78. package/build/es/src/ecom-v1-checkout-checkout.types.js +0 -298
  79. package/build/es/src/ecom-v1-checkout-checkout.types.js.map +0 -1
  80. package/build/es/src/ecom-v1-checkout-checkout.universal.d.ts +0 -4211
  81. package/build/es/src/ecom-v1-checkout-checkout.universal.js +0 -1554
  82. package/build/es/src/ecom-v1-checkout-checkout.universal.js.map +0 -1
  83. package/build/internal/cjs/index.d.ts +0 -1
  84. package/build/internal/cjs/index.js +0 -18
  85. package/build/internal/cjs/index.js.map +0 -1
  86. package/build/internal/cjs/index.typings.d.ts +0 -1
  87. package/build/internal/cjs/index.typings.js +0 -18
  88. package/build/internal/cjs/index.typings.js.map +0 -1
  89. package/build/internal/cjs/meta.d.ts +0 -1
  90. package/build/internal/cjs/meta.js +0 -18
  91. package/build/internal/cjs/meta.js.map +0 -1
  92. package/build/internal/cjs/src/ecom-v1-checkout-checkout.context.d.ts +0 -42
  93. package/build/internal/cjs/src/ecom-v1-checkout-checkout.context.js +0 -77
  94. package/build/internal/cjs/src/ecom-v1-checkout-checkout.context.js.map +0 -1
  95. package/build/internal/cjs/src/ecom-v1-checkout-checkout.http.d.ts +0 -122
  96. package/build/internal/cjs/src/ecom-v1-checkout-checkout.http.js +0 -1338
  97. package/build/internal/cjs/src/ecom-v1-checkout-checkout.http.js.map +0 -1
  98. package/build/internal/cjs/src/ecom-v1-checkout-checkout.meta.d.ts +0 -59
  99. package/build/internal/cjs/src/ecom-v1-checkout-checkout.meta.js +0 -351
  100. package/build/internal/cjs/src/ecom-v1-checkout-checkout.meta.js.map +0 -1
  101. package/build/internal/cjs/src/ecom-v1-checkout-checkout.public.d.ts +0 -219
  102. package/build/internal/cjs/src/ecom-v1-checkout-checkout.public.js +0 -358
  103. package/build/internal/cjs/src/ecom-v1-checkout-checkout.public.js.map +0 -1
  104. package/build/internal/cjs/src/ecom-v1-checkout-checkout.types.js +0 -301
  105. package/build/internal/cjs/src/ecom-v1-checkout-checkout.types.js.map +0 -1
  106. package/build/internal/cjs/src/ecom-v1-checkout-checkout.universal.d.ts +0 -4494
  107. package/build/internal/cjs/src/ecom-v1-checkout-checkout.universal.js +0 -1597
  108. package/build/internal/cjs/src/ecom-v1-checkout-checkout.universal.js.map +0 -1
  109. package/build/internal/es/index.d.ts +0 -1
  110. package/build/internal/es/index.js +0 -2
  111. package/build/internal/es/index.js.map +0 -1
  112. package/build/internal/es/index.typings.d.ts +0 -1
  113. package/build/internal/es/index.typings.js +0 -2
  114. package/build/internal/es/index.typings.js.map +0 -1
  115. package/build/internal/es/meta.d.ts +0 -1
  116. package/build/internal/es/meta.js +0 -2
  117. package/build/internal/es/meta.js.map +0 -1
  118. package/build/internal/es/src/ecom-v1-checkout-checkout.context.d.ts +0 -42
  119. package/build/internal/es/src/ecom-v1-checkout-checkout.context.js +0 -42
  120. package/build/internal/es/src/ecom-v1-checkout-checkout.context.js.map +0 -1
  121. package/build/internal/es/src/ecom-v1-checkout-checkout.http.d.ts +0 -122
  122. package/build/internal/es/src/ecom-v1-checkout-checkout.http.js +0 -1318
  123. package/build/internal/es/src/ecom-v1-checkout-checkout.http.js.map +0 -1
  124. package/build/internal/es/src/ecom-v1-checkout-checkout.meta.d.ts +0 -59
  125. package/build/internal/es/src/ecom-v1-checkout-checkout.meta.js +0 -308
  126. package/build/internal/es/src/ecom-v1-checkout-checkout.meta.js.map +0 -1
  127. package/build/internal/es/src/ecom-v1-checkout-checkout.public.d.ts +0 -219
  128. package/build/internal/es/src/ecom-v1-checkout-checkout.public.js +0 -306
  129. package/build/internal/es/src/ecom-v1-checkout-checkout.public.js.map +0 -1
  130. package/build/internal/es/src/ecom-v1-checkout-checkout.types.js +0 -298
  131. package/build/internal/es/src/ecom-v1-checkout-checkout.types.js.map +0 -1
  132. package/build/internal/es/src/ecom-v1-checkout-checkout.universal.d.ts +0 -4494
  133. package/build/internal/es/src/ecom-v1-checkout-checkout.universal.js +0 -1554
  134. package/build/internal/es/src/ecom-v1-checkout-checkout.universal.js.map +0 -1
@@ -1,1338 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getCheckoutPaymentSettings = exports.updateLineItemsQuantity = exports.markCheckoutAsCompleted = exports.markCheckoutAsCompletedAndRedirectToUrl = exports.createOrderAndCharge = exports.createOrder = exports.removeLineItems = exports.addToCheckout = exports.removeOverrideCheckoutUrl = exports.removeGiftCard = exports.removeCoupon = exports.updateCheckout = exports.getCheckoutUrl = exports.getWixCheckoutUrl = exports.getCheckoutByCartId = exports.getCheckout = exports.createCheckout = void 0;
4
- const rest_modules_1 = require("@wix/sdk-runtime/rest-modules");
5
- const float_1 = require("@wix/sdk-runtime/transformations/float");
6
- const float_2 = require("@wix/sdk-runtime/transformations/float");
7
- const bytes_1 = require("@wix/sdk-runtime/transformations/bytes");
8
- const timestamp_1 = require("@wix/sdk-runtime/transformations/timestamp");
9
- const timestamp_2 = require("@wix/sdk-runtime/transformations/timestamp");
10
- const field_mask_1 = require("@wix/sdk-runtime/transformations/field-mask");
11
- const transform_paths_1 = require("@wix/sdk-runtime/transformations/transform-paths");
12
- const rest_modules_2 = require("@wix/sdk-runtime/rest-modules");
13
- function resolveComWixEcomCheckoutApiV1CheckoutServiceUrl(opts) {
14
- const domainToMappings = {
15
- 'www.wixapis.com': [
16
- {
17
- srcPath: '/ecom/v1/checkouts',
18
- destPath: '/v1/checkouts',
19
- },
20
- ],
21
- 'api._api_base_domain_': [
22
- {
23
- srcPath: '/checkout',
24
- destPath: '',
25
- },
26
- ],
27
- _: [
28
- {
29
- srcPath: '/ecom/v1/checkouts',
30
- destPath: '/v1/checkouts',
31
- },
32
- ],
33
- 'manage._base_domain_': [
34
- {
35
- srcPath: '/ecom/v1/checkouts',
36
- destPath: '/v1/checkouts',
37
- },
38
- ],
39
- 'www._base_domain_': [
40
- {
41
- srcPath: '/ecom/v1/checkouts',
42
- destPath: '/v1/checkouts',
43
- },
44
- ],
45
- 'bo._base_domain_': [
46
- {
47
- srcPath: '/ecom/v1/checkouts',
48
- destPath: '/v1/checkouts',
49
- },
50
- ],
51
- 'wixbo.ai': [
52
- {
53
- srcPath: '/ecom/v1/checkouts',
54
- destPath: '/v1/checkouts',
55
- },
56
- ],
57
- 'wix-bo.com': [
58
- {
59
- srcPath: '/ecom/v1/checkouts',
60
- destPath: '/v1/checkouts',
61
- },
62
- ],
63
- };
64
- return (0, rest_modules_2.resolveUrl)(Object.assign(opts, { domainToMappings }));
65
- }
66
- const PACKAGE_NAME = '@wix/auto_sdk_ecom_checkout';
67
- /**
68
- * Creates a checkout.
69
- *
70
- *
71
- * The `createCheckout()` function returns a Promise that resolves to the new checkout when it's created.
72
- *
73
- * > **Notes:**
74
- * > + Checkout must include at least 1 item in the `options.lineItems` array.
75
- * > + `options.channelType` is required.
76
- * > + If `_id` for `options.lineItems` is added, make sure that each `_id` is unique.
77
- * > + If `options.checkoutInfo.customFields` are added, then `options.checkoutInfo.customFields.value` is required.
78
- */
79
- function createCheckout(payload) {
80
- function __createCheckout({ host }) {
81
- const serializedData = (0, transform_paths_1.transformPaths)(payload, [
82
- {
83
- transformFn: timestamp_1.transformSDKTimestampToRESTTimestamp,
84
- paths: [
85
- { path: 'checkoutInfo.createdDate' },
86
- { path: 'checkoutInfo.updatedDate' },
87
- { path: 'checkoutInfo.lineItems.media.urlExpirationDate' },
88
- {
89
- path: 'checkoutInfo.lineItems.subscriptionOptionInfo.subscriptionSettings.startDate',
90
- },
91
- { path: 'checkoutInfo.lineItems.serviceProperties.scheduledDate' },
92
- {
93
- path: 'checkoutInfo.shippingInfo.selectedCarrierServiceOption.logistics.deliveryTimeSlot.from',
94
- },
95
- {
96
- path: 'checkoutInfo.shippingInfo.selectedCarrierServiceOption.logistics.deliveryTimeSlot.to',
97
- },
98
- {
99
- path: 'checkoutInfo.shippingInfo.carrierServiceOptions.shippingOptions.logistics.deliveryTimeSlot.from',
100
- },
101
- {
102
- path: 'checkoutInfo.shippingInfo.carrierServiceOptions.shippingOptions.logistics.deliveryTimeSlot.to',
103
- },
104
- {
105
- path: 'checkoutInfo.membershipOptions.eligibleMemberships.expirationDate',
106
- },
107
- {
108
- path: 'checkoutInfo.membershipOptions.invalidMemberships.membership.expirationDate',
109
- },
110
- { path: 'checkoutInfo.subscriptionCharges.charges.cycleBillingDate' },
111
- { path: 'lineItems.media.urlExpirationDate' },
112
- {
113
- path: 'lineItems.subscriptionOptionInfo.subscriptionSettings.startDate',
114
- },
115
- { path: 'lineItems.serviceProperties.scheduledDate' },
116
- {
117
- path: 'customLineItems.subscriptionOptionInfo.subscriptionSettings.startDate',
118
- },
119
- { path: 'customLineItems.serviceProperties.scheduledDate' },
120
- ],
121
- },
122
- {
123
- transformFn: float_1.transformSDKFloatToRESTFloat,
124
- paths: [
125
- { path: 'checkoutInfo.lineItems.media.focalPoint.x' },
126
- { path: 'checkoutInfo.lineItems.media.focalPoint.y' },
127
- { path: 'lineItems.media.focalPoint.x' },
128
- { path: 'lineItems.media.focalPoint.y' },
129
- { path: 'checkoutInfo.lineItems.physicalProperties.weight' },
130
- {
131
- path: 'checkoutInfo.lineItems.catalogOverrideFields.physicalProperties.weight',
132
- },
133
- { path: 'checkoutInfo.billingInfo.address.geocode.latitude' },
134
- { path: 'checkoutInfo.billingInfo.address.geocode.longitude' },
135
- {
136
- path: 'checkoutInfo.shippingInfo.shippingDestination.address.geocode.latitude',
137
- },
138
- {
139
- path: 'checkoutInfo.shippingInfo.shippingDestination.address.geocode.longitude',
140
- },
141
- {
142
- path: 'checkoutInfo.shippingInfo.selectedCarrierServiceOption.logistics.pickupDetails.address.geocode.latitude',
143
- },
144
- {
145
- path: 'checkoutInfo.shippingInfo.selectedCarrierServiceOption.logistics.pickupDetails.address.geocode.longitude',
146
- },
147
- {
148
- path: 'checkoutInfo.shippingInfo.carrierServiceOptions.shippingOptions.logistics.pickupDetails.address.geocode.latitude',
149
- },
150
- {
151
- path: 'checkoutInfo.shippingInfo.carrierServiceOptions.shippingOptions.logistics.pickupDetails.address.geocode.longitude',
152
- },
153
- { path: 'checkoutInfo.appliedDiscounts.merchantDiscount.percentage' },
154
- { path: 'lineItems.physicalProperties.weight' },
155
- { path: 'lineItems.catalogOverrideFields.physicalProperties.weight' },
156
- { path: 'customLineItems.physicalProperties.weight' },
157
- ],
158
- },
159
- ]);
160
- const metadata = {
161
- entityFqdn: 'wix.ecom.v1.checkout',
162
- method: 'POST',
163
- methodFqn: 'com.wix.ecom.checkout.api.v1.CheckoutService.CreateCheckout',
164
- packageName: PACKAGE_NAME,
165
- url: resolveComWixEcomCheckoutApiV1CheckoutServiceUrl({
166
- protoPath: '/v1/checkouts',
167
- data: serializedData,
168
- host,
169
- }),
170
- data: serializedData,
171
- transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
172
- {
173
- transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
174
- paths: [
175
- { path: 'checkout.createdDate' },
176
- { path: 'checkout.updatedDate' },
177
- { path: 'checkout.lineItems.media.urlExpirationDate' },
178
- {
179
- path: 'checkout.lineItems.subscriptionOptionInfo.subscriptionSettings.startDate',
180
- },
181
- { path: 'checkout.lineItems.serviceProperties.scheduledDate' },
182
- {
183
- path: 'checkout.shippingInfo.selectedCarrierServiceOption.logistics.deliveryTimeSlot.from',
184
- },
185
- {
186
- path: 'checkout.shippingInfo.selectedCarrierServiceOption.logistics.deliveryTimeSlot.to',
187
- },
188
- {
189
- path: 'checkout.shippingInfo.carrierServiceOptions.shippingOptions.logistics.deliveryTimeSlot.from',
190
- },
191
- {
192
- path: 'checkout.shippingInfo.carrierServiceOptions.shippingOptions.logistics.deliveryTimeSlot.to',
193
- },
194
- {
195
- path: 'checkout.membershipOptions.eligibleMemberships.expirationDate',
196
- },
197
- {
198
- path: 'checkout.membershipOptions.invalidMemberships.membership.expirationDate',
199
- },
200
- { path: 'checkout.subscriptionCharges.charges.cycleBillingDate' },
201
- ],
202
- },
203
- {
204
- transformFn: float_2.transformRESTFloatToSDKFloat,
205
- paths: [
206
- { path: 'checkout.lineItems.media.focalPoint.x' },
207
- { path: 'checkout.lineItems.media.focalPoint.y' },
208
- { path: 'checkout.lineItems.physicalProperties.weight' },
209
- {
210
- path: 'checkout.lineItems.catalogOverrideFields.physicalProperties.weight',
211
- },
212
- { path: 'checkout.billingInfo.address.geocode.latitude' },
213
- { path: 'checkout.billingInfo.address.geocode.longitude' },
214
- {
215
- path: 'checkout.shippingInfo.shippingDestination.address.geocode.latitude',
216
- },
217
- {
218
- path: 'checkout.shippingInfo.shippingDestination.address.geocode.longitude',
219
- },
220
- {
221
- path: 'checkout.shippingInfo.selectedCarrierServiceOption.logistics.pickupDetails.address.geocode.latitude',
222
- },
223
- {
224
- path: 'checkout.shippingInfo.selectedCarrierServiceOption.logistics.pickupDetails.address.geocode.longitude',
225
- },
226
- {
227
- path: 'checkout.shippingInfo.carrierServiceOptions.shippingOptions.logistics.pickupDetails.address.geocode.latitude',
228
- },
229
- {
230
- path: 'checkout.shippingInfo.carrierServiceOptions.shippingOptions.logistics.pickupDetails.address.geocode.longitude',
231
- },
232
- { path: 'checkout.appliedDiscounts.merchantDiscount.percentage' },
233
- ],
234
- },
235
- ]),
236
- };
237
- return metadata;
238
- }
239
- return __createCheckout;
240
- }
241
- exports.createCheckout = createCheckout;
242
- /**
243
- * Retrieves a checkout.
244
- *
245
- *
246
- * The `getCheckout()` function returns a Promise that resolves when the specified checkout is retrieved.
247
- */
248
- function getCheckout(payload) {
249
- function __getCheckout({ host }) {
250
- const metadata = {
251
- entityFqdn: 'wix.ecom.v1.checkout',
252
- method: 'GET',
253
- methodFqn: 'com.wix.ecom.checkout.api.v1.CheckoutService.GetCheckout',
254
- packageName: PACKAGE_NAME,
255
- url: resolveComWixEcomCheckoutApiV1CheckoutServiceUrl({
256
- protoPath: '/v1/checkouts/{id}',
257
- data: payload,
258
- host,
259
- }),
260
- params: (0, rest_modules_1.toURLSearchParams)(payload),
261
- transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
262
- {
263
- transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
264
- paths: [
265
- { path: 'checkout.createdDate' },
266
- { path: 'checkout.updatedDate' },
267
- { path: 'checkout.lineItems.media.urlExpirationDate' },
268
- {
269
- path: 'checkout.lineItems.subscriptionOptionInfo.subscriptionSettings.startDate',
270
- },
271
- { path: 'checkout.lineItems.serviceProperties.scheduledDate' },
272
- {
273
- path: 'checkout.shippingInfo.selectedCarrierServiceOption.logistics.deliveryTimeSlot.from',
274
- },
275
- {
276
- path: 'checkout.shippingInfo.selectedCarrierServiceOption.logistics.deliveryTimeSlot.to',
277
- },
278
- {
279
- path: 'checkout.shippingInfo.carrierServiceOptions.shippingOptions.logistics.deliveryTimeSlot.from',
280
- },
281
- {
282
- path: 'checkout.shippingInfo.carrierServiceOptions.shippingOptions.logistics.deliveryTimeSlot.to',
283
- },
284
- {
285
- path: 'checkout.membershipOptions.eligibleMemberships.expirationDate',
286
- },
287
- {
288
- path: 'checkout.membershipOptions.invalidMemberships.membership.expirationDate',
289
- },
290
- { path: 'checkout.subscriptionCharges.charges.cycleBillingDate' },
291
- ],
292
- },
293
- {
294
- transformFn: float_2.transformRESTFloatToSDKFloat,
295
- paths: [
296
- { path: 'checkout.lineItems.media.focalPoint.x' },
297
- { path: 'checkout.lineItems.media.focalPoint.y' },
298
- { path: 'checkout.lineItems.physicalProperties.weight' },
299
- {
300
- path: 'checkout.lineItems.catalogOverrideFields.physicalProperties.weight',
301
- },
302
- { path: 'checkout.billingInfo.address.geocode.latitude' },
303
- { path: 'checkout.billingInfo.address.geocode.longitude' },
304
- {
305
- path: 'checkout.shippingInfo.shippingDestination.address.geocode.latitude',
306
- },
307
- {
308
- path: 'checkout.shippingInfo.shippingDestination.address.geocode.longitude',
309
- },
310
- {
311
- path: 'checkout.shippingInfo.selectedCarrierServiceOption.logistics.pickupDetails.address.geocode.latitude',
312
- },
313
- {
314
- path: 'checkout.shippingInfo.selectedCarrierServiceOption.logistics.pickupDetails.address.geocode.longitude',
315
- },
316
- {
317
- path: 'checkout.shippingInfo.carrierServiceOptions.shippingOptions.logistics.pickupDetails.address.geocode.latitude',
318
- },
319
- {
320
- path: 'checkout.shippingInfo.carrierServiceOptions.shippingOptions.logistics.pickupDetails.address.geocode.longitude',
321
- },
322
- { path: 'checkout.appliedDiscounts.merchantDiscount.percentage' },
323
- ],
324
- },
325
- ]),
326
- };
327
- return metadata;
328
- }
329
- return __getCheckout;
330
- }
331
- exports.getCheckout = getCheckout;
332
- /** Retrieves the checkout associated with a specified cart. */
333
- function getCheckoutByCartId(payload) {
334
- function __getCheckoutByCartId({ host }) {
335
- const metadata = {
336
- entityFqdn: 'wix.ecom.v1.checkout',
337
- method: 'GET',
338
- methodFqn: 'com.wix.ecom.checkout.api.v1.CheckoutService.GetCheckoutByCartId',
339
- packageName: PACKAGE_NAME,
340
- url: resolveComWixEcomCheckoutApiV1CheckoutServiceUrl({
341
- protoPath: '/v1/checkouts/by-cart-id/{id}',
342
- data: payload,
343
- host,
344
- }),
345
- params: (0, rest_modules_1.toURLSearchParams)(payload),
346
- transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
347
- {
348
- transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
349
- paths: [
350
- { path: 'checkout.createdDate' },
351
- { path: 'checkout.updatedDate' },
352
- { path: 'checkout.lineItems.media.urlExpirationDate' },
353
- {
354
- path: 'checkout.lineItems.subscriptionOptionInfo.subscriptionSettings.startDate',
355
- },
356
- { path: 'checkout.lineItems.serviceProperties.scheduledDate' },
357
- {
358
- path: 'checkout.shippingInfo.selectedCarrierServiceOption.logistics.deliveryTimeSlot.from',
359
- },
360
- {
361
- path: 'checkout.shippingInfo.selectedCarrierServiceOption.logistics.deliveryTimeSlot.to',
362
- },
363
- {
364
- path: 'checkout.shippingInfo.carrierServiceOptions.shippingOptions.logistics.deliveryTimeSlot.from',
365
- },
366
- {
367
- path: 'checkout.shippingInfo.carrierServiceOptions.shippingOptions.logistics.deliveryTimeSlot.to',
368
- },
369
- {
370
- path: 'checkout.membershipOptions.eligibleMemberships.expirationDate',
371
- },
372
- {
373
- path: 'checkout.membershipOptions.invalidMemberships.membership.expirationDate',
374
- },
375
- { path: 'checkout.subscriptionCharges.charges.cycleBillingDate' },
376
- ],
377
- },
378
- {
379
- transformFn: float_2.transformRESTFloatToSDKFloat,
380
- paths: [
381
- { path: 'checkout.lineItems.media.focalPoint.x' },
382
- { path: 'checkout.lineItems.media.focalPoint.y' },
383
- { path: 'checkout.lineItems.physicalProperties.weight' },
384
- {
385
- path: 'checkout.lineItems.catalogOverrideFields.physicalProperties.weight',
386
- },
387
- { path: 'checkout.billingInfo.address.geocode.latitude' },
388
- { path: 'checkout.billingInfo.address.geocode.longitude' },
389
- {
390
- path: 'checkout.shippingInfo.shippingDestination.address.geocode.latitude',
391
- },
392
- {
393
- path: 'checkout.shippingInfo.shippingDestination.address.geocode.longitude',
394
- },
395
- {
396
- path: 'checkout.shippingInfo.selectedCarrierServiceOption.logistics.pickupDetails.address.geocode.latitude',
397
- },
398
- {
399
- path: 'checkout.shippingInfo.selectedCarrierServiceOption.logistics.pickupDetails.address.geocode.longitude',
400
- },
401
- {
402
- path: 'checkout.shippingInfo.carrierServiceOptions.shippingOptions.logistics.pickupDetails.address.geocode.latitude',
403
- },
404
- {
405
- path: 'checkout.shippingInfo.carrierServiceOptions.shippingOptions.logistics.pickupDetails.address.geocode.longitude',
406
- },
407
- { path: 'checkout.appliedDiscounts.merchantDiscount.percentage' },
408
- ],
409
- },
410
- ]),
411
- };
412
- return metadata;
413
- }
414
- return __getCheckoutByCartId;
415
- }
416
- exports.getCheckoutByCartId = getCheckoutByCartId;
417
- /** Deprecated and will be removed soon, use GetCheckoutURL */
418
- function getWixCheckoutUrl(payload) {
419
- function __getWixCheckoutUrl({ host }) {
420
- const metadata = {
421
- entityFqdn: 'wix.ecom.v1.checkout',
422
- method: 'GET',
423
- methodFqn: 'com.wix.ecom.checkout.api.v1.CheckoutService.GetWixCheckoutURL',
424
- packageName: PACKAGE_NAME,
425
- url: resolveComWixEcomCheckoutApiV1CheckoutServiceUrl({
426
- protoPath: '/v1/checkouts/{id}/wix-checkout-url',
427
- data: payload,
428
- host,
429
- }),
430
- params: (0, rest_modules_1.toURLSearchParams)(payload),
431
- };
432
- return metadata;
433
- }
434
- return __getWixCheckoutUrl;
435
- }
436
- exports.getWixCheckoutUrl = getWixCheckoutUrl;
437
- /**
438
- * Retrieves the checkout page URL of a specified checkout.
439
- *
440
- * By default, a `checkoutUrl` generates for a checkout and directs to a standard Wix checkout page.
441
- * However, if `overrideCheckoutUrl` has a value, it will replace and set the value of `checkoutUrl`.
442
- */
443
- function getCheckoutUrl(payload) {
444
- function __getCheckoutUrl({ host }) {
445
- const metadata = {
446
- entityFqdn: 'wix.ecom.v1.checkout',
447
- method: 'GET',
448
- methodFqn: 'com.wix.ecom.checkout.api.v1.CheckoutService.GetCheckoutURL',
449
- packageName: PACKAGE_NAME,
450
- url: resolveComWixEcomCheckoutApiV1CheckoutServiceUrl({
451
- protoPath: '/v1/checkouts/{id}/checkout-url',
452
- data: payload,
453
- host,
454
- }),
455
- params: (0, rest_modules_1.toURLSearchParams)(payload),
456
- };
457
- return metadata;
458
- }
459
- return __getCheckoutUrl;
460
- }
461
- exports.getCheckoutUrl = getCheckoutUrl;
462
- /**
463
- * Updates a checkout.
464
- *
465
- *
466
- * The `updateCheckout()` function returns a Promise that resolves to the updated checkout when the specified properties are updated.
467
- *
468
- * >**Notes:**
469
- * > + If nothing is passed in the request, the call will fail.
470
- * > + The `checkout.buyerInfo.email` may not be removed once it is set.
471
- */
472
- function updateCheckout(payload) {
473
- function __updateCheckout({ host }) {
474
- const serializedData = (0, transform_paths_1.transformPaths)(payload, [
475
- {
476
- transformFn: field_mask_1.transformSDKFieldMaskToRESTFieldMask,
477
- paths: [{ path: 'fieldMask' }],
478
- },
479
- {
480
- transformFn: timestamp_1.transformSDKTimestampToRESTTimestamp,
481
- paths: [
482
- { path: 'checkout.createdDate' },
483
- { path: 'checkout.updatedDate' },
484
- { path: 'checkout.lineItems.media.urlExpirationDate' },
485
- {
486
- path: 'checkout.lineItems.subscriptionOptionInfo.subscriptionSettings.startDate',
487
- },
488
- { path: 'checkout.lineItems.serviceProperties.scheduledDate' },
489
- {
490
- path: 'checkout.shippingInfo.selectedCarrierServiceOption.logistics.deliveryTimeSlot.from',
491
- },
492
- {
493
- path: 'checkout.shippingInfo.selectedCarrierServiceOption.logistics.deliveryTimeSlot.to',
494
- },
495
- {
496
- path: 'checkout.shippingInfo.carrierServiceOptions.shippingOptions.logistics.deliveryTimeSlot.from',
497
- },
498
- {
499
- path: 'checkout.shippingInfo.carrierServiceOptions.shippingOptions.logistics.deliveryTimeSlot.to',
500
- },
501
- {
502
- path: 'checkout.membershipOptions.eligibleMemberships.expirationDate',
503
- },
504
- {
505
- path: 'checkout.membershipOptions.invalidMemberships.membership.expirationDate',
506
- },
507
- { path: 'checkout.subscriptionCharges.charges.cycleBillingDate' },
508
- { path: 'lineItems.media.urlExpirationDate' },
509
- {
510
- path: 'lineItems.subscriptionOptionInfo.subscriptionSettings.startDate',
511
- },
512
- { path: 'lineItems.serviceProperties.scheduledDate' },
513
- {
514
- path: 'customLineItems.subscriptionOptionInfo.subscriptionSettings.startDate',
515
- },
516
- { path: 'customLineItems.serviceProperties.scheduledDate' },
517
- ],
518
- },
519
- {
520
- transformFn: float_1.transformSDKFloatToRESTFloat,
521
- paths: [
522
- { path: 'checkout.lineItems.media.focalPoint.x' },
523
- { path: 'checkout.lineItems.media.focalPoint.y' },
524
- { path: 'lineItems.media.focalPoint.x' },
525
- { path: 'lineItems.media.focalPoint.y' },
526
- { path: 'checkout.lineItems.physicalProperties.weight' },
527
- {
528
- path: 'checkout.lineItems.catalogOverrideFields.physicalProperties.weight',
529
- },
530
- { path: 'checkout.billingInfo.address.geocode.latitude' },
531
- { path: 'checkout.billingInfo.address.geocode.longitude' },
532
- {
533
- path: 'checkout.shippingInfo.shippingDestination.address.geocode.latitude',
534
- },
535
- {
536
- path: 'checkout.shippingInfo.shippingDestination.address.geocode.longitude',
537
- },
538
- {
539
- path: 'checkout.shippingInfo.selectedCarrierServiceOption.logistics.pickupDetails.address.geocode.latitude',
540
- },
541
- {
542
- path: 'checkout.shippingInfo.selectedCarrierServiceOption.logistics.pickupDetails.address.geocode.longitude',
543
- },
544
- {
545
- path: 'checkout.shippingInfo.carrierServiceOptions.shippingOptions.logistics.pickupDetails.address.geocode.latitude',
546
- },
547
- {
548
- path: 'checkout.shippingInfo.carrierServiceOptions.shippingOptions.logistics.pickupDetails.address.geocode.longitude',
549
- },
550
- { path: 'checkout.appliedDiscounts.merchantDiscount.percentage' },
551
- { path: 'lineItems.physicalProperties.weight' },
552
- { path: 'lineItems.catalogOverrideFields.physicalProperties.weight' },
553
- { path: 'customLineItems.physicalProperties.weight' },
554
- ],
555
- },
556
- ]);
557
- const metadata = {
558
- entityFqdn: 'wix.ecom.v1.checkout',
559
- method: 'PATCH',
560
- methodFqn: 'com.wix.ecom.checkout.api.v1.CheckoutService.UpdateCheckout',
561
- packageName: PACKAGE_NAME,
562
- url: resolveComWixEcomCheckoutApiV1CheckoutServiceUrl({
563
- protoPath: '/v1/checkouts/{checkout.id}',
564
- data: serializedData,
565
- host,
566
- }),
567
- data: serializedData,
568
- transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
569
- {
570
- transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
571
- paths: [
572
- { path: 'checkout.createdDate' },
573
- { path: 'checkout.updatedDate' },
574
- { path: 'checkout.lineItems.media.urlExpirationDate' },
575
- {
576
- path: 'checkout.lineItems.subscriptionOptionInfo.subscriptionSettings.startDate',
577
- },
578
- { path: 'checkout.lineItems.serviceProperties.scheduledDate' },
579
- {
580
- path: 'checkout.shippingInfo.selectedCarrierServiceOption.logistics.deliveryTimeSlot.from',
581
- },
582
- {
583
- path: 'checkout.shippingInfo.selectedCarrierServiceOption.logistics.deliveryTimeSlot.to',
584
- },
585
- {
586
- path: 'checkout.shippingInfo.carrierServiceOptions.shippingOptions.logistics.deliveryTimeSlot.from',
587
- },
588
- {
589
- path: 'checkout.shippingInfo.carrierServiceOptions.shippingOptions.logistics.deliveryTimeSlot.to',
590
- },
591
- {
592
- path: 'checkout.membershipOptions.eligibleMemberships.expirationDate',
593
- },
594
- {
595
- path: 'checkout.membershipOptions.invalidMemberships.membership.expirationDate',
596
- },
597
- { path: 'checkout.subscriptionCharges.charges.cycleBillingDate' },
598
- ],
599
- },
600
- {
601
- transformFn: float_2.transformRESTFloatToSDKFloat,
602
- paths: [
603
- { path: 'checkout.lineItems.media.focalPoint.x' },
604
- { path: 'checkout.lineItems.media.focalPoint.y' },
605
- { path: 'checkout.lineItems.physicalProperties.weight' },
606
- {
607
- path: 'checkout.lineItems.catalogOverrideFields.physicalProperties.weight',
608
- },
609
- { path: 'checkout.billingInfo.address.geocode.latitude' },
610
- { path: 'checkout.billingInfo.address.geocode.longitude' },
611
- {
612
- path: 'checkout.shippingInfo.shippingDestination.address.geocode.latitude',
613
- },
614
- {
615
- path: 'checkout.shippingInfo.shippingDestination.address.geocode.longitude',
616
- },
617
- {
618
- path: 'checkout.shippingInfo.selectedCarrierServiceOption.logistics.pickupDetails.address.geocode.latitude',
619
- },
620
- {
621
- path: 'checkout.shippingInfo.selectedCarrierServiceOption.logistics.pickupDetails.address.geocode.longitude',
622
- },
623
- {
624
- path: 'checkout.shippingInfo.carrierServiceOptions.shippingOptions.logistics.pickupDetails.address.geocode.latitude',
625
- },
626
- {
627
- path: 'checkout.shippingInfo.carrierServiceOptions.shippingOptions.logistics.pickupDetails.address.geocode.longitude',
628
- },
629
- { path: 'checkout.appliedDiscounts.merchantDiscount.percentage' },
630
- ],
631
- },
632
- ]),
633
- };
634
- return metadata;
635
- }
636
- return __updateCheckout;
637
- }
638
- exports.updateCheckout = updateCheckout;
639
- /**
640
- * Removes the coupon from a specified checkout.
641
- *
642
- *
643
- * The `removeCoupon()` function returns a Promise that resolves to the updated checkout when the coupon is removed from the specified checkout.
644
- *
645
- * >**Note:** A checkout can only hold 1 coupon.
646
- */
647
- function removeCoupon(payload) {
648
- function __removeCoupon({ host }) {
649
- const metadata = {
650
- entityFqdn: 'wix.ecom.v1.checkout',
651
- method: 'POST',
652
- methodFqn: 'com.wix.ecom.checkout.api.v1.CheckoutService.RemoveCoupon',
653
- packageName: PACKAGE_NAME,
654
- url: resolveComWixEcomCheckoutApiV1CheckoutServiceUrl({
655
- protoPath: '/v1/checkouts/{id}/remove-coupon',
656
- data: payload,
657
- host,
658
- }),
659
- data: payload,
660
- transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
661
- {
662
- transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
663
- paths: [
664
- { path: 'checkout.createdDate' },
665
- { path: 'checkout.updatedDate' },
666
- { path: 'checkout.lineItems.media.urlExpirationDate' },
667
- {
668
- path: 'checkout.lineItems.subscriptionOptionInfo.subscriptionSettings.startDate',
669
- },
670
- { path: 'checkout.lineItems.serviceProperties.scheduledDate' },
671
- {
672
- path: 'checkout.shippingInfo.selectedCarrierServiceOption.logistics.deliveryTimeSlot.from',
673
- },
674
- {
675
- path: 'checkout.shippingInfo.selectedCarrierServiceOption.logistics.deliveryTimeSlot.to',
676
- },
677
- {
678
- path: 'checkout.shippingInfo.carrierServiceOptions.shippingOptions.logistics.deliveryTimeSlot.from',
679
- },
680
- {
681
- path: 'checkout.shippingInfo.carrierServiceOptions.shippingOptions.logistics.deliveryTimeSlot.to',
682
- },
683
- {
684
- path: 'checkout.membershipOptions.eligibleMemberships.expirationDate',
685
- },
686
- {
687
- path: 'checkout.membershipOptions.invalidMemberships.membership.expirationDate',
688
- },
689
- { path: 'checkout.subscriptionCharges.charges.cycleBillingDate' },
690
- ],
691
- },
692
- {
693
- transformFn: float_2.transformRESTFloatToSDKFloat,
694
- paths: [
695
- { path: 'checkout.lineItems.media.focalPoint.x' },
696
- { path: 'checkout.lineItems.media.focalPoint.y' },
697
- { path: 'checkout.lineItems.physicalProperties.weight' },
698
- {
699
- path: 'checkout.lineItems.catalogOverrideFields.physicalProperties.weight',
700
- },
701
- { path: 'checkout.billingInfo.address.geocode.latitude' },
702
- { path: 'checkout.billingInfo.address.geocode.longitude' },
703
- {
704
- path: 'checkout.shippingInfo.shippingDestination.address.geocode.latitude',
705
- },
706
- {
707
- path: 'checkout.shippingInfo.shippingDestination.address.geocode.longitude',
708
- },
709
- {
710
- path: 'checkout.shippingInfo.selectedCarrierServiceOption.logistics.pickupDetails.address.geocode.latitude',
711
- },
712
- {
713
- path: 'checkout.shippingInfo.selectedCarrierServiceOption.logistics.pickupDetails.address.geocode.longitude',
714
- },
715
- {
716
- path: 'checkout.shippingInfo.carrierServiceOptions.shippingOptions.logistics.pickupDetails.address.geocode.latitude',
717
- },
718
- {
719
- path: 'checkout.shippingInfo.carrierServiceOptions.shippingOptions.logistics.pickupDetails.address.geocode.longitude',
720
- },
721
- { path: 'checkout.appliedDiscounts.merchantDiscount.percentage' },
722
- ],
723
- },
724
- ]),
725
- };
726
- return metadata;
727
- }
728
- return __removeCoupon;
729
- }
730
- exports.removeCoupon = removeCoupon;
731
- /**
732
- * Removes the gift card from a specified checkout.
733
- *
734
- *
735
- * The `removeGiftCard()` function returns a Promise that resolves to the updated checkout when the gift card is removed from the specified checkout.
736
- *
737
- * >**Note:** A checkout can only hold 1 gift card.
738
- */
739
- function removeGiftCard(payload) {
740
- function __removeGiftCard({ host }) {
741
- const metadata = {
742
- entityFqdn: 'wix.ecom.v1.checkout',
743
- method: 'POST',
744
- methodFqn: 'com.wix.ecom.checkout.api.v1.CheckoutService.RemoveGiftCard',
745
- packageName: PACKAGE_NAME,
746
- url: resolveComWixEcomCheckoutApiV1CheckoutServiceUrl({
747
- protoPath: '/v1/checkouts/{id}/remove-gift-card',
748
- data: payload,
749
- host,
750
- }),
751
- data: payload,
752
- transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
753
- {
754
- transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
755
- paths: [
756
- { path: 'checkout.createdDate' },
757
- { path: 'checkout.updatedDate' },
758
- { path: 'checkout.lineItems.media.urlExpirationDate' },
759
- {
760
- path: 'checkout.lineItems.subscriptionOptionInfo.subscriptionSettings.startDate',
761
- },
762
- { path: 'checkout.lineItems.serviceProperties.scheduledDate' },
763
- {
764
- path: 'checkout.shippingInfo.selectedCarrierServiceOption.logistics.deliveryTimeSlot.from',
765
- },
766
- {
767
- path: 'checkout.shippingInfo.selectedCarrierServiceOption.logistics.deliveryTimeSlot.to',
768
- },
769
- {
770
- path: 'checkout.shippingInfo.carrierServiceOptions.shippingOptions.logistics.deliveryTimeSlot.from',
771
- },
772
- {
773
- path: 'checkout.shippingInfo.carrierServiceOptions.shippingOptions.logistics.deliveryTimeSlot.to',
774
- },
775
- {
776
- path: 'checkout.membershipOptions.eligibleMemberships.expirationDate',
777
- },
778
- {
779
- path: 'checkout.membershipOptions.invalidMemberships.membership.expirationDate',
780
- },
781
- { path: 'checkout.subscriptionCharges.charges.cycleBillingDate' },
782
- ],
783
- },
784
- {
785
- transformFn: float_2.transformRESTFloatToSDKFloat,
786
- paths: [
787
- { path: 'checkout.lineItems.media.focalPoint.x' },
788
- { path: 'checkout.lineItems.media.focalPoint.y' },
789
- { path: 'checkout.lineItems.physicalProperties.weight' },
790
- {
791
- path: 'checkout.lineItems.catalogOverrideFields.physicalProperties.weight',
792
- },
793
- { path: 'checkout.billingInfo.address.geocode.latitude' },
794
- { path: 'checkout.billingInfo.address.geocode.longitude' },
795
- {
796
- path: 'checkout.shippingInfo.shippingDestination.address.geocode.latitude',
797
- },
798
- {
799
- path: 'checkout.shippingInfo.shippingDestination.address.geocode.longitude',
800
- },
801
- {
802
- path: 'checkout.shippingInfo.selectedCarrierServiceOption.logistics.pickupDetails.address.geocode.latitude',
803
- },
804
- {
805
- path: 'checkout.shippingInfo.selectedCarrierServiceOption.logistics.pickupDetails.address.geocode.longitude',
806
- },
807
- {
808
- path: 'checkout.shippingInfo.carrierServiceOptions.shippingOptions.logistics.pickupDetails.address.geocode.latitude',
809
- },
810
- {
811
- path: 'checkout.shippingInfo.carrierServiceOptions.shippingOptions.logistics.pickupDetails.address.geocode.longitude',
812
- },
813
- { path: 'checkout.appliedDiscounts.merchantDiscount.percentage' },
814
- ],
815
- },
816
- ]),
817
- };
818
- return metadata;
819
- }
820
- return __removeGiftCard;
821
- }
822
- exports.removeGiftCard = removeGiftCard;
823
- /**
824
- * Removes the `overrideCheckoutUrl` from a specified checkout.
825
- *
826
- * When `overrideCheckoutUrl` is removed, the `checkoutUrl` will be set to the default, standard
827
- * Wix checkout page URL.
828
- */
829
- function removeOverrideCheckoutUrl(payload) {
830
- function __removeOverrideCheckoutUrl({ host }) {
831
- const metadata = {
832
- entityFqdn: 'wix.ecom.v1.checkout',
833
- method: 'POST',
834
- methodFqn: 'com.wix.ecom.checkout.api.v1.CheckoutService.RemoveOverrideCheckoutUrl',
835
- packageName: PACKAGE_NAME,
836
- url: resolveComWixEcomCheckoutApiV1CheckoutServiceUrl({
837
- protoPath: '/v1/checkouts/{id}/remove-override-checkout-url',
838
- data: payload,
839
- host,
840
- }),
841
- data: payload,
842
- transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
843
- {
844
- transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
845
- paths: [
846
- { path: 'checkout.createdDate' },
847
- { path: 'checkout.updatedDate' },
848
- { path: 'checkout.lineItems.media.urlExpirationDate' },
849
- {
850
- path: 'checkout.lineItems.subscriptionOptionInfo.subscriptionSettings.startDate',
851
- },
852
- { path: 'checkout.lineItems.serviceProperties.scheduledDate' },
853
- {
854
- path: 'checkout.shippingInfo.selectedCarrierServiceOption.logistics.deliveryTimeSlot.from',
855
- },
856
- {
857
- path: 'checkout.shippingInfo.selectedCarrierServiceOption.logistics.deliveryTimeSlot.to',
858
- },
859
- {
860
- path: 'checkout.shippingInfo.carrierServiceOptions.shippingOptions.logistics.deliveryTimeSlot.from',
861
- },
862
- {
863
- path: 'checkout.shippingInfo.carrierServiceOptions.shippingOptions.logistics.deliveryTimeSlot.to',
864
- },
865
- {
866
- path: 'checkout.membershipOptions.eligibleMemberships.expirationDate',
867
- },
868
- {
869
- path: 'checkout.membershipOptions.invalidMemberships.membership.expirationDate',
870
- },
871
- { path: 'checkout.subscriptionCharges.charges.cycleBillingDate' },
872
- ],
873
- },
874
- {
875
- transformFn: float_2.transformRESTFloatToSDKFloat,
876
- paths: [
877
- { path: 'checkout.lineItems.media.focalPoint.x' },
878
- { path: 'checkout.lineItems.media.focalPoint.y' },
879
- { path: 'checkout.lineItems.physicalProperties.weight' },
880
- {
881
- path: 'checkout.lineItems.catalogOverrideFields.physicalProperties.weight',
882
- },
883
- { path: 'checkout.billingInfo.address.geocode.latitude' },
884
- { path: 'checkout.billingInfo.address.geocode.longitude' },
885
- {
886
- path: 'checkout.shippingInfo.shippingDestination.address.geocode.latitude',
887
- },
888
- {
889
- path: 'checkout.shippingInfo.shippingDestination.address.geocode.longitude',
890
- },
891
- {
892
- path: 'checkout.shippingInfo.selectedCarrierServiceOption.logistics.pickupDetails.address.geocode.latitude',
893
- },
894
- {
895
- path: 'checkout.shippingInfo.selectedCarrierServiceOption.logistics.pickupDetails.address.geocode.longitude',
896
- },
897
- {
898
- path: 'checkout.shippingInfo.carrierServiceOptions.shippingOptions.logistics.pickupDetails.address.geocode.latitude',
899
- },
900
- {
901
- path: 'checkout.shippingInfo.carrierServiceOptions.shippingOptions.logistics.pickupDetails.address.geocode.longitude',
902
- },
903
- { path: 'checkout.appliedDiscounts.merchantDiscount.percentage' },
904
- ],
905
- },
906
- ]),
907
- };
908
- return metadata;
909
- }
910
- return __removeOverrideCheckoutUrl;
911
- }
912
- exports.removeOverrideCheckoutUrl = removeOverrideCheckoutUrl;
913
- /**
914
- * Adds catalog line items and/or custom line items to a checkout.
915
- *
916
- *
917
- * The `addToCheckout()` function returns a Promise that resolves to the updated checkout when the specified items have been added.
918
- * > **Note:** When adding catalog items, `options.lineItems.catalogReference` is required.
919
- */
920
- function addToCheckout(payload) {
921
- function __addToCheckout({ host }) {
922
- const serializedData = (0, transform_paths_1.transformPaths)(payload, [
923
- {
924
- transformFn: timestamp_1.transformSDKTimestampToRESTTimestamp,
925
- paths: [
926
- { path: 'lineItems.media.urlExpirationDate' },
927
- {
928
- path: 'lineItems.subscriptionOptionInfo.subscriptionSettings.startDate',
929
- },
930
- { path: 'lineItems.serviceProperties.scheduledDate' },
931
- {
932
- path: 'customLineItems.subscriptionOptionInfo.subscriptionSettings.startDate',
933
- },
934
- { path: 'customLineItems.serviceProperties.scheduledDate' },
935
- ],
936
- },
937
- {
938
- transformFn: float_1.transformSDKFloatToRESTFloat,
939
- paths: [
940
- { path: 'lineItems.media.focalPoint.x' },
941
- { path: 'lineItems.media.focalPoint.y' },
942
- { path: 'lineItems.physicalProperties.weight' },
943
- { path: 'lineItems.catalogOverrideFields.physicalProperties.weight' },
944
- { path: 'customLineItems.physicalProperties.weight' },
945
- ],
946
- },
947
- ]);
948
- const metadata = {
949
- entityFqdn: 'wix.ecom.v1.checkout',
950
- method: 'POST',
951
- methodFqn: 'com.wix.ecom.checkout.api.v1.CheckoutService.AddToCheckout',
952
- packageName: PACKAGE_NAME,
953
- url: resolveComWixEcomCheckoutApiV1CheckoutServiceUrl({
954
- protoPath: '/v1/checkouts/{id}/add-to-checkout',
955
- data: serializedData,
956
- host,
957
- }),
958
- data: serializedData,
959
- transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
960
- {
961
- transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
962
- paths: [
963
- { path: 'checkout.createdDate' },
964
- { path: 'checkout.updatedDate' },
965
- { path: 'checkout.lineItems.media.urlExpirationDate' },
966
- {
967
- path: 'checkout.lineItems.subscriptionOptionInfo.subscriptionSettings.startDate',
968
- },
969
- { path: 'checkout.lineItems.serviceProperties.scheduledDate' },
970
- {
971
- path: 'checkout.shippingInfo.selectedCarrierServiceOption.logistics.deliveryTimeSlot.from',
972
- },
973
- {
974
- path: 'checkout.shippingInfo.selectedCarrierServiceOption.logistics.deliveryTimeSlot.to',
975
- },
976
- {
977
- path: 'checkout.shippingInfo.carrierServiceOptions.shippingOptions.logistics.deliveryTimeSlot.from',
978
- },
979
- {
980
- path: 'checkout.shippingInfo.carrierServiceOptions.shippingOptions.logistics.deliveryTimeSlot.to',
981
- },
982
- {
983
- path: 'checkout.membershipOptions.eligibleMemberships.expirationDate',
984
- },
985
- {
986
- path: 'checkout.membershipOptions.invalidMemberships.membership.expirationDate',
987
- },
988
- { path: 'checkout.subscriptionCharges.charges.cycleBillingDate' },
989
- ],
990
- },
991
- {
992
- transformFn: float_2.transformRESTFloatToSDKFloat,
993
- paths: [
994
- { path: 'checkout.lineItems.media.focalPoint.x' },
995
- { path: 'checkout.lineItems.media.focalPoint.y' },
996
- { path: 'checkout.lineItems.physicalProperties.weight' },
997
- {
998
- path: 'checkout.lineItems.catalogOverrideFields.physicalProperties.weight',
999
- },
1000
- { path: 'checkout.billingInfo.address.geocode.latitude' },
1001
- { path: 'checkout.billingInfo.address.geocode.longitude' },
1002
- {
1003
- path: 'checkout.shippingInfo.shippingDestination.address.geocode.latitude',
1004
- },
1005
- {
1006
- path: 'checkout.shippingInfo.shippingDestination.address.geocode.longitude',
1007
- },
1008
- {
1009
- path: 'checkout.shippingInfo.selectedCarrierServiceOption.logistics.pickupDetails.address.geocode.latitude',
1010
- },
1011
- {
1012
- path: 'checkout.shippingInfo.selectedCarrierServiceOption.logistics.pickupDetails.address.geocode.longitude',
1013
- },
1014
- {
1015
- path: 'checkout.shippingInfo.carrierServiceOptions.shippingOptions.logistics.pickupDetails.address.geocode.latitude',
1016
- },
1017
- {
1018
- path: 'checkout.shippingInfo.carrierServiceOptions.shippingOptions.logistics.pickupDetails.address.geocode.longitude',
1019
- },
1020
- { path: 'checkout.appliedDiscounts.merchantDiscount.percentage' },
1021
- ],
1022
- },
1023
- ]),
1024
- };
1025
- return metadata;
1026
- }
1027
- return __addToCheckout;
1028
- }
1029
- exports.addToCheckout = addToCheckout;
1030
- /**
1031
- * Removes line items from the specified checkout.
1032
- *
1033
- *
1034
- * The `removeLineItems()` function returns a Promise that resolves to the updated checkout when the line items are removed from the specified checkout.
1035
- */
1036
- function removeLineItems(payload) {
1037
- function __removeLineItems({ host }) {
1038
- const metadata = {
1039
- entityFqdn: 'wix.ecom.v1.checkout',
1040
- method: 'POST',
1041
- methodFqn: 'com.wix.ecom.checkout.api.v1.CheckoutService.RemoveLineItems',
1042
- packageName: PACKAGE_NAME,
1043
- url: resolveComWixEcomCheckoutApiV1CheckoutServiceUrl({
1044
- protoPath: '/v1/checkouts/{id}/remove-line-items',
1045
- data: payload,
1046
- host,
1047
- }),
1048
- data: payload,
1049
- transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
1050
- {
1051
- transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
1052
- paths: [
1053
- { path: 'checkout.createdDate' },
1054
- { path: 'checkout.updatedDate' },
1055
- { path: 'checkout.lineItems.media.urlExpirationDate' },
1056
- {
1057
- path: 'checkout.lineItems.subscriptionOptionInfo.subscriptionSettings.startDate',
1058
- },
1059
- { path: 'checkout.lineItems.serviceProperties.scheduledDate' },
1060
- {
1061
- path: 'checkout.shippingInfo.selectedCarrierServiceOption.logistics.deliveryTimeSlot.from',
1062
- },
1063
- {
1064
- path: 'checkout.shippingInfo.selectedCarrierServiceOption.logistics.deliveryTimeSlot.to',
1065
- },
1066
- {
1067
- path: 'checkout.shippingInfo.carrierServiceOptions.shippingOptions.logistics.deliveryTimeSlot.from',
1068
- },
1069
- {
1070
- path: 'checkout.shippingInfo.carrierServiceOptions.shippingOptions.logistics.deliveryTimeSlot.to',
1071
- },
1072
- {
1073
- path: 'checkout.membershipOptions.eligibleMemberships.expirationDate',
1074
- },
1075
- {
1076
- path: 'checkout.membershipOptions.invalidMemberships.membership.expirationDate',
1077
- },
1078
- { path: 'checkout.subscriptionCharges.charges.cycleBillingDate' },
1079
- ],
1080
- },
1081
- {
1082
- transformFn: float_2.transformRESTFloatToSDKFloat,
1083
- paths: [
1084
- { path: 'checkout.lineItems.media.focalPoint.x' },
1085
- { path: 'checkout.lineItems.media.focalPoint.y' },
1086
- { path: 'checkout.lineItems.physicalProperties.weight' },
1087
- {
1088
- path: 'checkout.lineItems.catalogOverrideFields.physicalProperties.weight',
1089
- },
1090
- { path: 'checkout.billingInfo.address.geocode.latitude' },
1091
- { path: 'checkout.billingInfo.address.geocode.longitude' },
1092
- {
1093
- path: 'checkout.shippingInfo.shippingDestination.address.geocode.latitude',
1094
- },
1095
- {
1096
- path: 'checkout.shippingInfo.shippingDestination.address.geocode.longitude',
1097
- },
1098
- {
1099
- path: 'checkout.shippingInfo.selectedCarrierServiceOption.logistics.pickupDetails.address.geocode.latitude',
1100
- },
1101
- {
1102
- path: 'checkout.shippingInfo.selectedCarrierServiceOption.logistics.pickupDetails.address.geocode.longitude',
1103
- },
1104
- {
1105
- path: 'checkout.shippingInfo.carrierServiceOptions.shippingOptions.logistics.pickupDetails.address.geocode.latitude',
1106
- },
1107
- {
1108
- path: 'checkout.shippingInfo.carrierServiceOptions.shippingOptions.logistics.pickupDetails.address.geocode.longitude',
1109
- },
1110
- { path: 'checkout.appliedDiscounts.merchantDiscount.percentage' },
1111
- ],
1112
- },
1113
- ]),
1114
- };
1115
- return metadata;
1116
- }
1117
- return __removeLineItems;
1118
- }
1119
- exports.removeLineItems = removeLineItems;
1120
- /**
1121
- * Creates an order from a specified checkout.
1122
- *
1123
- * The `createOrder()` function returns a Promise that resolves to the new order's ID and `paymentGatewayOrderID` when the order is created.
1124
- * Pass the `paymentGatewayOrderId` as the `paymentId` param to the [`startPayment()`](https://www.wix.com/velo/reference/wix-pay-frontend/startpayment) function to allow a customer to pay for their order.
1125
- *
1126
- * > **Note:** The following requirements must be met for an order to be created from a checkout.
1127
- * > + A checkout cannot have calculation errors. Pass the `checkout._id` to [Get Checkout](https://www.wix.com/velo/reference/wix-ecom-backend/checkout/getcheckout) and take a look at the `calculationErrors` field.
1128
- * > + A checkout must have at least 1 line item.
1129
- * > + All of the line Items have an `availability.status` of `"AVAILABLE"` or `"PARTIALLY_AVAILABLE"`.
1130
- * > + If there is a payment to be made, meaning that `priceSummary.total` is greater than 0, the `billingInfo.address` field must be provided.
1131
- * > + When a checkout has line items to be shipped, the `shippingInfo.shippingDestination.address` and `shippingInfo.selectedCarrierServiceOption` fields must be provided.
1132
- * > + When a checkout has line items for pickup, the `shippingInfo.selectedCarrierServiceOption.logistics.pickupDetails` field must be provided.
1133
- */
1134
- function createOrder(payload) {
1135
- function __createOrder({ host }) {
1136
- const metadata = {
1137
- entityFqdn: 'wix.ecom.v1.checkout',
1138
- method: 'POST',
1139
- methodFqn: 'com.wix.ecom.checkout.api.v1.CheckoutService.CreateOrder',
1140
- packageName: PACKAGE_NAME,
1141
- url: resolveComWixEcomCheckoutApiV1CheckoutServiceUrl({
1142
- protoPath: '/v1/checkouts/{id}/create-order',
1143
- data: payload,
1144
- host,
1145
- }),
1146
- data: payload,
1147
- };
1148
- return metadata;
1149
- }
1150
- return __createOrder;
1151
- }
1152
- exports.createOrder = createOrder;
1153
- /** Deprecated (use createOrder instead) */
1154
- function createOrderAndCharge(payload) {
1155
- function __createOrderAndCharge({ host }) {
1156
- const metadata = {
1157
- entityFqdn: 'wix.ecom.v1.checkout',
1158
- method: 'POST',
1159
- methodFqn: 'com.wix.ecom.checkout.api.v1.CheckoutService.CreateOrderAndCharge',
1160
- packageName: PACKAGE_NAME,
1161
- url: resolveComWixEcomCheckoutApiV1CheckoutServiceUrl({
1162
- protoPath: '/v1/checkouts/{id}/create-order-and-charge',
1163
- data: payload,
1164
- host,
1165
- }),
1166
- data: payload,
1167
- };
1168
- return metadata;
1169
- }
1170
- return __createOrderAndCharge;
1171
- }
1172
- exports.createOrderAndCharge = createOrderAndCharge;
1173
- /** Marks a checkout as completed and redirects to a specified URL. */
1174
- function markCheckoutAsCompletedAndRedirectToUrl(payload) {
1175
- function __markCheckoutAsCompletedAndRedirectToUrl({ host }) {
1176
- const metadata = {
1177
- entityFqdn: 'wix.ecom.v1.checkout',
1178
- method: 'GET',
1179
- methodFqn: 'com.wix.ecom.checkout.api.v1.CheckoutService.MarkCheckoutAsCompletedAndRedirectToUrl',
1180
- packageName: PACKAGE_NAME,
1181
- url: resolveComWixEcomCheckoutApiV1CheckoutServiceUrl({
1182
- protoPath: '/v1/checkouts/mark-checkout-as-completed-and-redirect-to-url',
1183
- data: payload,
1184
- host,
1185
- }),
1186
- params: (0, rest_modules_1.toURLSearchParams)(payload),
1187
- transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
1188
- {
1189
- transformFn: bytes_1.transformRESTBytesToSDKBytes,
1190
- paths: [{ path: 'body' }],
1191
- },
1192
- ]),
1193
- };
1194
- return metadata;
1195
- }
1196
- return __markCheckoutAsCompletedAndRedirectToUrl;
1197
- }
1198
- exports.markCheckoutAsCompletedAndRedirectToUrl = markCheckoutAsCompletedAndRedirectToUrl;
1199
- /**
1200
- * Marks a checkout as completed - `checkout.complete` boolean is set to `true`.
1201
- *
1202
- *
1203
- * The `markCheckoutAsCompleted()` function returns a Promise that resolves when the specified checkout is marked as completed.
1204
- */
1205
- function markCheckoutAsCompleted(payload) {
1206
- function __markCheckoutAsCompleted({ host }) {
1207
- const metadata = {
1208
- entityFqdn: 'wix.ecom.v1.checkout',
1209
- method: 'POST',
1210
- methodFqn: 'com.wix.ecom.checkout.api.v1.CheckoutService.MarkCheckoutAsCompleted',
1211
- packageName: PACKAGE_NAME,
1212
- url: resolveComWixEcomCheckoutApiV1CheckoutServiceUrl({
1213
- protoPath: '/v1/checkouts/{id}/mark-as-completed',
1214
- data: payload,
1215
- host,
1216
- }),
1217
- data: payload,
1218
- };
1219
- return metadata;
1220
- }
1221
- return __markCheckoutAsCompleted;
1222
- }
1223
- exports.markCheckoutAsCompleted = markCheckoutAsCompleted;
1224
- /**
1225
- * Updates the quantity of one or more line items in a checkout.
1226
- *
1227
- * This endpoint is only for updating the quantity of line items. To entirely remove a line item from
1228
- * the checkout, use [`removeLineItems()`](#removelineitems).
1229
- * To add a new line item to the checkout, use [`addToCheckout()`](#addtocheckout).
1230
- *
1231
- * This endpoint checks the amount of stock remaining for this line item. If the specified `quantity`
1232
- * is greater than the remaining stock, then the `quantity` returned in the response is the total amount
1233
- * of remaining stock.
1234
- */
1235
- function updateLineItemsQuantity(payload) {
1236
- function __updateLineItemsQuantity({ host }) {
1237
- const metadata = {
1238
- entityFqdn: 'wix.ecom.v1.checkout',
1239
- method: 'POST',
1240
- methodFqn: 'com.wix.ecom.checkout.api.v1.CheckoutService.UpdateLineItemsQuantity',
1241
- packageName: PACKAGE_NAME,
1242
- url: resolveComWixEcomCheckoutApiV1CheckoutServiceUrl({
1243
- protoPath: '/v1/checkouts/{id}/update-line-items-quantity',
1244
- data: payload,
1245
- host,
1246
- }),
1247
- data: payload,
1248
- transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
1249
- {
1250
- transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
1251
- paths: [
1252
- { path: 'checkout.createdDate' },
1253
- { path: 'checkout.updatedDate' },
1254
- { path: 'checkout.lineItems.media.urlExpirationDate' },
1255
- {
1256
- path: 'checkout.lineItems.subscriptionOptionInfo.subscriptionSettings.startDate',
1257
- },
1258
- { path: 'checkout.lineItems.serviceProperties.scheduledDate' },
1259
- {
1260
- path: 'checkout.shippingInfo.selectedCarrierServiceOption.logistics.deliveryTimeSlot.from',
1261
- },
1262
- {
1263
- path: 'checkout.shippingInfo.selectedCarrierServiceOption.logistics.deliveryTimeSlot.to',
1264
- },
1265
- {
1266
- path: 'checkout.shippingInfo.carrierServiceOptions.shippingOptions.logistics.deliveryTimeSlot.from',
1267
- },
1268
- {
1269
- path: 'checkout.shippingInfo.carrierServiceOptions.shippingOptions.logistics.deliveryTimeSlot.to',
1270
- },
1271
- {
1272
- path: 'checkout.membershipOptions.eligibleMemberships.expirationDate',
1273
- },
1274
- {
1275
- path: 'checkout.membershipOptions.invalidMemberships.membership.expirationDate',
1276
- },
1277
- { path: 'checkout.subscriptionCharges.charges.cycleBillingDate' },
1278
- ],
1279
- },
1280
- {
1281
- transformFn: float_2.transformRESTFloatToSDKFloat,
1282
- paths: [
1283
- { path: 'checkout.lineItems.media.focalPoint.x' },
1284
- { path: 'checkout.lineItems.media.focalPoint.y' },
1285
- { path: 'checkout.lineItems.physicalProperties.weight' },
1286
- {
1287
- path: 'checkout.lineItems.catalogOverrideFields.physicalProperties.weight',
1288
- },
1289
- { path: 'checkout.billingInfo.address.geocode.latitude' },
1290
- { path: 'checkout.billingInfo.address.geocode.longitude' },
1291
- {
1292
- path: 'checkout.shippingInfo.shippingDestination.address.geocode.latitude',
1293
- },
1294
- {
1295
- path: 'checkout.shippingInfo.shippingDestination.address.geocode.longitude',
1296
- },
1297
- {
1298
- path: 'checkout.shippingInfo.selectedCarrierServiceOption.logistics.pickupDetails.address.geocode.latitude',
1299
- },
1300
- {
1301
- path: 'checkout.shippingInfo.selectedCarrierServiceOption.logistics.pickupDetails.address.geocode.longitude',
1302
- },
1303
- {
1304
- path: 'checkout.shippingInfo.carrierServiceOptions.shippingOptions.logistics.pickupDetails.address.geocode.latitude',
1305
- },
1306
- {
1307
- path: 'checkout.shippingInfo.carrierServiceOptions.shippingOptions.logistics.pickupDetails.address.geocode.longitude',
1308
- },
1309
- { path: 'checkout.appliedDiscounts.merchantDiscount.percentage' },
1310
- ],
1311
- },
1312
- ]),
1313
- };
1314
- return metadata;
1315
- }
1316
- return __updateLineItemsQuantity;
1317
- }
1318
- exports.updateLineItemsQuantity = updateLineItemsQuantity;
1319
- function getCheckoutPaymentSettings(payload) {
1320
- function __getCheckoutPaymentSettings({ host }) {
1321
- const metadata = {
1322
- entityFqdn: 'wix.ecom.v1.checkout',
1323
- method: 'GET',
1324
- methodFqn: 'com.wix.ecom.checkout.api.v1.CheckoutService.GetCheckoutPaymentSettings',
1325
- packageName: PACKAGE_NAME,
1326
- url: resolveComWixEcomCheckoutApiV1CheckoutServiceUrl({
1327
- protoPath: '/v1/checkouts/{id}/payment-settings',
1328
- data: payload,
1329
- host,
1330
- }),
1331
- params: (0, rest_modules_1.toURLSearchParams)(payload),
1332
- };
1333
- return metadata;
1334
- }
1335
- return __getCheckoutPaymentSettings;
1336
- }
1337
- exports.getCheckoutPaymentSettings = getCheckoutPaymentSettings;
1338
- //# sourceMappingURL=ecom-v1-checkout-checkout.http.js.map