@wix/auto_sdk_ecom_checkout 1.0.36 → 1.0.37

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