@wix/auto_sdk_ecom_orders 1.0.53 → 1.0.54

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/{cjs/src/ecom-v1-order-orders.universal.d.ts → ecom-v1-order-orders.universal-CO-UuLIK.d.mts} +640 -1079
  2. package/build/{es/src/ecom-v1-order-orders.universal.d.ts → ecom-v1-order-orders.universal-CO-UuLIK.d.ts} +640 -1079
  3. package/build/index.d.mts +216 -0
  4. package/build/index.d.ts +216 -0
  5. package/build/index.js +3502 -0
  6. package/build/index.js.map +1 -0
  7. package/build/index.mjs +3399 -0
  8. package/build/index.mjs.map +1 -0
  9. package/build/internal/{cjs/src/ecom-v1-order-orders.universal.d.ts → ecom-v1-order-orders.universal-DrkwwhMV.d.mts} +640 -1446
  10. package/build/internal/{es/src/ecom-v1-order-orders.universal.d.ts → ecom-v1-order-orders.universal-DrkwwhMV.d.ts} +640 -1446
  11. package/build/internal/index.d.mts +395 -0
  12. package/build/internal/index.d.ts +395 -0
  13. package/build/internal/index.js +3502 -0
  14. package/build/internal/index.js.map +1 -0
  15. package/build/internal/index.mjs +3399 -0
  16. package/build/internal/index.mjs.map +1 -0
  17. package/build/internal/meta.d.mts +3302 -0
  18. package/build/internal/meta.d.ts +3302 -0
  19. package/build/internal/meta.js +1941 -0
  20. package/build/internal/meta.js.map +1 -0
  21. package/build/internal/meta.mjs +1890 -0
  22. package/build/internal/meta.mjs.map +1 -0
  23. package/build/meta.d.mts +3302 -0
  24. package/build/meta.d.ts +3302 -0
  25. package/build/meta.js +1941 -0
  26. package/build/meta.js.map +1 -0
  27. package/build/meta.mjs +1890 -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 -43
  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-order-orders.context.d.ts +0 -34
  40. package/build/cjs/src/ecom-v1-order-orders.context.js +0 -117
  41. package/build/cjs/src/ecom-v1-order-orders.context.js.map +0 -1
  42. package/build/cjs/src/ecom-v1-order-orders.http.d.ts +0 -200
  43. package/build/cjs/src/ecom-v1-order-orders.http.js +0 -1610
  44. package/build/cjs/src/ecom-v1-order-orders.http.js.map +0 -1
  45. package/build/cjs/src/ecom-v1-order-orders.meta.d.ts +0 -78
  46. package/build/cjs/src/ecom-v1-order-orders.meta.js +0 -503
  47. package/build/cjs/src/ecom-v1-order-orders.meta.js.map +0 -1
  48. package/build/cjs/src/ecom-v1-order-orders.public.d.ts +0 -190
  49. package/build/cjs/src/ecom-v1-order-orders.public.js +0 -382
  50. package/build/cjs/src/ecom-v1-order-orders.public.js.map +0 -1
  51. package/build/cjs/src/ecom-v1-order-orders.types.d.ts +0 -6317
  52. package/build/cjs/src/ecom-v1-order-orders.types.js +0 -652
  53. package/build/cjs/src/ecom-v1-order-orders.types.js.map +0 -1
  54. package/build/cjs/src/ecom-v1-order-orders.universal.js +0 -2337
  55. package/build/cjs/src/ecom-v1-order-orders.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 -43
  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-order-orders.context.d.ts +0 -34
  67. package/build/es/src/ecom-v1-order-orders.context.js +0 -62
  68. package/build/es/src/ecom-v1-order-orders.context.js.map +0 -1
  69. package/build/es/src/ecom-v1-order-orders.http.d.ts +0 -200
  70. package/build/es/src/ecom-v1-order-orders.http.js +0 -1582
  71. package/build/es/src/ecom-v1-order-orders.http.js.map +0 -1
  72. package/build/es/src/ecom-v1-order-orders.meta.d.ts +0 -78
  73. package/build/es/src/ecom-v1-order-orders.meta.js +0 -452
  74. package/build/es/src/ecom-v1-order-orders.meta.js.map +0 -1
  75. package/build/es/src/ecom-v1-order-orders.public.d.ts +0 -190
  76. package/build/es/src/ecom-v1-order-orders.public.js +0 -302
  77. package/build/es/src/ecom-v1-order-orders.public.js.map +0 -1
  78. package/build/es/src/ecom-v1-order-orders.types.d.ts +0 -6317
  79. package/build/es/src/ecom-v1-order-orders.types.js +0 -648
  80. package/build/es/src/ecom-v1-order-orders.types.js.map +0 -1
  81. package/build/es/src/ecom-v1-order-orders.universal.js +0 -2285
  82. package/build/es/src/ecom-v1-order-orders.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 -43
  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-order-orders.context.d.ts +0 -62
  93. package/build/internal/cjs/src/ecom-v1-order-orders.context.js +0 -117
  94. package/build/internal/cjs/src/ecom-v1-order-orders.context.js.map +0 -1
  95. package/build/internal/cjs/src/ecom-v1-order-orders.http.d.ts +0 -200
  96. package/build/internal/cjs/src/ecom-v1-order-orders.http.js +0 -1610
  97. package/build/internal/cjs/src/ecom-v1-order-orders.http.js.map +0 -1
  98. package/build/internal/cjs/src/ecom-v1-order-orders.meta.d.ts +0 -78
  99. package/build/internal/cjs/src/ecom-v1-order-orders.meta.js +0 -503
  100. package/build/internal/cjs/src/ecom-v1-order-orders.meta.js.map +0 -1
  101. package/build/internal/cjs/src/ecom-v1-order-orders.public.d.ts +0 -341
  102. package/build/internal/cjs/src/ecom-v1-order-orders.public.js +0 -382
  103. package/build/internal/cjs/src/ecom-v1-order-orders.public.js.map +0 -1
  104. package/build/internal/cjs/src/ecom-v1-order-orders.types.d.ts +0 -6317
  105. package/build/internal/cjs/src/ecom-v1-order-orders.types.js +0 -652
  106. package/build/internal/cjs/src/ecom-v1-order-orders.types.js.map +0 -1
  107. package/build/internal/cjs/src/ecom-v1-order-orders.universal.js +0 -2337
  108. package/build/internal/cjs/src/ecom-v1-order-orders.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 -43
  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-order-orders.context.d.ts +0 -62
  119. package/build/internal/es/src/ecom-v1-order-orders.context.js +0 -62
  120. package/build/internal/es/src/ecom-v1-order-orders.context.js.map +0 -1
  121. package/build/internal/es/src/ecom-v1-order-orders.http.d.ts +0 -200
  122. package/build/internal/es/src/ecom-v1-order-orders.http.js +0 -1582
  123. package/build/internal/es/src/ecom-v1-order-orders.http.js.map +0 -1
  124. package/build/internal/es/src/ecom-v1-order-orders.meta.d.ts +0 -78
  125. package/build/internal/es/src/ecom-v1-order-orders.meta.js +0 -452
  126. package/build/internal/es/src/ecom-v1-order-orders.meta.js.map +0 -1
  127. package/build/internal/es/src/ecom-v1-order-orders.public.d.ts +0 -341
  128. package/build/internal/es/src/ecom-v1-order-orders.public.js +0 -302
  129. package/build/internal/es/src/ecom-v1-order-orders.public.js.map +0 -1
  130. package/build/internal/es/src/ecom-v1-order-orders.types.d.ts +0 -6317
  131. package/build/internal/es/src/ecom-v1-order-orders.types.js +0 -648
  132. package/build/internal/es/src/ecom-v1-order-orders.types.js.map +0 -1
  133. package/build/internal/es/src/ecom-v1-order-orders.universal.js +0 -2285
  134. package/build/internal/es/src/ecom-v1-order-orders.universal.js.map +0 -1
@@ -1,1610 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.bulkUpdateOrderTags = exports.aggregateOrders = exports.updateOrderStatus = exports.cancelOrder = exports.deleteActivity = exports.updateActivity = exports.addActivity = exports.updateOrderLineItem = exports.commitDeltas = exports.bulkUpdateOrders = exports.updateOrder = exports.createOrder = exports.searchOrders = exports.getOrder = exports.captureAuthorizedPayments = exports.voidAuthorizedPayments = exports.triggerRefund = exports.chargeMemberships = exports.paymentCollectionCreatePaymentGatewayOrder = exports.getRefundabilityStatus = exports.paymentCollectionBulkMarkOrdersAsPaid = exports.paymentCollectionMarkOrderAsPaid = exports.recordManuallyCollectedPayment = exports.getPaymentCollectabilityStatus = exports.preparePaymentCollection = 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 timestamp_1 = require("@wix/sdk-runtime/transformations/timestamp");
8
- const timestamp_2 = require("@wix/sdk-runtime/transformations/timestamp");
9
- const field_mask_1 = require("@wix/sdk-runtime/transformations/field-mask");
10
- const transform_paths_1 = require("@wix/sdk-runtime/transformations/transform-paths");
11
- const rest_modules_2 = require("@wix/sdk-runtime/rest-modules");
12
- function resolveComWixEcomOrdersV1OrdersUrl(opts) {
13
- const domainToMappings = {
14
- _: [
15
- {
16
- srcPath: '/_api/ecom-orders',
17
- destPath: '',
18
- },
19
- {
20
- srcPath: '/_api/orders',
21
- destPath: '',
22
- },
23
- ],
24
- 'manage._base_domain_': [
25
- {
26
- srcPath: '/_api/ecom-orders',
27
- destPath: '',
28
- },
29
- ],
30
- 'www.wixapis.com': [
31
- {
32
- srcPath: '/ecom/v1/bulk/orders',
33
- destPath: '/v1/bulk/orders',
34
- },
35
- {
36
- srcPath: '/ecom/v1/orders',
37
- destPath: '/v1/orders',
38
- },
39
- ],
40
- };
41
- return (0, rest_modules_2.resolveUrl)(Object.assign(opts, { domainToMappings }));
42
- }
43
- function resolveComWixEcomOrdersPaymentsCollectorV1PaymentsCollectorUrl(opts) {
44
- const domainToMappings = {
45
- 'api._api_base_domain_': [
46
- {
47
- srcPath: '/payments-collector',
48
- destPath: '',
49
- },
50
- ],
51
- 'www.wixapis.com': [
52
- {
53
- srcPath: '/ecom/v1/payments-collector',
54
- destPath: '/v1/payments-collector',
55
- },
56
- ],
57
- 'manage._base_domain_': [
58
- {
59
- srcPath: '/ecom/v1/payments-collector',
60
- destPath: '/v1/payments-collector',
61
- },
62
- {
63
- srcPath: '/_api/v1/payments-collector',
64
- destPath: '/v1/payments-collector',
65
- },
66
- {
67
- srcPath: '/v1/payments-collector',
68
- destPath: '/v1/payments-collector',
69
- },
70
- {
71
- srcPath: '/_api/payments-collector',
72
- destPath: '/v1/payments-collector',
73
- },
74
- ],
75
- };
76
- return (0, rest_modules_2.resolveUrl)(Object.assign(opts, { domainToMappings }));
77
- }
78
- const PACKAGE_NAME = '@wix/auto_sdk_ecom_orders';
79
- /**
80
- * Prepares payment collection for given ecom order. This is the first of 2-step process of payment collection.
81
- * Here we ensure that payment collection is possible for given order and store and prepare payment gateway order for future charge.
82
- * 2nd step is an actual charge of prepared payment gateway order. This could be done either
83
- * via Wix-Cashier's API (https://bo.wix.com/wix-docs/rest/wix-cashier/pay/charge/charge-for-order)
84
- * or using Cashier Payments Widget (https://github.com/wix-private/cashier-client/tree/master/packages/cashier-payments-widget)
85
- */
86
- function preparePaymentCollection(payload) {
87
- function __preparePaymentCollection({ host }) {
88
- const metadata = {
89
- entityFqdn: 'wix.ecom.v1.order',
90
- method: 'POST',
91
- methodFqn: 'com.wix.ecom.orders.payments_collector.v1.PaymentsCollector.PreparePaymentCollection',
92
- packageName: PACKAGE_NAME,
93
- url: resolveComWixEcomOrdersPaymentsCollectorV1PaymentsCollectorUrl({
94
- protoPath: '/v1/payments-collector/orders/{ecomOrderId}/prepare-payment-collection',
95
- data: payload,
96
- host,
97
- }),
98
- data: payload,
99
- };
100
- return metadata;
101
- }
102
- return __preparePaymentCollection;
103
- }
104
- exports.preparePaymentCollection = preparePaymentCollection;
105
- /**
106
- * Provides payment collectability status for given order. If payment collection is possible
107
- * response will contain collectable amount for given ecom order. If not - response will contain
108
- * reason why payment collection is not possible.
109
- */
110
- function getPaymentCollectabilityStatus(payload) {
111
- function __getPaymentCollectabilityStatus({ host }) {
112
- const metadata = {
113
- entityFqdn: 'wix.ecom.v1.order',
114
- method: 'GET',
115
- methodFqn: 'com.wix.ecom.orders.payments_collector.v1.PaymentsCollector.GetPaymentCollectabilityStatus',
116
- packageName: PACKAGE_NAME,
117
- url: resolveComWixEcomOrdersPaymentsCollectorV1PaymentsCollectorUrl({
118
- protoPath: '/v1/payments-collector/orders/{ecomOrderId}/payment-collectability-status',
119
- data: payload,
120
- host,
121
- }),
122
- params: (0, rest_modules_1.toURLSearchParams)(payload),
123
- };
124
- return metadata;
125
- }
126
- return __getPaymentCollectabilityStatus;
127
- }
128
- exports.getPaymentCollectabilityStatus = getPaymentCollectabilityStatus;
129
- /**
130
- * Records and approves new manual payment with provided custom amount on given order.
131
- * Existing pending payments are ignored.
132
- * Custom amount is expected to be less or equal remaining amount to be paid on order (affected by approved payments, refunds and gift card payments)
133
- */
134
- function recordManuallyCollectedPayment(payload) {
135
- function __recordManuallyCollectedPayment({ host }) {
136
- const metadata = {
137
- entityFqdn: 'wix.ecom.v1.order',
138
- method: 'POST',
139
- methodFqn: 'com.wix.ecom.orders.payments_collector.v1.PaymentsCollector.RecordManuallyCollectedPayment',
140
- packageName: PACKAGE_NAME,
141
- url: resolveComWixEcomOrdersPaymentsCollectorV1PaymentsCollectorUrl({
142
- protoPath: '/v1/payments-collector/orders/{orderId}/manual-payment',
143
- data: payload,
144
- host,
145
- }),
146
- data: payload,
147
- };
148
- return metadata;
149
- }
150
- return __recordManuallyCollectedPayment;
151
- }
152
- exports.recordManuallyCollectedPayment = recordManuallyCollectedPayment;
153
- /**
154
- * Marks the order as paid. `order.paymentStatus` field *eventually* changes to `PAID`.
155
- * In case the order already has an offline payment transaction associated with it
156
- * (usually when manual payment method is chosen at checkout) - This transaction will become approved.
157
- * In case the order has no payment transactions associated with it
158
- * (usually when the item is set to be paid offline after checkout or when an order is created from the backoffice) - A payment transaction
159
- * will be created and approved.
160
- */
161
- function paymentCollectionMarkOrderAsPaid(payload) {
162
- function __paymentCollectionMarkOrderAsPaid({ host }) {
163
- const metadata = {
164
- entityFqdn: 'wix.ecom.v1.order',
165
- method: 'POST',
166
- methodFqn: 'com.wix.ecom.orders.payments_collector.v1.PaymentsCollector.MarkOrderAsPaid',
167
- packageName: PACKAGE_NAME,
168
- url: resolveComWixEcomOrdersPaymentsCollectorV1PaymentsCollectorUrl({
169
- protoPath: '/v1/payments-collector/orders/{ecomOrderId}/mark-as-paid',
170
- data: payload,
171
- host,
172
- }),
173
- data: payload,
174
- transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
175
- {
176
- transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
177
- paths: [
178
- { path: 'order.createdDate' },
179
- { path: 'order.updatedDate' },
180
- { path: 'order.purchasedDate' },
181
- { path: 'order.lineItems.image.urlExpirationDate' },
182
- { path: 'order.lineItems.digitalFile.expirationDate' },
183
- {
184
- path: 'order.lineItems.subscriptionInfo.subscriptionSettings.startDate',
185
- },
186
- { path: 'order.shippingInfo.logistics.deliverByDate' },
187
- { path: 'order.shippingInfo.logistics.deliveryTimeSlot.from' },
188
- { path: 'order.shippingInfo.logistics.deliveryTimeSlot.to' },
189
- { path: 'order.activities.createdDate' },
190
- ],
191
- },
192
- {
193
- transformFn: float_2.transformRESTFloatToSDKFloat,
194
- paths: [
195
- { path: 'order.lineItems.image.focalPoint.x' },
196
- { path: 'order.lineItems.image.focalPoint.y' },
197
- { path: 'order.lineItems.physicalProperties.weight' },
198
- { path: 'order.billingInfo.address.geocode.latitude' },
199
- { path: 'order.billingInfo.address.geocode.longitude' },
200
- {
201
- path: 'order.shippingInfo.logistics.shippingDestination.address.geocode.latitude',
202
- },
203
- {
204
- path: 'order.shippingInfo.logistics.shippingDestination.address.geocode.longitude',
205
- },
206
- {
207
- path: 'order.shippingInfo.logistics.pickupDetails.address.geocode.latitude',
208
- },
209
- {
210
- path: 'order.shippingInfo.logistics.pickupDetails.address.geocode.longitude',
211
- },
212
- { path: 'order.recipientInfo.address.geocode.latitude' },
213
- { path: 'order.recipientInfo.address.geocode.longitude' },
214
- ],
215
- },
216
- ]),
217
- };
218
- return metadata;
219
- }
220
- return __paymentCollectionMarkOrderAsPaid;
221
- }
222
- exports.paymentCollectionMarkOrderAsPaid = paymentCollectionMarkOrderAsPaid;
223
- /** Marks multiple orders as paid. `order.paymentStatus` field *eventually* changes to `PAID`. */
224
- function paymentCollectionBulkMarkOrdersAsPaid(payload) {
225
- function __paymentCollectionBulkMarkOrdersAsPaid({ host }) {
226
- const metadata = {
227
- entityFqdn: 'wix.ecom.v1.order',
228
- method: 'POST',
229
- methodFqn: 'com.wix.ecom.orders.payments_collector.v1.PaymentsCollector.BulkMarkOrdersAsPaid',
230
- packageName: PACKAGE_NAME,
231
- url: resolveComWixEcomOrdersPaymentsCollectorV1PaymentsCollectorUrl({
232
- protoPath: '/v1/bulk/payments-collector/mark-as-paid',
233
- data: payload,
234
- host,
235
- }),
236
- data: payload,
237
- transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
238
- {
239
- transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
240
- paths: [
241
- { path: 'results.item.createdDate' },
242
- { path: 'results.item.updatedDate' },
243
- { path: 'results.item.purchasedDate' },
244
- { path: 'results.item.lineItems.image.urlExpirationDate' },
245
- { path: 'results.item.lineItems.digitalFile.expirationDate' },
246
- {
247
- path: 'results.item.lineItems.subscriptionInfo.subscriptionSettings.startDate',
248
- },
249
- { path: 'results.item.shippingInfo.logistics.deliverByDate' },
250
- {
251
- path: 'results.item.shippingInfo.logistics.deliveryTimeSlot.from',
252
- },
253
- {
254
- path: 'results.item.shippingInfo.logistics.deliveryTimeSlot.to',
255
- },
256
- { path: 'results.item.activities.createdDate' },
257
- ],
258
- },
259
- {
260
- transformFn: float_2.transformRESTFloatToSDKFloat,
261
- paths: [
262
- { path: 'results.item.lineItems.image.focalPoint.x' },
263
- { path: 'results.item.lineItems.image.focalPoint.y' },
264
- { path: 'results.item.lineItems.physicalProperties.weight' },
265
- { path: 'results.item.billingInfo.address.geocode.latitude' },
266
- { path: 'results.item.billingInfo.address.geocode.longitude' },
267
- {
268
- path: 'results.item.shippingInfo.logistics.shippingDestination.address.geocode.latitude',
269
- },
270
- {
271
- path: 'results.item.shippingInfo.logistics.shippingDestination.address.geocode.longitude',
272
- },
273
- {
274
- path: 'results.item.shippingInfo.logistics.pickupDetails.address.geocode.latitude',
275
- },
276
- {
277
- path: 'results.item.shippingInfo.logistics.pickupDetails.address.geocode.longitude',
278
- },
279
- { path: 'results.item.recipientInfo.address.geocode.latitude' },
280
- { path: 'results.item.recipientInfo.address.geocode.longitude' },
281
- ],
282
- },
283
- ]),
284
- };
285
- return metadata;
286
- }
287
- return __paymentCollectionBulkMarkOrdersAsPaid;
288
- }
289
- exports.paymentCollectionBulkMarkOrdersAsPaid = paymentCollectionBulkMarkOrdersAsPaid;
290
- /** Checks whether this order can be refunded. */
291
- function getRefundabilityStatus(payload) {
292
- function __getRefundabilityStatus({ host }) {
293
- const metadata = {
294
- entityFqdn: 'wix.ecom.v1.order',
295
- method: 'GET',
296
- methodFqn: 'com.wix.ecom.orders.payments_collector.v1.PaymentsCollector.GetRefundabilityStatus',
297
- packageName: PACKAGE_NAME,
298
- url: resolveComWixEcomOrdersPaymentsCollectorV1PaymentsCollectorUrl({
299
- protoPath: '/v1/payments-collector/orders/{ecomOrderId}/refundability',
300
- data: payload,
301
- host,
302
- }),
303
- params: (0, rest_modules_1.toURLSearchParams)(payload),
304
- };
305
- return metadata;
306
- }
307
- return __getRefundabilityStatus;
308
- }
309
- exports.getRefundabilityStatus = getRefundabilityStatus;
310
- /**
311
- * Call this endpoint to create an order in the payment gateway system. The amount of the order would be either:
312
- * 1. An explicit amount provided in the request, or;
313
- * 2. If an explicit amount is not provided - the remaining amount to complete the payment of that eCom order.
314
- * As a result, an ID of the created payment gateway order would be returned.
315
- * You can then use Wix Payments APIs to approve that order or collect payment, which will eventually change the eCom order state (e.g mark it as paid).
316
- */
317
- function paymentCollectionCreatePaymentGatewayOrder(payload) {
318
- function __paymentCollectionCreatePaymentGatewayOrder({ host }) {
319
- const metadata = {
320
- entityFqdn: 'wix.ecom.v1.order',
321
- method: 'POST',
322
- methodFqn: 'com.wix.ecom.orders.payments_collector.v1.PaymentsCollector.CreatePaymentGatewayOrder',
323
- packageName: PACKAGE_NAME,
324
- url: resolveComWixEcomOrdersPaymentsCollectorV1PaymentsCollectorUrl({
325
- protoPath: '/v1/payments-collector/orders/{ecomOrderId}/create-payment-gateway-order',
326
- data: payload,
327
- host,
328
- }),
329
- data: payload,
330
- };
331
- return metadata;
332
- }
333
- return __paymentCollectionCreatePaymentGatewayOrder;
334
- }
335
- exports.paymentCollectionCreatePaymentGatewayOrder = paymentCollectionCreatePaymentGatewayOrder;
336
- function chargeMemberships(payload) {
337
- function __chargeMemberships({ host }) {
338
- const serializedData = (0, transform_paths_1.transformPaths)(payload, [
339
- {
340
- transformFn: timestamp_1.transformSDKTimestampToRESTTimestamp,
341
- paths: [{ path: 'membershipCharges.serviceProperties.scheduledDate' }],
342
- },
343
- ]);
344
- const metadata = {
345
- entityFqdn: 'wix.ecom.v1.order',
346
- method: 'POST',
347
- methodFqn: 'com.wix.ecom.orders.payments_collector.v1.PaymentsCollector.ChargeMemberships',
348
- packageName: PACKAGE_NAME,
349
- url: resolveComWixEcomOrdersPaymentsCollectorV1PaymentsCollectorUrl({
350
- protoPath: '/v1/payments-collector/orders/{ecomOrderId}/charge-membership',
351
- data: serializedData,
352
- host,
353
- }),
354
- data: serializedData,
355
- };
356
- return metadata;
357
- }
358
- return __chargeMemberships;
359
- }
360
- exports.chargeMemberships = chargeMemberships;
361
- /**
362
- * Calls corresponding payment providers and creates refund transactions for requested payments.
363
- * Updates order transactions based on refund results.
364
- * For requested payments with `TriggerRefundRequest.payments.external_refund = true` will not call payment providers and
365
- * will only update order transactions.
366
- */
367
- function triggerRefund(payload) {
368
- function __triggerRefund({ host }) {
369
- const metadata = {
370
- entityFqdn: 'wix.ecom.v1.order',
371
- method: 'POST',
372
- methodFqn: 'com.wix.ecom.orders.payments_collector.v1.PaymentsCollector.TriggerRefund',
373
- packageName: PACKAGE_NAME,
374
- url: resolveComWixEcomOrdersPaymentsCollectorV1PaymentsCollectorUrl({
375
- protoPath: '/v1/payments-collector/orders/{ecomOrderId}/trigger-refund',
376
- data: payload,
377
- host,
378
- }),
379
- data: payload,
380
- transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
381
- {
382
- transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
383
- paths: [
384
- { path: 'orderTransactions.payments.createdDate' },
385
- { path: 'orderTransactions.payments.updatedDate' },
386
- {
387
- path: 'orderTransactions.payments.regularPaymentDetails.authorizationDetails.authorizedDate',
388
- },
389
- {
390
- path: 'orderTransactions.payments.regularPaymentDetails.authorizationDetails.captures.createdDate',
391
- },
392
- {
393
- path: 'orderTransactions.payments.regularPaymentDetails.authorizationDetails.void.voidedDate',
394
- },
395
- {
396
- path: 'orderTransactions.payments.regularPaymentDetails.authorizationDetails.scheduledAction.executionDate',
397
- },
398
- { path: 'orderTransactions.refunds.createdDate' },
399
- ],
400
- },
401
- ]),
402
- };
403
- return metadata;
404
- }
405
- return __triggerRefund;
406
- }
407
- exports.triggerRefund = triggerRefund;
408
- /**
409
- * Void authorized payments
410
- * Transaction statuses for related payments will be updated in async way
411
- */
412
- function voidAuthorizedPayments(payload) {
413
- function __voidAuthorizedPayments({ host }) {
414
- const metadata = {
415
- entityFqdn: 'wix.ecom.v1.order',
416
- method: 'POST',
417
- methodFqn: 'com.wix.ecom.orders.payments_collector.v1.PaymentsCollector.VoidAuthorizedPayments',
418
- packageName: PACKAGE_NAME,
419
- url: resolveComWixEcomOrdersPaymentsCollectorV1PaymentsCollectorUrl({
420
- protoPath: '/v1/payments-collector/orders/{ecomOrderId}/void-authorized-payments',
421
- data: payload,
422
- host,
423
- }),
424
- data: payload,
425
- transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
426
- {
427
- transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
428
- paths: [
429
- { path: 'orderTransactions.payments.createdDate' },
430
- { path: 'orderTransactions.payments.updatedDate' },
431
- {
432
- path: 'orderTransactions.payments.regularPaymentDetails.authorizationDetails.authorizedDate',
433
- },
434
- {
435
- path: 'orderTransactions.payments.regularPaymentDetails.authorizationDetails.captures.createdDate',
436
- },
437
- {
438
- path: 'orderTransactions.payments.regularPaymentDetails.authorizationDetails.void.voidedDate',
439
- },
440
- {
441
- path: 'orderTransactions.payments.regularPaymentDetails.authorizationDetails.scheduledAction.executionDate',
442
- },
443
- { path: 'orderTransactions.refunds.createdDate' },
444
- ],
445
- },
446
- ]),
447
- };
448
- return metadata;
449
- }
450
- return __voidAuthorizedPayments;
451
- }
452
- exports.voidAuthorizedPayments = voidAuthorizedPayments;
453
- /**
454
- * Capture authorized payments
455
- * Transaction statuses for related payments will be updated in async way
456
- */
457
- function captureAuthorizedPayments(payload) {
458
- function __captureAuthorizedPayments({ host }) {
459
- const metadata = {
460
- entityFqdn: 'wix.ecom.v1.order',
461
- method: 'POST',
462
- methodFqn: 'com.wix.ecom.orders.payments_collector.v1.PaymentsCollector.CaptureAuthorizedPayments',
463
- packageName: PACKAGE_NAME,
464
- url: resolveComWixEcomOrdersPaymentsCollectorV1PaymentsCollectorUrl({
465
- protoPath: '/v1/payments-collector/orders/{ecomOrderId}/capture-authorized-payments',
466
- data: payload,
467
- host,
468
- }),
469
- data: payload,
470
- transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
471
- {
472
- transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
473
- paths: [
474
- { path: 'orderTransactions.payments.createdDate' },
475
- { path: 'orderTransactions.payments.updatedDate' },
476
- {
477
- path: 'orderTransactions.payments.regularPaymentDetails.authorizationDetails.authorizedDate',
478
- },
479
- {
480
- path: 'orderTransactions.payments.regularPaymentDetails.authorizationDetails.captures.createdDate',
481
- },
482
- {
483
- path: 'orderTransactions.payments.regularPaymentDetails.authorizationDetails.void.voidedDate',
484
- },
485
- {
486
- path: 'orderTransactions.payments.regularPaymentDetails.authorizationDetails.scheduledAction.executionDate',
487
- },
488
- { path: 'orderTransactions.refunds.createdDate' },
489
- ],
490
- },
491
- ]),
492
- };
493
- return metadata;
494
- }
495
- return __captureAuthorizedPayments;
496
- }
497
- exports.captureAuthorizedPayments = captureAuthorizedPayments;
498
- /**
499
- * Retrieves an order.
500
- *
501
- *
502
- * The `getOrder()` function returns a Promise that resolves when the specified order is retrieved.
503
- *
504
- * To retrieve an order's payment and refund details, including amounts, payment methods, and payment statuses, pass the order ID to [`listTransactionsForSingleOrder( )`](https://www.wix.com/velo/reference/wix-ecom-backend/ordertransactions/listtransactionsforsingleorder).
505
- */
506
- function getOrder(payload) {
507
- function __getOrder({ host }) {
508
- const metadata = {
509
- entityFqdn: 'wix.ecom.v1.order',
510
- method: 'GET',
511
- methodFqn: 'com.wix.ecom.orders.v1.Orders.GetOrder',
512
- packageName: PACKAGE_NAME,
513
- url: resolveComWixEcomOrdersV1OrdersUrl({
514
- protoPath: '/v1/orders/{id}',
515
- data: payload,
516
- host,
517
- }),
518
- params: (0, rest_modules_1.toURLSearchParams)(payload),
519
- transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
520
- {
521
- transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
522
- paths: [
523
- { path: 'order.createdDate' },
524
- { path: 'order.updatedDate' },
525
- { path: 'order.purchasedDate' },
526
- { path: 'order.lineItems.image.urlExpirationDate' },
527
- { path: 'order.lineItems.digitalFile.expirationDate' },
528
- {
529
- path: 'order.lineItems.subscriptionInfo.subscriptionSettings.startDate',
530
- },
531
- { path: 'order.shippingInfo.logistics.deliverByDate' },
532
- { path: 'order.shippingInfo.logistics.deliveryTimeSlot.from' },
533
- { path: 'order.shippingInfo.logistics.deliveryTimeSlot.to' },
534
- { path: 'order.activities.createdDate' },
535
- ],
536
- },
537
- {
538
- transformFn: float_2.transformRESTFloatToSDKFloat,
539
- paths: [
540
- { path: 'order.lineItems.image.focalPoint.x' },
541
- { path: 'order.lineItems.image.focalPoint.y' },
542
- { path: 'order.lineItems.physicalProperties.weight' },
543
- { path: 'order.billingInfo.address.geocode.latitude' },
544
- { path: 'order.billingInfo.address.geocode.longitude' },
545
- {
546
- path: 'order.shippingInfo.logistics.shippingDestination.address.geocode.latitude',
547
- },
548
- {
549
- path: 'order.shippingInfo.logistics.shippingDestination.address.geocode.longitude',
550
- },
551
- {
552
- path: 'order.shippingInfo.logistics.pickupDetails.address.geocode.latitude',
553
- },
554
- {
555
- path: 'order.shippingInfo.logistics.pickupDetails.address.geocode.longitude',
556
- },
557
- { path: 'order.recipientInfo.address.geocode.latitude' },
558
- { path: 'order.recipientInfo.address.geocode.longitude' },
559
- ],
560
- },
561
- ]),
562
- };
563
- return metadata;
564
- }
565
- return __getOrder;
566
- }
567
- exports.getOrder = getOrder;
568
- /**
569
- * Retrieves a list of orders, given the provided paging, filtering, and sorting.
570
- *
571
- *
572
- * Search Orders runs with these defaults, which you can override:
573
- *
574
- * - `createdDate` is sorted in `DESC` order
575
- * - `cursorPaging.limit` is `100`
576
- * - `filter: {"status": {"$ne": "INITIALIZED"}}` - other order statuses can be queried, but orders with `status: "INITIALIZED"` are never returned
577
- *
578
- * For field support for filters and sorting, see [Orders: Supported Filters and Sorting](https://dev.wix.com/docs/rest/api-reference/wix-e-commerce/orders/supported-filters-and-sorting).
579
- *
580
- * To learn about working with _Search_ endpoints, see
581
- * [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language), and
582
- * [Sorting and Paging](https://dev.wix.com/docs/rest/articles/getting-started/sorting-and-paging).
583
- */
584
- function searchOrders(payload) {
585
- function __searchOrders({ host }) {
586
- const metadata = {
587
- entityFqdn: 'wix.ecom.v1.order',
588
- method: 'POST',
589
- methodFqn: 'com.wix.ecom.orders.v1.Orders.SearchOrders',
590
- packageName: PACKAGE_NAME,
591
- url: resolveComWixEcomOrdersV1OrdersUrl({
592
- protoPath: '/v1/orders/search',
593
- data: payload,
594
- host,
595
- }),
596
- data: payload,
597
- transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
598
- {
599
- transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
600
- paths: [
601
- { path: 'orders.createdDate' },
602
- { path: 'orders.updatedDate' },
603
- { path: 'orders.purchasedDate' },
604
- { path: 'orders.lineItems.image.urlExpirationDate' },
605
- { path: 'orders.lineItems.digitalFile.expirationDate' },
606
- {
607
- path: 'orders.lineItems.subscriptionInfo.subscriptionSettings.startDate',
608
- },
609
- { path: 'orders.shippingInfo.logistics.deliverByDate' },
610
- { path: 'orders.shippingInfo.logistics.deliveryTimeSlot.from' },
611
- { path: 'orders.shippingInfo.logistics.deliveryTimeSlot.to' },
612
- { path: 'orders.activities.createdDate' },
613
- ],
614
- },
615
- {
616
- transformFn: float_2.transformRESTFloatToSDKFloat,
617
- paths: [
618
- { path: 'orders.lineItems.image.focalPoint.x' },
619
- { path: 'orders.lineItems.image.focalPoint.y' },
620
- { path: 'orders.lineItems.physicalProperties.weight' },
621
- { path: 'orders.billingInfo.address.geocode.latitude' },
622
- { path: 'orders.billingInfo.address.geocode.longitude' },
623
- {
624
- path: 'orders.shippingInfo.logistics.shippingDestination.address.geocode.latitude',
625
- },
626
- {
627
- path: 'orders.shippingInfo.logistics.shippingDestination.address.geocode.longitude',
628
- },
629
- {
630
- path: 'orders.shippingInfo.logistics.pickupDetails.address.geocode.latitude',
631
- },
632
- {
633
- path: 'orders.shippingInfo.logistics.pickupDetails.address.geocode.longitude',
634
- },
635
- { path: 'orders.recipientInfo.address.geocode.latitude' },
636
- { path: 'orders.recipientInfo.address.geocode.longitude' },
637
- ],
638
- },
639
- ]),
640
- };
641
- return metadata;
642
- }
643
- return __searchOrders;
644
- }
645
- exports.searchOrders = searchOrders;
646
- /**
647
- * Creates an order.
648
- *
649
- *
650
- * The `createOrder()` function returns a Promise that resolves when the order is created.
651
- *
652
- * > **Notes:**
653
- * > + If an item is digital - `lineItems[i].itemType.preset: DIGITAL` - then `lineItems[i].digitalFile` must be provided.
654
- * > + If `lineItems[i].id` is passed, it must be either a valid GUID, or empty.
655
- */
656
- function createOrder(payload) {
657
- function __createOrder({ host }) {
658
- const serializedData = (0, transform_paths_1.transformPaths)(payload, [
659
- {
660
- transformFn: timestamp_1.transformSDKTimestampToRESTTimestamp,
661
- paths: [
662
- { path: 'order.createdDate' },
663
- { path: 'order.updatedDate' },
664
- { path: 'order.purchasedDate' },
665
- { path: 'order.lineItems.image.urlExpirationDate' },
666
- { path: 'order.lineItems.digitalFile.expirationDate' },
667
- {
668
- path: 'order.lineItems.subscriptionInfo.subscriptionSettings.startDate',
669
- },
670
- { path: 'order.shippingInfo.logistics.deliverByDate' },
671
- { path: 'order.shippingInfo.logistics.deliveryTimeSlot.from' },
672
- { path: 'order.shippingInfo.logistics.deliveryTimeSlot.to' },
673
- { path: 'order.activities.createdDate' },
674
- ],
675
- },
676
- {
677
- transformFn: float_1.transformSDKFloatToRESTFloat,
678
- paths: [
679
- { path: 'order.lineItems.image.focalPoint.x' },
680
- { path: 'order.lineItems.image.focalPoint.y' },
681
- { path: 'order.lineItems.physicalProperties.weight' },
682
- { path: 'order.billingInfo.address.geocode.latitude' },
683
- { path: 'order.billingInfo.address.geocode.longitude' },
684
- {
685
- path: 'order.shippingInfo.logistics.shippingDestination.address.geocode.latitude',
686
- },
687
- {
688
- path: 'order.shippingInfo.logistics.shippingDestination.address.geocode.longitude',
689
- },
690
- {
691
- path: 'order.shippingInfo.logistics.pickupDetails.address.geocode.latitude',
692
- },
693
- {
694
- path: 'order.shippingInfo.logistics.pickupDetails.address.geocode.longitude',
695
- },
696
- { path: 'order.recipientInfo.address.geocode.latitude' },
697
- { path: 'order.recipientInfo.address.geocode.longitude' },
698
- ],
699
- },
700
- ]);
701
- const metadata = {
702
- entityFqdn: 'wix.ecom.v1.order',
703
- method: 'POST',
704
- methodFqn: 'com.wix.ecom.orders.v1.Orders.CreateOrder',
705
- packageName: PACKAGE_NAME,
706
- url: resolveComWixEcomOrdersV1OrdersUrl({
707
- protoPath: '/v1/orders',
708
- data: serializedData,
709
- host,
710
- }),
711
- data: serializedData,
712
- transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
713
- {
714
- transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
715
- paths: [
716
- { path: 'order.createdDate' },
717
- { path: 'order.updatedDate' },
718
- { path: 'order.purchasedDate' },
719
- { path: 'order.lineItems.image.urlExpirationDate' },
720
- { path: 'order.lineItems.digitalFile.expirationDate' },
721
- {
722
- path: 'order.lineItems.subscriptionInfo.subscriptionSettings.startDate',
723
- },
724
- { path: 'order.shippingInfo.logistics.deliverByDate' },
725
- { path: 'order.shippingInfo.logistics.deliveryTimeSlot.from' },
726
- { path: 'order.shippingInfo.logistics.deliveryTimeSlot.to' },
727
- { path: 'order.activities.createdDate' },
728
- ],
729
- },
730
- {
731
- transformFn: float_2.transformRESTFloatToSDKFloat,
732
- paths: [
733
- { path: 'order.lineItems.image.focalPoint.x' },
734
- { path: 'order.lineItems.image.focalPoint.y' },
735
- { path: 'order.lineItems.physicalProperties.weight' },
736
- { path: 'order.billingInfo.address.geocode.latitude' },
737
- { path: 'order.billingInfo.address.geocode.longitude' },
738
- {
739
- path: 'order.shippingInfo.logistics.shippingDestination.address.geocode.latitude',
740
- },
741
- {
742
- path: 'order.shippingInfo.logistics.shippingDestination.address.geocode.longitude',
743
- },
744
- {
745
- path: 'order.shippingInfo.logistics.pickupDetails.address.geocode.latitude',
746
- },
747
- {
748
- path: 'order.shippingInfo.logistics.pickupDetails.address.geocode.longitude',
749
- },
750
- { path: 'order.recipientInfo.address.geocode.latitude' },
751
- { path: 'order.recipientInfo.address.geocode.longitude' },
752
- ],
753
- },
754
- ]),
755
- };
756
- return metadata;
757
- }
758
- return __createOrder;
759
- }
760
- exports.createOrder = createOrder;
761
- /**
762
- * Updates an order.
763
- *
764
- *
765
- * The `updateOrder()` function returns a Promise that resolves when the specified order's information is updated.
766
- *
767
- * Currently, the following fields can be updated:
768
- * + `order.buyerInfo.email`
769
- * + `order.buyerLanguage`
770
- * + `order.weightUnit`
771
- * + `order.billingInfo.address`
772
- * + `order.billingInfo.contactDetails`
773
- * + `order.archived`
774
- * + `order.attributionSource`
775
- * + `order.seenByAHuman`
776
- * + `order.recipientInfo.address`
777
- * + `order.recipientInfo.contactDetails`
778
- * + `order.shippingInfo.logistics.shippingDestination.address`
779
- * + `order.shippingInfo.logistics.shippingDestination.contactDetails`
780
- *
781
- * To update a field's value, include the new value in the `order` object in the method parameters.
782
- * To remove a field's value, pass `null`.
783
- *
784
- * > **Note:** Removing `buyerInfo` or `contactDetails` fields results in an error.
785
- *
786
- * To update an order's payment status, use [`updatePaymentStatus( )`](https://www.wix.com/velo/reference/wix-ecom-backend/ordertransactions/updatepaymentstatus).
787
- */
788
- function updateOrder(payload) {
789
- function __updateOrder({ host }) {
790
- const serializedData = (0, transform_paths_1.transformPaths)(payload, [
791
- {
792
- transformFn: field_mask_1.transformSDKFieldMaskToRESTFieldMask,
793
- paths: [{ path: 'fieldMask' }],
794
- },
795
- {
796
- transformFn: timestamp_1.transformSDKTimestampToRESTTimestamp,
797
- paths: [
798
- { path: 'order.createdDate' },
799
- { path: 'order.updatedDate' },
800
- { path: 'order.purchasedDate' },
801
- { path: 'order.lineItems.image.urlExpirationDate' },
802
- { path: 'order.lineItems.digitalFile.expirationDate' },
803
- {
804
- path: 'order.lineItems.subscriptionInfo.subscriptionSettings.startDate',
805
- },
806
- { path: 'order.shippingInfo.logistics.deliverByDate' },
807
- { path: 'order.shippingInfo.logistics.deliveryTimeSlot.from' },
808
- { path: 'order.shippingInfo.logistics.deliveryTimeSlot.to' },
809
- { path: 'order.activities.createdDate' },
810
- ],
811
- },
812
- {
813
- transformFn: float_1.transformSDKFloatToRESTFloat,
814
- paths: [
815
- { path: 'order.lineItems.image.focalPoint.x' },
816
- { path: 'order.lineItems.image.focalPoint.y' },
817
- { path: 'order.lineItems.physicalProperties.weight' },
818
- { path: 'order.billingInfo.address.geocode.latitude' },
819
- { path: 'order.billingInfo.address.geocode.longitude' },
820
- {
821
- path: 'order.shippingInfo.logistics.shippingDestination.address.geocode.latitude',
822
- },
823
- {
824
- path: 'order.shippingInfo.logistics.shippingDestination.address.geocode.longitude',
825
- },
826
- {
827
- path: 'order.shippingInfo.logistics.pickupDetails.address.geocode.latitude',
828
- },
829
- {
830
- path: 'order.shippingInfo.logistics.pickupDetails.address.geocode.longitude',
831
- },
832
- { path: 'order.recipientInfo.address.geocode.latitude' },
833
- { path: 'order.recipientInfo.address.geocode.longitude' },
834
- ],
835
- },
836
- ]);
837
- const metadata = {
838
- entityFqdn: 'wix.ecom.v1.order',
839
- method: 'PATCH',
840
- methodFqn: 'com.wix.ecom.orders.v1.Orders.UpdateOrder',
841
- packageName: PACKAGE_NAME,
842
- url: resolveComWixEcomOrdersV1OrdersUrl({
843
- protoPath: '/v1/orders/{order.id}',
844
- data: serializedData,
845
- host,
846
- }),
847
- data: serializedData,
848
- transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
849
- {
850
- transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
851
- paths: [
852
- { path: 'order.createdDate' },
853
- { path: 'order.updatedDate' },
854
- { path: 'order.purchasedDate' },
855
- { path: 'order.lineItems.image.urlExpirationDate' },
856
- { path: 'order.lineItems.digitalFile.expirationDate' },
857
- {
858
- path: 'order.lineItems.subscriptionInfo.subscriptionSettings.startDate',
859
- },
860
- { path: 'order.shippingInfo.logistics.deliverByDate' },
861
- { path: 'order.shippingInfo.logistics.deliveryTimeSlot.from' },
862
- { path: 'order.shippingInfo.logistics.deliveryTimeSlot.to' },
863
- { path: 'order.activities.createdDate' },
864
- ],
865
- },
866
- {
867
- transformFn: float_2.transformRESTFloatToSDKFloat,
868
- paths: [
869
- { path: 'order.lineItems.image.focalPoint.x' },
870
- { path: 'order.lineItems.image.focalPoint.y' },
871
- { path: 'order.lineItems.physicalProperties.weight' },
872
- { path: 'order.billingInfo.address.geocode.latitude' },
873
- { path: 'order.billingInfo.address.geocode.longitude' },
874
- {
875
- path: 'order.shippingInfo.logistics.shippingDestination.address.geocode.latitude',
876
- },
877
- {
878
- path: 'order.shippingInfo.logistics.shippingDestination.address.geocode.longitude',
879
- },
880
- {
881
- path: 'order.shippingInfo.logistics.pickupDetails.address.geocode.latitude',
882
- },
883
- {
884
- path: 'order.shippingInfo.logistics.pickupDetails.address.geocode.longitude',
885
- },
886
- { path: 'order.recipientInfo.address.geocode.latitude' },
887
- { path: 'order.recipientInfo.address.geocode.longitude' },
888
- ],
889
- },
890
- ]),
891
- };
892
- return metadata;
893
- }
894
- return __updateOrder;
895
- }
896
- exports.updateOrder = updateOrder;
897
- /**
898
- * Updates up to 100 orders.
899
- *
900
- *
901
- * The `bulkUpdateOrders()` function returns a Promise that resolves when the specified orders' information is updated.
902
- *
903
- * Currently, the following fields can be updated:
904
- * + `order.buyerInfo.email`
905
- * + `order.buyerLanguage`
906
- * + `order.weightUnit`
907
- * + `order.billingInfo.address`
908
- * + `order.billingInfo.contactDetails`
909
- * + `order.archived`
910
- * + `order.attributionSource`
911
- * + `order.seenByAHuman`
912
- * + `order.recipientInfo.address`
913
- * + `order.recipientInfo.contactDetails`
914
- * + `order.shippingInfo.logistics.shippingDestination.address`
915
- * + `order.shippingInfo.logistics.shippingDestination.contactDetails`
916
- *
917
- * To update a field's value, include the new value in the `orders.order` object in the method parameters.
918
- * To remove a field's value, pass `null`.
919
- *
920
- * > **Note:** Removing `buyerInfo` or `contactDetails` fields results in an error.
921
- *
922
- * To update an order's payment status, use [`updatePaymentStatus( )`](https://www.wix.com/velo/reference/wix-ecom-backend/ordertransactions/updatepaymentstatus).
923
- */
924
- function bulkUpdateOrders(payload) {
925
- function __bulkUpdateOrders({ host }) {
926
- const serializedData = (0, transform_paths_1.transformPaths)(payload, [
927
- {
928
- transformFn: field_mask_1.transformSDKFieldMaskToRESTFieldMask,
929
- paths: [{ path: 'orders.fieldMask' }],
930
- },
931
- {
932
- transformFn: timestamp_1.transformSDKTimestampToRESTTimestamp,
933
- paths: [
934
- { path: 'orders.order.createdDate' },
935
- { path: 'orders.order.updatedDate' },
936
- { path: 'orders.order.purchasedDate' },
937
- { path: 'orders.order.lineItems.image.urlExpirationDate' },
938
- { path: 'orders.order.lineItems.digitalFile.expirationDate' },
939
- {
940
- path: 'orders.order.lineItems.subscriptionInfo.subscriptionSettings.startDate',
941
- },
942
- { path: 'orders.order.shippingInfo.logistics.deliverByDate' },
943
- { path: 'orders.order.shippingInfo.logistics.deliveryTimeSlot.from' },
944
- { path: 'orders.order.shippingInfo.logistics.deliveryTimeSlot.to' },
945
- { path: 'orders.order.activities.createdDate' },
946
- ],
947
- },
948
- {
949
- transformFn: float_1.transformSDKFloatToRESTFloat,
950
- paths: [
951
- { path: 'orders.order.lineItems.image.focalPoint.x' },
952
- { path: 'orders.order.lineItems.image.focalPoint.y' },
953
- { path: 'orders.order.lineItems.physicalProperties.weight' },
954
- { path: 'orders.order.billingInfo.address.geocode.latitude' },
955
- { path: 'orders.order.billingInfo.address.geocode.longitude' },
956
- {
957
- path: 'orders.order.shippingInfo.logistics.shippingDestination.address.geocode.latitude',
958
- },
959
- {
960
- path: 'orders.order.shippingInfo.logistics.shippingDestination.address.geocode.longitude',
961
- },
962
- {
963
- path: 'orders.order.shippingInfo.logistics.pickupDetails.address.geocode.latitude',
964
- },
965
- {
966
- path: 'orders.order.shippingInfo.logistics.pickupDetails.address.geocode.longitude',
967
- },
968
- { path: 'orders.order.recipientInfo.address.geocode.latitude' },
969
- { path: 'orders.order.recipientInfo.address.geocode.longitude' },
970
- ],
971
- },
972
- ]);
973
- const metadata = {
974
- entityFqdn: 'wix.ecom.v1.order',
975
- method: 'POST',
976
- methodFqn: 'com.wix.ecom.orders.v1.Orders.BulkUpdateOrders',
977
- packageName: PACKAGE_NAME,
978
- url: resolveComWixEcomOrdersV1OrdersUrl({
979
- protoPath: '/v1/bulk/orders/update',
980
- data: serializedData,
981
- host,
982
- }),
983
- data: serializedData,
984
- transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
985
- {
986
- transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
987
- paths: [
988
- { path: 'results.item.createdDate' },
989
- { path: 'results.item.updatedDate' },
990
- { path: 'results.item.purchasedDate' },
991
- { path: 'results.item.lineItems.image.urlExpirationDate' },
992
- { path: 'results.item.lineItems.digitalFile.expirationDate' },
993
- {
994
- path: 'results.item.lineItems.subscriptionInfo.subscriptionSettings.startDate',
995
- },
996
- { path: 'results.item.shippingInfo.logistics.deliverByDate' },
997
- {
998
- path: 'results.item.shippingInfo.logistics.deliveryTimeSlot.from',
999
- },
1000
- {
1001
- path: 'results.item.shippingInfo.logistics.deliveryTimeSlot.to',
1002
- },
1003
- { path: 'results.item.activities.createdDate' },
1004
- ],
1005
- },
1006
- {
1007
- transformFn: float_2.transformRESTFloatToSDKFloat,
1008
- paths: [
1009
- { path: 'results.item.lineItems.image.focalPoint.x' },
1010
- { path: 'results.item.lineItems.image.focalPoint.y' },
1011
- { path: 'results.item.lineItems.physicalProperties.weight' },
1012
- { path: 'results.item.billingInfo.address.geocode.latitude' },
1013
- { path: 'results.item.billingInfo.address.geocode.longitude' },
1014
- {
1015
- path: 'results.item.shippingInfo.logistics.shippingDestination.address.geocode.latitude',
1016
- },
1017
- {
1018
- path: 'results.item.shippingInfo.logistics.shippingDestination.address.geocode.longitude',
1019
- },
1020
- {
1021
- path: 'results.item.shippingInfo.logistics.pickupDetails.address.geocode.latitude',
1022
- },
1023
- {
1024
- path: 'results.item.shippingInfo.logistics.pickupDetails.address.geocode.longitude',
1025
- },
1026
- { path: 'results.item.recipientInfo.address.geocode.latitude' },
1027
- { path: 'results.item.recipientInfo.address.geocode.longitude' },
1028
- ],
1029
- },
1030
- ]),
1031
- };
1032
- return metadata;
1033
- }
1034
- return __bulkUpdateOrders;
1035
- }
1036
- exports.bulkUpdateOrders = bulkUpdateOrders;
1037
- function commitDeltas(payload) {
1038
- function __commitDeltas({ host }) {
1039
- const serializedData = (0, transform_paths_1.transformPaths)(payload, [
1040
- {
1041
- transformFn: timestamp_1.transformSDKTimestampToRESTTimestamp,
1042
- paths: [
1043
- { path: 'changes.changedShippingInfo.logistics.deliverByDate' },
1044
- {
1045
- path: 'changes.changedShippingInfo.logistics.deliveryTimeSlot.from',
1046
- },
1047
- { path: 'changes.changedShippingInfo.logistics.deliveryTimeSlot.to' },
1048
- { path: 'changes.lineItems.lineItem.image.urlExpirationDate' },
1049
- { path: 'changes.lineItems.lineItem.digitalFile.expirationDate' },
1050
- {
1051
- path: 'changes.lineItems.lineItem.subscriptionInfo.subscriptionSettings.startDate',
1052
- },
1053
- ],
1054
- },
1055
- {
1056
- transformFn: float_1.transformSDKFloatToRESTFloat,
1057
- paths: [
1058
- {
1059
- path: 'changes.changedShippingInfo.logistics.shippingDestination.address.geocode.latitude',
1060
- },
1061
- {
1062
- path: 'changes.changedShippingInfo.logistics.shippingDestination.address.geocode.longitude',
1063
- },
1064
- {
1065
- path: 'changes.changedShippingInfo.logistics.pickupDetails.address.geocode.latitude',
1066
- },
1067
- {
1068
- path: 'changes.changedShippingInfo.logistics.pickupDetails.address.geocode.longitude',
1069
- },
1070
- { path: 'changes.changedBillingInfo.address.geocode.latitude' },
1071
- { path: 'changes.changedBillingInfo.address.geocode.longitude' },
1072
- { path: 'changes.changedRecipientInfo.address.geocode.latitude' },
1073
- { path: 'changes.changedRecipientInfo.address.geocode.longitude' },
1074
- { path: 'changes.lineItems.lineItem.physicalProperties.weight' },
1075
- { path: 'changes.lineItems.lineItem.image.focalPoint.x' },
1076
- { path: 'changes.lineItems.lineItem.image.focalPoint.y' },
1077
- ],
1078
- },
1079
- ]);
1080
- const metadata = {
1081
- entityFqdn: 'wix.ecom.v1.order',
1082
- method: 'POST',
1083
- methodFqn: 'com.wix.ecom.orders.v1.Orders.CommitDeltas',
1084
- packageName: PACKAGE_NAME,
1085
- url: resolveComWixEcomOrdersV1OrdersUrl({
1086
- protoPath: '/v1/orders/{id}/commit-deltas',
1087
- data: serializedData,
1088
- host,
1089
- }),
1090
- data: serializedData,
1091
- transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
1092
- {
1093
- transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
1094
- paths: [
1095
- { path: 'order.createdDate' },
1096
- { path: 'order.updatedDate' },
1097
- { path: 'order.purchasedDate' },
1098
- { path: 'order.lineItems.image.urlExpirationDate' },
1099
- { path: 'order.lineItems.digitalFile.expirationDate' },
1100
- {
1101
- path: 'order.lineItems.subscriptionInfo.subscriptionSettings.startDate',
1102
- },
1103
- { path: 'order.shippingInfo.logistics.deliverByDate' },
1104
- { path: 'order.shippingInfo.logistics.deliveryTimeSlot.from' },
1105
- { path: 'order.shippingInfo.logistics.deliveryTimeSlot.to' },
1106
- { path: 'order.activities.createdDate' },
1107
- ],
1108
- },
1109
- {
1110
- transformFn: float_2.transformRESTFloatToSDKFloat,
1111
- paths: [
1112
- { path: 'order.lineItems.image.focalPoint.x' },
1113
- { path: 'order.lineItems.image.focalPoint.y' },
1114
- { path: 'order.lineItems.physicalProperties.weight' },
1115
- { path: 'order.billingInfo.address.geocode.latitude' },
1116
- { path: 'order.billingInfo.address.geocode.longitude' },
1117
- {
1118
- path: 'order.shippingInfo.logistics.shippingDestination.address.geocode.latitude',
1119
- },
1120
- {
1121
- path: 'order.shippingInfo.logistics.shippingDestination.address.geocode.longitude',
1122
- },
1123
- {
1124
- path: 'order.shippingInfo.logistics.pickupDetails.address.geocode.latitude',
1125
- },
1126
- {
1127
- path: 'order.shippingInfo.logistics.pickupDetails.address.geocode.longitude',
1128
- },
1129
- { path: 'order.recipientInfo.address.geocode.latitude' },
1130
- { path: 'order.recipientInfo.address.geocode.longitude' },
1131
- ],
1132
- },
1133
- ]),
1134
- };
1135
- return metadata;
1136
- }
1137
- return __commitDeltas;
1138
- }
1139
- exports.commitDeltas = commitDeltas;
1140
- /** @deprecated Will be removed on 2024-02-15. */
1141
- function updateOrderLineItem(payload) {
1142
- function __updateOrderLineItem({ host }) {
1143
- const serializedData = (0, transform_paths_1.transformPaths)(payload, [
1144
- {
1145
- transformFn: field_mask_1.transformSDKFieldMaskToRESTFieldMask,
1146
- paths: [{ path: 'fieldMask' }],
1147
- },
1148
- {
1149
- transformFn: timestamp_1.transformSDKTimestampToRESTTimestamp,
1150
- paths: [
1151
- { path: 'lineItem.image.urlExpirationDate' },
1152
- { path: 'lineItem.digitalFile.expirationDate' },
1153
- { path: 'lineItem.subscriptionInfo.subscriptionSettings.startDate' },
1154
- ],
1155
- },
1156
- {
1157
- transformFn: float_1.transformSDKFloatToRESTFloat,
1158
- paths: [
1159
- { path: 'lineItem.image.focalPoint.x' },
1160
- { path: 'lineItem.image.focalPoint.y' },
1161
- { path: 'lineItem.physicalProperties.weight' },
1162
- ],
1163
- },
1164
- ]);
1165
- const metadata = {
1166
- entityFqdn: 'wix.ecom.v1.order',
1167
- method: 'PATCH',
1168
- methodFqn: 'com.wix.ecom.orders.v1.Orders.UpdateOrderLineItem',
1169
- packageName: PACKAGE_NAME,
1170
- url: resolveComWixEcomOrdersV1OrdersUrl({
1171
- protoPath: '/v1/orders/{id}/line-item/{lineItem.id}',
1172
- data: serializedData,
1173
- host,
1174
- }),
1175
- data: serializedData,
1176
- transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
1177
- {
1178
- transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
1179
- paths: [
1180
- { path: 'order.createdDate' },
1181
- { path: 'order.updatedDate' },
1182
- { path: 'order.purchasedDate' },
1183
- { path: 'order.lineItems.image.urlExpirationDate' },
1184
- { path: 'order.lineItems.digitalFile.expirationDate' },
1185
- {
1186
- path: 'order.lineItems.subscriptionInfo.subscriptionSettings.startDate',
1187
- },
1188
- { path: 'order.shippingInfo.logistics.deliverByDate' },
1189
- { path: 'order.shippingInfo.logistics.deliveryTimeSlot.from' },
1190
- { path: 'order.shippingInfo.logistics.deliveryTimeSlot.to' },
1191
- { path: 'order.activities.createdDate' },
1192
- ],
1193
- },
1194
- {
1195
- transformFn: float_2.transformRESTFloatToSDKFloat,
1196
- paths: [
1197
- { path: 'order.lineItems.image.focalPoint.x' },
1198
- { path: 'order.lineItems.image.focalPoint.y' },
1199
- { path: 'order.lineItems.physicalProperties.weight' },
1200
- { path: 'order.billingInfo.address.geocode.latitude' },
1201
- { path: 'order.billingInfo.address.geocode.longitude' },
1202
- {
1203
- path: 'order.shippingInfo.logistics.shippingDestination.address.geocode.latitude',
1204
- },
1205
- {
1206
- path: 'order.shippingInfo.logistics.shippingDestination.address.geocode.longitude',
1207
- },
1208
- {
1209
- path: 'order.shippingInfo.logistics.pickupDetails.address.geocode.latitude',
1210
- },
1211
- {
1212
- path: 'order.shippingInfo.logistics.pickupDetails.address.geocode.longitude',
1213
- },
1214
- { path: 'order.recipientInfo.address.geocode.latitude' },
1215
- { path: 'order.recipientInfo.address.geocode.longitude' },
1216
- ],
1217
- },
1218
- ]),
1219
- };
1220
- return metadata;
1221
- }
1222
- return __updateOrderLineItem;
1223
- }
1224
- exports.updateOrderLineItem = updateOrderLineItem;
1225
- /**
1226
- * Adds a merchant comment to an order.
1227
- * > **Note:** Activities with type CustomActivity not supported
1228
- * @deprecated It has been replaced with com.wix.ecom.orders.v1.OrdersService.AddActivities(), and will be removed on 2024-11-01.
1229
- */
1230
- function addActivity(payload) {
1231
- function __addActivity({ host }) {
1232
- const metadata = {
1233
- entityFqdn: 'wix.ecom.v1.order',
1234
- method: 'POST',
1235
- methodFqn: 'com.wix.ecom.orders.v1.Orders.AddActivity',
1236
- packageName: PACKAGE_NAME,
1237
- url: resolveComWixEcomOrdersV1OrdersUrl({
1238
- protoPath: '/v1/orders/{id}/activities',
1239
- data: payload,
1240
- host,
1241
- }),
1242
- data: payload,
1243
- transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
1244
- {
1245
- transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
1246
- paths: [
1247
- { path: 'order.createdDate' },
1248
- { path: 'order.updatedDate' },
1249
- { path: 'order.purchasedDate' },
1250
- { path: 'order.lineItems.image.urlExpirationDate' },
1251
- { path: 'order.lineItems.digitalFile.expirationDate' },
1252
- {
1253
- path: 'order.lineItems.subscriptionInfo.subscriptionSettings.startDate',
1254
- },
1255
- { path: 'order.shippingInfo.logistics.deliverByDate' },
1256
- { path: 'order.shippingInfo.logistics.deliveryTimeSlot.from' },
1257
- { path: 'order.shippingInfo.logistics.deliveryTimeSlot.to' },
1258
- { path: 'order.activities.createdDate' },
1259
- ],
1260
- },
1261
- {
1262
- transformFn: float_2.transformRESTFloatToSDKFloat,
1263
- paths: [
1264
- { path: 'order.lineItems.image.focalPoint.x' },
1265
- { path: 'order.lineItems.image.focalPoint.y' },
1266
- { path: 'order.lineItems.physicalProperties.weight' },
1267
- { path: 'order.billingInfo.address.geocode.latitude' },
1268
- { path: 'order.billingInfo.address.geocode.longitude' },
1269
- {
1270
- path: 'order.shippingInfo.logistics.shippingDestination.address.geocode.latitude',
1271
- },
1272
- {
1273
- path: 'order.shippingInfo.logistics.shippingDestination.address.geocode.longitude',
1274
- },
1275
- {
1276
- path: 'order.shippingInfo.logistics.pickupDetails.address.geocode.latitude',
1277
- },
1278
- {
1279
- path: 'order.shippingInfo.logistics.pickupDetails.address.geocode.longitude',
1280
- },
1281
- { path: 'order.recipientInfo.address.geocode.latitude' },
1282
- { path: 'order.recipientInfo.address.geocode.longitude' },
1283
- ],
1284
- },
1285
- ]),
1286
- };
1287
- return metadata;
1288
- }
1289
- return __addActivity;
1290
- }
1291
- exports.addActivity = addActivity;
1292
- /** Updates an order's activity. */
1293
- function updateActivity(payload) {
1294
- function __updateActivity({ host }) {
1295
- const metadata = {
1296
- entityFqdn: 'wix.ecom.v1.order',
1297
- method: 'PATCH',
1298
- methodFqn: 'com.wix.ecom.orders.v1.Orders.UpdateActivity',
1299
- packageName: PACKAGE_NAME,
1300
- url: resolveComWixEcomOrdersV1OrdersUrl({
1301
- protoPath: '/v1/orders/{id}/activities/{activityId}',
1302
- data: payload,
1303
- host,
1304
- }),
1305
- data: payload,
1306
- transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
1307
- {
1308
- transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
1309
- paths: [
1310
- { path: 'order.createdDate' },
1311
- { path: 'order.updatedDate' },
1312
- { path: 'order.purchasedDate' },
1313
- { path: 'order.lineItems.image.urlExpirationDate' },
1314
- { path: 'order.lineItems.digitalFile.expirationDate' },
1315
- {
1316
- path: 'order.lineItems.subscriptionInfo.subscriptionSettings.startDate',
1317
- },
1318
- { path: 'order.shippingInfo.logistics.deliverByDate' },
1319
- { path: 'order.shippingInfo.logistics.deliveryTimeSlot.from' },
1320
- { path: 'order.shippingInfo.logistics.deliveryTimeSlot.to' },
1321
- { path: 'order.activities.createdDate' },
1322
- ],
1323
- },
1324
- {
1325
- transformFn: float_2.transformRESTFloatToSDKFloat,
1326
- paths: [
1327
- { path: 'order.lineItems.image.focalPoint.x' },
1328
- { path: 'order.lineItems.image.focalPoint.y' },
1329
- { path: 'order.lineItems.physicalProperties.weight' },
1330
- { path: 'order.billingInfo.address.geocode.latitude' },
1331
- { path: 'order.billingInfo.address.geocode.longitude' },
1332
- {
1333
- path: 'order.shippingInfo.logistics.shippingDestination.address.geocode.latitude',
1334
- },
1335
- {
1336
- path: 'order.shippingInfo.logistics.shippingDestination.address.geocode.longitude',
1337
- },
1338
- {
1339
- path: 'order.shippingInfo.logistics.pickupDetails.address.geocode.latitude',
1340
- },
1341
- {
1342
- path: 'order.shippingInfo.logistics.pickupDetails.address.geocode.longitude',
1343
- },
1344
- { path: 'order.recipientInfo.address.geocode.latitude' },
1345
- { path: 'order.recipientInfo.address.geocode.longitude' },
1346
- ],
1347
- },
1348
- ]),
1349
- };
1350
- return metadata;
1351
- }
1352
- return __updateActivity;
1353
- }
1354
- exports.updateActivity = updateActivity;
1355
- /**
1356
- * Delete's an order's activity.
1357
- *
1358
- * Only custom activities and merchant comments can be deleted.
1359
- */
1360
- function deleteActivity(payload) {
1361
- function __deleteActivity({ host }) {
1362
- const metadata = {
1363
- entityFqdn: 'wix.ecom.v1.order',
1364
- method: 'DELETE',
1365
- methodFqn: 'com.wix.ecom.orders.v1.Orders.DeleteActivity',
1366
- packageName: PACKAGE_NAME,
1367
- url: resolveComWixEcomOrdersV1OrdersUrl({
1368
- protoPath: '/v1/orders/{id}/activities/{activityId}',
1369
- data: payload,
1370
- host,
1371
- }),
1372
- params: (0, rest_modules_1.toURLSearchParams)(payload),
1373
- transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
1374
- {
1375
- transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
1376
- paths: [
1377
- { path: 'order.createdDate' },
1378
- { path: 'order.updatedDate' },
1379
- { path: 'order.purchasedDate' },
1380
- { path: 'order.lineItems.image.urlExpirationDate' },
1381
- { path: 'order.lineItems.digitalFile.expirationDate' },
1382
- {
1383
- path: 'order.lineItems.subscriptionInfo.subscriptionSettings.startDate',
1384
- },
1385
- { path: 'order.shippingInfo.logistics.deliverByDate' },
1386
- { path: 'order.shippingInfo.logistics.deliveryTimeSlot.from' },
1387
- { path: 'order.shippingInfo.logistics.deliveryTimeSlot.to' },
1388
- { path: 'order.activities.createdDate' },
1389
- ],
1390
- },
1391
- {
1392
- transformFn: float_2.transformRESTFloatToSDKFloat,
1393
- paths: [
1394
- { path: 'order.lineItems.image.focalPoint.x' },
1395
- { path: 'order.lineItems.image.focalPoint.y' },
1396
- { path: 'order.lineItems.physicalProperties.weight' },
1397
- { path: 'order.billingInfo.address.geocode.latitude' },
1398
- { path: 'order.billingInfo.address.geocode.longitude' },
1399
- {
1400
- path: 'order.shippingInfo.logistics.shippingDestination.address.geocode.latitude',
1401
- },
1402
- {
1403
- path: 'order.shippingInfo.logistics.shippingDestination.address.geocode.longitude',
1404
- },
1405
- {
1406
- path: 'order.shippingInfo.logistics.pickupDetails.address.geocode.latitude',
1407
- },
1408
- {
1409
- path: 'order.shippingInfo.logistics.pickupDetails.address.geocode.longitude',
1410
- },
1411
- { path: 'order.recipientInfo.address.geocode.latitude' },
1412
- { path: 'order.recipientInfo.address.geocode.longitude' },
1413
- ],
1414
- },
1415
- ]),
1416
- };
1417
- return metadata;
1418
- }
1419
- return __deleteActivity;
1420
- }
1421
- exports.deleteActivity = deleteActivity;
1422
- /**
1423
- * Cancels an order.
1424
- *
1425
- *
1426
- * The `cancelOrder()` function returns a Promise that resolves when the specified order is canceled and the `order.status` field changes to `CANCELED`.
1427
- */
1428
- function cancelOrder(payload) {
1429
- function __cancelOrder({ host }) {
1430
- const metadata = {
1431
- entityFqdn: 'wix.ecom.v1.order',
1432
- method: 'POST',
1433
- methodFqn: 'com.wix.ecom.orders.v1.Orders.CancelOrder',
1434
- packageName: PACKAGE_NAME,
1435
- url: resolveComWixEcomOrdersV1OrdersUrl({
1436
- protoPath: '/v1/orders/{id}/cancel',
1437
- data: payload,
1438
- host,
1439
- }),
1440
- data: payload,
1441
- transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
1442
- {
1443
- transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
1444
- paths: [
1445
- { path: 'order.createdDate' },
1446
- { path: 'order.updatedDate' },
1447
- { path: 'order.purchasedDate' },
1448
- { path: 'order.lineItems.image.urlExpirationDate' },
1449
- { path: 'order.lineItems.digitalFile.expirationDate' },
1450
- {
1451
- path: 'order.lineItems.subscriptionInfo.subscriptionSettings.startDate',
1452
- },
1453
- { path: 'order.shippingInfo.logistics.deliverByDate' },
1454
- { path: 'order.shippingInfo.logistics.deliveryTimeSlot.from' },
1455
- { path: 'order.shippingInfo.logistics.deliveryTimeSlot.to' },
1456
- { path: 'order.activities.createdDate' },
1457
- ],
1458
- },
1459
- {
1460
- transformFn: float_2.transformRESTFloatToSDKFloat,
1461
- paths: [
1462
- { path: 'order.lineItems.image.focalPoint.x' },
1463
- { path: 'order.lineItems.image.focalPoint.y' },
1464
- { path: 'order.lineItems.physicalProperties.weight' },
1465
- { path: 'order.billingInfo.address.geocode.latitude' },
1466
- { path: 'order.billingInfo.address.geocode.longitude' },
1467
- {
1468
- path: 'order.shippingInfo.logistics.shippingDestination.address.geocode.latitude',
1469
- },
1470
- {
1471
- path: 'order.shippingInfo.logistics.shippingDestination.address.geocode.longitude',
1472
- },
1473
- {
1474
- path: 'order.shippingInfo.logistics.pickupDetails.address.geocode.latitude',
1475
- },
1476
- {
1477
- path: 'order.shippingInfo.logistics.pickupDetails.address.geocode.longitude',
1478
- },
1479
- { path: 'order.recipientInfo.address.geocode.latitude' },
1480
- { path: 'order.recipientInfo.address.geocode.longitude' },
1481
- ],
1482
- },
1483
- ]),
1484
- };
1485
- return metadata;
1486
- }
1487
- return __cancelOrder;
1488
- }
1489
- exports.cancelOrder = cancelOrder;
1490
- /**
1491
- * Updates order status.
1492
- *
1493
- * >CANCELED and REJECTED are final statuses. Update from either of those will fail.
1494
- * >Updates into INITIALIZED are not supported.
1495
- *
1496
- * Approving order:
1497
- * APPROVED status can be set while order has one of [INITIALIZED, PENDING] statuses.
1498
- *
1499
- * Approving an order which was created with CreateOrderRequest.settings.order_approval_strategy = PAYMENT_METHOD_SAVED
1500
- * will cause an error.
1501
- *
1502
- * Setting PENDING status:
1503
- * Only orders in INITIALIZED status can be updated into PENDING.
1504
- */
1505
- function updateOrderStatus(payload) {
1506
- function __updateOrderStatus({ host }) {
1507
- const metadata = {
1508
- entityFqdn: 'wix.ecom.v1.order',
1509
- method: 'POST',
1510
- methodFqn: 'com.wix.ecom.orders.v1.Orders.UpdateOrderStatus',
1511
- packageName: PACKAGE_NAME,
1512
- url: resolveComWixEcomOrdersV1OrdersUrl({
1513
- protoPath: '/v1/orders/{orderId}/update-status',
1514
- data: payload,
1515
- host,
1516
- }),
1517
- data: payload,
1518
- transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
1519
- {
1520
- transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
1521
- paths: [
1522
- { path: 'order.createdDate' },
1523
- { path: 'order.updatedDate' },
1524
- { path: 'order.purchasedDate' },
1525
- { path: 'order.lineItems.image.urlExpirationDate' },
1526
- { path: 'order.lineItems.digitalFile.expirationDate' },
1527
- {
1528
- path: 'order.lineItems.subscriptionInfo.subscriptionSettings.startDate',
1529
- },
1530
- { path: 'order.shippingInfo.logistics.deliverByDate' },
1531
- { path: 'order.shippingInfo.logistics.deliveryTimeSlot.from' },
1532
- { path: 'order.shippingInfo.logistics.deliveryTimeSlot.to' },
1533
- { path: 'order.activities.createdDate' },
1534
- ],
1535
- },
1536
- {
1537
- transformFn: float_2.transformRESTFloatToSDKFloat,
1538
- paths: [
1539
- { path: 'order.lineItems.image.focalPoint.x' },
1540
- { path: 'order.lineItems.image.focalPoint.y' },
1541
- { path: 'order.lineItems.physicalProperties.weight' },
1542
- { path: 'order.billingInfo.address.geocode.latitude' },
1543
- { path: 'order.billingInfo.address.geocode.longitude' },
1544
- {
1545
- path: 'order.shippingInfo.logistics.shippingDestination.address.geocode.latitude',
1546
- },
1547
- {
1548
- path: 'order.shippingInfo.logistics.shippingDestination.address.geocode.longitude',
1549
- },
1550
- {
1551
- path: 'order.shippingInfo.logistics.pickupDetails.address.geocode.latitude',
1552
- },
1553
- {
1554
- path: 'order.shippingInfo.logistics.pickupDetails.address.geocode.longitude',
1555
- },
1556
- { path: 'order.recipientInfo.address.geocode.latitude' },
1557
- { path: 'order.recipientInfo.address.geocode.longitude' },
1558
- ],
1559
- },
1560
- ]),
1561
- };
1562
- return metadata;
1563
- }
1564
- return __updateOrderStatus;
1565
- }
1566
- exports.updateOrderStatus = updateOrderStatus;
1567
- function aggregateOrders(payload) {
1568
- function __aggregateOrders({ host }) {
1569
- const metadata = {
1570
- entityFqdn: 'wix.ecom.v1.order',
1571
- method: 'POST',
1572
- methodFqn: 'com.wix.ecom.orders.v1.Orders.AggregateOrders',
1573
- packageName: PACKAGE_NAME,
1574
- url: resolveComWixEcomOrdersV1OrdersUrl({
1575
- protoPath: '/v1/orders/aggregate',
1576
- data: payload,
1577
- host,
1578
- }),
1579
- data: payload,
1580
- };
1581
- return metadata;
1582
- }
1583
- return __aggregateOrders;
1584
- }
1585
- exports.aggregateOrders = aggregateOrders;
1586
- /**
1587
- * Synchronously update tags on multiple orders, by list of order IDs.
1588
- *
1589
- * > **Note:** If the same tag is passed to both the `assignTags` and `unassignTags` fields, it will be assigned.
1590
- */
1591
- function bulkUpdateOrderTags(payload) {
1592
- function __bulkUpdateOrderTags({ host }) {
1593
- const metadata = {
1594
- entityFqdn: 'wix.ecom.v1.order',
1595
- method: 'POST',
1596
- methodFqn: 'com.wix.ecom.orders.v1.Orders.BulkUpdateOrderTags',
1597
- packageName: PACKAGE_NAME,
1598
- url: resolveComWixEcomOrdersV1OrdersUrl({
1599
- protoPath: '/v1/bulk/orders/update-tags',
1600
- data: payload,
1601
- host,
1602
- }),
1603
- data: payload,
1604
- };
1605
- return metadata;
1606
- }
1607
- return __bulkUpdateOrderTags;
1608
- }
1609
- exports.bulkUpdateOrderTags = bulkUpdateOrderTags;
1610
- //# sourceMappingURL=ecom-v1-order-orders.http.js.map