@wix/auto_sdk_ecom_orders 1.0.52 → 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} +642 -1081
  2. package/build/{es/src/ecom-v1-order-orders.universal.d.ts → ecom-v1-order-orders.universal-CO-UuLIK.d.ts} +642 -1081
  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} +642 -1448
  10. package/build/internal/{es/src/ecom-v1-order-orders.universal.d.ts → ecom-v1-order-orders.universal-DrkwwhMV.d.ts} +642 -1448
  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,2285 +0,0 @@
1
- import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';
2
- import { renameKeysFromSDKRequestToRESTRequest, renameKeysFromRESTResponseToSDKResponse, } from '@wix/sdk-runtime/rename-all-nested-keys';
3
- import * as ambassadorWixEcomV1Order from './ecom-v1-order-orders.http.js';
4
- // @ts-ignore
5
- import { transformSDKAddressToRESTAddress } from '@wix/sdk-runtime/transformations/address';
6
- import { transformRESTAddressToSDKAddress } from '@wix/sdk-runtime/transformations/address';
7
- import { transformSDKImageToRESTImage } from '@wix/sdk-runtime/transformations/image';
8
- import { transformRESTImageToSDKImage } from '@wix/sdk-runtime/transformations/image';
9
- import { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';
10
- export var DescriptionLineType;
11
- (function (DescriptionLineType) {
12
- /** Unrecognized type. */
13
- DescriptionLineType["UNRECOGNISED"] = "UNRECOGNISED";
14
- /** Plain text type. */
15
- DescriptionLineType["PLAIN_TEXT"] = "PLAIN_TEXT";
16
- /** Color type. */
17
- DescriptionLineType["COLOR"] = "COLOR";
18
- })(DescriptionLineType || (DescriptionLineType = {}));
19
- export var ItemTypeItemType;
20
- (function (ItemTypeItemType) {
21
- ItemTypeItemType["UNRECOGNISED"] = "UNRECOGNISED";
22
- ItemTypeItemType["PHYSICAL"] = "PHYSICAL";
23
- ItemTypeItemType["DIGITAL"] = "DIGITAL";
24
- ItemTypeItemType["GIFT_CARD"] = "GIFT_CARD";
25
- ItemTypeItemType["SERVICE"] = "SERVICE";
26
- })(ItemTypeItemType || (ItemTypeItemType = {}));
27
- /** Type of selected payment option for catalog item */
28
- export var PaymentOptionType;
29
- (function (PaymentOptionType) {
30
- /** The entire payment for this item happens as part of the checkout. */
31
- PaymentOptionType["FULL_PAYMENT_ONLINE"] = "FULL_PAYMENT_ONLINE";
32
- /** The entire payment for this item happens after checkout. For example, when using cash, check, or other offline payment methods. */
33
- PaymentOptionType["FULL_PAYMENT_OFFLINE"] = "FULL_PAYMENT_OFFLINE";
34
- /** Payment for this item is done by charging a membership. When selected, `price` is `0`. */
35
- PaymentOptionType["MEMBERSHIP"] = "MEMBERSHIP";
36
- /** Partial payment to be paid upfront during checkout. The initial amount to be paid for each line item is specified in `depositAmount`. */
37
- PaymentOptionType["DEPOSIT_ONLINE"] = "DEPOSIT_ONLINE";
38
- /** Payment for this item can only be done by charging a membership and must be manually redeemed in the dashboard by the site admin. When selected, `price` is `0`. */
39
- PaymentOptionType["MEMBERSHIP_OFFLINE"] = "MEMBERSHIP_OFFLINE";
40
- })(PaymentOptionType || (PaymentOptionType = {}));
41
- /** JurisdictionType represents the type of the jurisdiction in which this tax detail applies (e.g. Country,State,County,City,Special). */
42
- export var JurisdictionType;
43
- (function (JurisdictionType) {
44
- JurisdictionType["UNDEFINED"] = "UNDEFINED";
45
- JurisdictionType["COUNTRY"] = "COUNTRY";
46
- JurisdictionType["STATE"] = "STATE";
47
- JurisdictionType["COUNTY"] = "COUNTY";
48
- JurisdictionType["CITY"] = "CITY";
49
- JurisdictionType["SPECIAL"] = "SPECIAL";
50
- })(JurisdictionType || (JurisdictionType = {}));
51
- /** Frequency unit of recurring payment */
52
- export var SubscriptionFrequency;
53
- (function (SubscriptionFrequency) {
54
- SubscriptionFrequency["UNDEFINED"] = "UNDEFINED";
55
- SubscriptionFrequency["DAY"] = "DAY";
56
- SubscriptionFrequency["WEEK"] = "WEEK";
57
- SubscriptionFrequency["MONTH"] = "MONTH";
58
- SubscriptionFrequency["YEAR"] = "YEAR";
59
- })(SubscriptionFrequency || (SubscriptionFrequency = {}));
60
- export var AdjustmentType;
61
- (function (AdjustmentType) {
62
- AdjustmentType["UNKNOWN_ADJUSTMENT_TYPE"] = "UNKNOWN_ADJUSTMENT_TYPE";
63
- /** Adjustment increases the total amount due to changes like covering extra billing days. Typically results in an additional fee. */
64
- AdjustmentType["EXTRA_CHARGE"] = "EXTRA_CHARGE";
65
- /** Adjustment reduces the total amount due to changes like covering fewer billing days. Typically results in a credit or discount. */
66
- AdjustmentType["CREDIT"] = "CREDIT";
67
- })(AdjustmentType || (AdjustmentType = {}));
68
- export var TaxableAddressType;
69
- (function (TaxableAddressType) {
70
- TaxableAddressType["UNKNOWN_TAXABLE_ADDRESS"] = "UNKNOWN_TAXABLE_ADDRESS";
71
- TaxableAddressType["BUSINESS"] = "BUSINESS";
72
- TaxableAddressType["BILLING"] = "BILLING";
73
- TaxableAddressType["SHIPPING"] = "SHIPPING";
74
- })(TaxableAddressType || (TaxableAddressType = {}));
75
- export var PaymentStatus;
76
- (function (PaymentStatus) {
77
- PaymentStatus["UNSPECIFIED"] = "UNSPECIFIED";
78
- /**
79
- * `NOT_PAID` can apply to an order made online, but not yet paid. In such cases `order.status` will be `INITIALIZED`.
80
- * This status also applies when an offline order needs to be manually marked as paid. In such cases `order.status` will be `APPROVED`.
81
- */
82
- PaymentStatus["NOT_PAID"] = "NOT_PAID";
83
- /** All required payments associated with this order are paid. */
84
- PaymentStatus["PAID"] = "PAID";
85
- /** Order partially refunded, but the refunded amount is less than the order's total price. See `order.balanceSummary` for more details. */
86
- PaymentStatus["PARTIALLY_REFUNDED"] = "PARTIALLY_REFUNDED";
87
- /** Order fully refunded. Refund amount equals total price. See `order.balanceSummary` for more details. */
88
- PaymentStatus["FULLY_REFUNDED"] = "FULLY_REFUNDED";
89
- /**
90
- * All payments pending.
91
- *
92
- * This can happen with two-step payments, when a payment requires manual review, or when a payment is in progress and will be concluded shortly.
93
- * Learn more about [pending orders](https://support.wix.com/en/article/pending-orders).
94
- */
95
- PaymentStatus["PENDING"] = "PENDING";
96
- /** At least one payment received and approved, but it covers less than the order's total price. See `order.balanceSummary` for more details. */
97
- PaymentStatus["PARTIALLY_PAID"] = "PARTIALLY_PAID";
98
- /**
99
- * Payment received, but not yet confirmed by the payment provider.
100
- *
101
- * In most cases, when a payment provider is holding payment it's because setup hasn't been successfully completed by the merchant/site owner.
102
- * To solve this, the merchant/site owner should log in to the payment provider's dashboard and make sure their account is set up correctly, or contact their support for further assistance.
103
- * @documentationMaturity preview
104
- */
105
- PaymentStatus["PENDING_MERCHANT"] = "PENDING_MERCHANT";
106
- /**
107
- * One or more payments canceled.
108
- * @documentationMaturity preview
109
- */
110
- PaymentStatus["CANCELED"] = "CANCELED";
111
- /**
112
- * One or more payments declined.
113
- * @documentationMaturity preview
114
- */
115
- PaymentStatus["DECLINED"] = "DECLINED";
116
- })(PaymentStatus || (PaymentStatus = {}));
117
- export var FulfillmentStatus;
118
- (function (FulfillmentStatus) {
119
- /** None of the order items are fulfilled or the order was manually marked as unfulfilled. */
120
- FulfillmentStatus["NOT_FULFILLED"] = "NOT_FULFILLED";
121
- /**
122
- * All of the order items are fulfilled or the order was manually marked as fulfilled.
123
- * Orders without shipping info are fulfilled automatically.
124
- */
125
- FulfillmentStatus["FULFILLED"] = "FULFILLED";
126
- /** Some, but not all, of the order items are fulfilled. */
127
- FulfillmentStatus["PARTIALLY_FULFILLED"] = "PARTIALLY_FULFILLED";
128
- })(FulfillmentStatus || (FulfillmentStatus = {}));
129
- export var WeightUnit;
130
- (function (WeightUnit) {
131
- /** Weight unit can't be classified due to an error. */
132
- WeightUnit["UNSPECIFIED_WEIGHT_UNIT"] = "UNSPECIFIED_WEIGHT_UNIT";
133
- /** Kilograms. */
134
- WeightUnit["KG"] = "KG";
135
- /** Pounds. */
136
- WeightUnit["LB"] = "LB";
137
- })(WeightUnit || (WeightUnit = {}));
138
- /** tax info types */
139
- export var VatType;
140
- (function (VatType) {
141
- VatType["UNSPECIFIED"] = "UNSPECIFIED";
142
- /** CPF - for individual tax payers. */
143
- VatType["CPF"] = "CPF";
144
- /** CNPJ - for corporations */
145
- VatType["CNPJ"] = "CNPJ";
146
- })(VatType || (VatType = {}));
147
- export var PickupMethod;
148
- (function (PickupMethod) {
149
- PickupMethod["UNKNOWN_METHOD"] = "UNKNOWN_METHOD";
150
- PickupMethod["STORE_PICKUP"] = "STORE_PICKUP";
151
- PickupMethod["PICKUP_POINT"] = "PICKUP_POINT";
152
- })(PickupMethod || (PickupMethod = {}));
153
- export var OrderStatus;
154
- (function (OrderStatus) {
155
- /** Order created, but not yet approved or canceled. */
156
- OrderStatus["INITIALIZED"] = "INITIALIZED";
157
- /**
158
- * Order approved.
159
- *
160
- * This happens when either an online payment is received **or** when `order.priceSummary.total = 0` (a zero-total order).
161
- * Offline orders (cash payment) are automatically approved.
162
- */
163
- OrderStatus["APPROVED"] = "APPROVED";
164
- /** Order canceled by the user. */
165
- OrderStatus["CANCELED"] = "CANCELED";
166
- /**
167
- * Order pending.
168
- * @documentationMaturity preview
169
- */
170
- OrderStatus["PENDING"] = "PENDING";
171
- /**
172
- * Order rejected.
173
- *
174
- * This happens when pending payments fail.
175
- * @documentationMaturity preview
176
- */
177
- OrderStatus["REJECTED"] = "REJECTED";
178
- })(OrderStatus || (OrderStatus = {}));
179
- export var DiscountType;
180
- (function (DiscountType) {
181
- DiscountType["GLOBAL"] = "GLOBAL";
182
- DiscountType["SPECIFIC_ITEMS"] = "SPECIFIC_ITEMS";
183
- DiscountType["SHIPPING"] = "SHIPPING";
184
- })(DiscountType || (DiscountType = {}));
185
- export var DiscountReason;
186
- (function (DiscountReason) {
187
- DiscountReason["UNSPECIFIED"] = "UNSPECIFIED";
188
- DiscountReason["EXCHANGED_ITEMS"] = "EXCHANGED_ITEMS";
189
- DiscountReason["BILLING_ADJUSTMENT"] = "BILLING_ADJUSTMENT";
190
- })(DiscountReason || (DiscountReason = {}));
191
- export var LineItemQuantityChangeType;
192
- (function (LineItemQuantityChangeType) {
193
- /** Quantity increased. */
194
- LineItemQuantityChangeType["QUANTITY_INCREASED"] = "QUANTITY_INCREASED";
195
- /** Quantity decreased. */
196
- LineItemQuantityChangeType["QUANTITY_DECREASED"] = "QUANTITY_DECREASED";
197
- })(LineItemQuantityChangeType || (LineItemQuantityChangeType = {}));
198
- export var ActivityType;
199
- (function (ActivityType) {
200
- ActivityType["ORDER_REFUNDED"] = "ORDER_REFUNDED";
201
- ActivityType["ORDER_PLACED"] = "ORDER_PLACED";
202
- ActivityType["ORDER_PAID"] = "ORDER_PAID";
203
- ActivityType["ORDER_FULFILLED"] = "ORDER_FULFILLED";
204
- ActivityType["ORDER_NOT_FULFILLED"] = "ORDER_NOT_FULFILLED";
205
- ActivityType["ORDER_CANCELED"] = "ORDER_CANCELED";
206
- ActivityType["DOWNLOAD_LINK_SENT"] = "DOWNLOAD_LINK_SENT";
207
- ActivityType["TRACKING_NUMBER_ADDED"] = "TRACKING_NUMBER_ADDED";
208
- ActivityType["TRACKING_NUMBER_EDITED"] = "TRACKING_NUMBER_EDITED";
209
- ActivityType["TRACKING_LINK_ADDED"] = "TRACKING_LINK_ADDED";
210
- ActivityType["SHIPPING_CONFIRMATION_EMAIL_SENT"] = "SHIPPING_CONFIRMATION_EMAIL_SENT";
211
- ActivityType["INVOICE_ADDED"] = "INVOICE_ADDED";
212
- ActivityType["INVOICE_REMOVED"] = "INVOICE_REMOVED";
213
- ActivityType["INVOICE_SENT"] = "INVOICE_SENT";
214
- ActivityType["FULFILLER_EMAIL_SENT"] = "FULFILLER_EMAIL_SENT";
215
- ActivityType["SHIPPING_ADDRESS_EDITED"] = "SHIPPING_ADDRESS_EDITED";
216
- ActivityType["EMAIL_EDITED"] = "EMAIL_EDITED";
217
- ActivityType["PICKUP_READY_EMAIL_SENT"] = "PICKUP_READY_EMAIL_SENT";
218
- ActivityType["CUSTOM_ACTIVITY"] = "CUSTOM_ACTIVITY";
219
- ActivityType["MERCHANT_COMMENT"] = "MERCHANT_COMMENT";
220
- ActivityType["ORDER_CREATED_FROM_EXCHANGE"] = "ORDER_CREATED_FROM_EXCHANGE";
221
- ActivityType["NEW_EXCHANGE_ORDER_CREATED"] = "NEW_EXCHANGE_ORDER_CREATED";
222
- ActivityType["ORDER_PARTIALLY_PAID"] = "ORDER_PARTIALLY_PAID";
223
- ActivityType["DRAFT_ORDER_CHANGES_APPLIED"] = "DRAFT_ORDER_CHANGES_APPLIED";
224
- ActivityType["SAVED_PAYMENT_METHOD"] = "SAVED_PAYMENT_METHOD";
225
- /** @documentationMaturity preview */
226
- ActivityType["PAYMENT_PENDING"] = "PAYMENT_PENDING";
227
- /** @documentationMaturity preview */
228
- ActivityType["PAYMENT_CANCELED"] = "PAYMENT_CANCELED";
229
- /** @documentationMaturity preview */
230
- ActivityType["PAYMENT_DECLINED"] = "PAYMENT_DECLINED";
231
- /** @documentationMaturity preview */
232
- ActivityType["ORDER_PENDING"] = "ORDER_PENDING";
233
- /** @documentationMaturity preview */
234
- ActivityType["ORDER_REJECTED"] = "ORDER_REJECTED";
235
- })(ActivityType || (ActivityType = {}));
236
- export var AttributionSource;
237
- (function (AttributionSource) {
238
- AttributionSource["UNSPECIFIED"] = "UNSPECIFIED";
239
- AttributionSource["FACEBOOK_ADS"] = "FACEBOOK_ADS";
240
- })(AttributionSource || (AttributionSource = {}));
241
- export var ChannelType;
242
- (function (ChannelType) {
243
- /** Unspecified sales channel. This value is not supported. */
244
- ChannelType["UNSPECIFIED"] = "UNSPECIFIED";
245
- /** A web client. */
246
- ChannelType["WEB"] = "WEB";
247
- /** [Point of sale solutions](https://support.wix.com/en/wix-mobile-pos-2196395). */
248
- ChannelType["POS"] = "POS";
249
- /** [eBay shop](https://support.wix.com/en/article/wix-stores-connecting-and-setting-up-an-ebay-shop). */
250
- ChannelType["EBAY"] = "EBAY";
251
- /** [Amazon shop](https://support.wix.com/en/article/wix-stores-connecting-and-setting-up-an-amazon-shop). */
252
- ChannelType["AMAZON"] = "AMAZON";
253
- /** Other sales platform. */
254
- ChannelType["OTHER_PLATFORM"] = "OTHER_PLATFORM";
255
- /** [Wix Owner app](https://support.wix.com/article/wix-owner-app-an-overview). */
256
- ChannelType["WIX_APP_STORE"] = "WIX_APP_STORE";
257
- /** Wix Invoices app in [your dashboard](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Finvoices/settings/general-settings) */
258
- ChannelType["WIX_INVOICES"] = "WIX_INVOICES";
259
- /** Wix merchant backoffice. */
260
- ChannelType["BACKOFFICE_MERCHANT"] = "BACKOFFICE_MERCHANT";
261
- /** Wish sales channel. */
262
- ChannelType["WISH"] = "WISH";
263
- /** [ClassPass sales channel](https://support.wix.com/en/article/wix-bookings-letting-clients-book-your-services-with-classpass). */
264
- ChannelType["CLASS_PASS"] = "CLASS_PASS";
265
- /** Global-E sales channel. */
266
- ChannelType["GLOBAL_E"] = "GLOBAL_E";
267
- /** [Facebook shop](https://support.wix.com/en/article/wix-stores-changes-to-facebook-shops). */
268
- ChannelType["FACEBOOK"] = "FACEBOOK";
269
- /** [Etsy sales channel](https://support.wix.com/en/article/wix-stores-request-adding-etsy-as-a-sales-channel). */
270
- ChannelType["ETSY"] = "ETSY";
271
- /** [TikTok sales channel](https://support.wix.com/en/article/wix-stores-request-adding-tiktok-as-a-sales-channel). */
272
- ChannelType["TIKTOK"] = "TIKTOK";
273
- /** [Faire marketplace integration](https://support.wix.com/en/article/wix-stores-creating-a-faire-store-using-the-faire-integration-app). */
274
- ChannelType["FAIRE_COM"] = "FAIRE_COM";
275
- })(ChannelType || (ChannelType = {}));
276
- export var ScheduledAction;
277
- (function (ScheduledAction) {
278
- ScheduledAction["UNSPECIFIED"] = "UNSPECIFIED";
279
- /** Whether payment will be auto-voided when duration passes */
280
- ScheduledAction["VOID"] = "VOID";
281
- /** Whether payment will be auto-captured when duration passes */
282
- ScheduledAction["CAPTURE"] = "CAPTURE";
283
- })(ScheduledAction || (ScheduledAction = {}));
284
- export var DurationUnit;
285
- (function (DurationUnit) {
286
- DurationUnit["UNKNOWN_DURATION_UNIT"] = "UNKNOWN_DURATION_UNIT";
287
- DurationUnit["MINUTES"] = "MINUTES";
288
- DurationUnit["HOURS"] = "HOURS";
289
- DurationUnit["DAYS"] = "DAYS";
290
- })(DurationUnit || (DurationUnit = {}));
291
- export var PaymentCollectabilityStatus;
292
- (function (PaymentCollectabilityStatus) {
293
- PaymentCollectabilityStatus["UNKNOWN"] = "UNKNOWN";
294
- PaymentCollectabilityStatus["COLLECTABLE"] = "COLLECTABLE";
295
- PaymentCollectabilityStatus["NONCOLLECTABLE_ORDER_IS_CANCELLED"] = "NONCOLLECTABLE_ORDER_IS_CANCELLED";
296
- PaymentCollectabilityStatus["NONCOLLECTABLE_ORDER_IS_PAID"] = "NONCOLLECTABLE_ORDER_IS_PAID";
297
- PaymentCollectabilityStatus["NONCOLLECTABLE_MISSING_PAYMENT_METHOD"] = "NONCOLLECTABLE_MISSING_PAYMENT_METHOD";
298
- PaymentCollectabilityStatus["NONCOLLECTABLE_ORDER_IS_PENDING"] = "NONCOLLECTABLE_ORDER_IS_PENDING";
299
- PaymentCollectabilityStatus["NONCOLLECTABLE_ORDER_IS_REJECTED"] = "NONCOLLECTABLE_ORDER_IS_REJECTED";
300
- PaymentCollectabilityStatus["NONCOLLECTABLE_ORDER_HAS_SUBSCRIPTIONS"] = "NONCOLLECTABLE_ORDER_HAS_SUBSCRIPTIONS";
301
- })(PaymentCollectabilityStatus || (PaymentCollectabilityStatus = {}));
302
- export var RefundableStatus;
303
- (function (RefundableStatus) {
304
- RefundableStatus["NOT_REFUNDABLE"] = "NOT_REFUNDABLE";
305
- RefundableStatus["MANUAL"] = "MANUAL";
306
- RefundableStatus["REFUNDABLE"] = "REFUNDABLE";
307
- })(RefundableStatus || (RefundableStatus = {}));
308
- export var NonRefundableReason;
309
- (function (NonRefundableReason) {
310
- NonRefundableReason["NONE"] = "NONE";
311
- NonRefundableReason["ALREADY_REFUNDED"] = "ALREADY_REFUNDED";
312
- NonRefundableReason["PROVIDER_IS_DOWN"] = "PROVIDER_IS_DOWN";
313
- NonRefundableReason["INTERNAL_ERROR"] = "INTERNAL_ERROR";
314
- NonRefundableReason["NOT_PAID"] = "NOT_PAID";
315
- NonRefundableReason["ACCESS_DENIED"] = "ACCESS_DENIED";
316
- NonRefundableReason["ZERO_PRICE"] = "ZERO_PRICE";
317
- NonRefundableReason["DISABLED_BY_PROVIDER"] = "DISABLED_BY_PROVIDER";
318
- NonRefundableReason["PENDING_REFUND"] = "PENDING_REFUND";
319
- NonRefundableReason["FORBIDDEN"] = "FORBIDDEN";
320
- NonRefundableReason["TRANSACTION_NOT_FOUND"] = "TRANSACTION_NOT_FOUND";
321
- NonRefundableReason["ORDER_IS_PENDING"] = "ORDER_IS_PENDING";
322
- NonRefundableReason["ORDER_IS_REJECTED"] = "ORDER_IS_REJECTED";
323
- })(NonRefundableReason || (NonRefundableReason = {}));
324
- export var ManuallyRefundableReason;
325
- (function (ManuallyRefundableReason) {
326
- ManuallyRefundableReason["EXPIRED"] = "EXPIRED";
327
- ManuallyRefundableReason["NOT_SUPPORTED"] = "NOT_SUPPORTED";
328
- ManuallyRefundableReason["OFFLINE"] = "OFFLINE";
329
- ManuallyRefundableReason["REQUIRES_CARD_READER"] = "REQUIRES_CARD_READER";
330
- })(ManuallyRefundableReason || (ManuallyRefundableReason = {}));
331
- export var RestockType;
332
- (function (RestockType) {
333
- RestockType["NO_ITEMS"] = "NO_ITEMS";
334
- RestockType["ALL_ITEMS"] = "ALL_ITEMS";
335
- RestockType["SOME_ITEMS"] = "SOME_ITEMS";
336
- })(RestockType || (RestockType = {}));
337
- export var TransactionStatus;
338
- (function (TransactionStatus) {
339
- TransactionStatus["UNDEFINED"] = "UNDEFINED";
340
- TransactionStatus["APPROVED"] = "APPROVED";
341
- TransactionStatus["PENDING"] = "PENDING";
342
- TransactionStatus["PENDING_MERCHANT"] = "PENDING_MERCHANT";
343
- TransactionStatus["CANCELED"] = "CANCELED";
344
- TransactionStatus["DECLINED"] = "DECLINED";
345
- TransactionStatus["REFUNDED"] = "REFUNDED";
346
- TransactionStatus["PARTIALLY_REFUNDED"] = "PARTIALLY_REFUNDED";
347
- TransactionStatus["AUTHORIZED"] = "AUTHORIZED";
348
- TransactionStatus["VOIDED"] = "VOIDED";
349
- })(TransactionStatus || (TransactionStatus = {}));
350
- export var AuthorizationCaptureStatus;
351
- (function (AuthorizationCaptureStatus) {
352
- AuthorizationCaptureStatus["UNKNOWN_STATUS"] = "UNKNOWN_STATUS";
353
- /** Capture operation still in progress. */
354
- AuthorizationCaptureStatus["PENDING"] = "PENDING";
355
- /** Capture operation succeeded. */
356
- AuthorizationCaptureStatus["SUCCEEDED"] = "SUCCEEDED";
357
- /** Capture operation failed. */
358
- AuthorizationCaptureStatus["FAILED"] = "FAILED";
359
- })(AuthorizationCaptureStatus || (AuthorizationCaptureStatus = {}));
360
- export var AuthorizationVoidStatus;
361
- (function (AuthorizationVoidStatus) {
362
- AuthorizationVoidStatus["UNKNOWN_STATUS"] = "UNKNOWN_STATUS";
363
- /** Void operation still in progress. */
364
- AuthorizationVoidStatus["PENDING"] = "PENDING";
365
- /** Void operation succeeded. */
366
- AuthorizationVoidStatus["SUCCEEDED"] = "SUCCEEDED";
367
- /** Void operation failed. */
368
- AuthorizationVoidStatus["FAILED"] = "FAILED";
369
- })(AuthorizationVoidStatus || (AuthorizationVoidStatus = {}));
370
- /** Reason the authorization was voided. */
371
- export var Reason;
372
- (function (Reason) {
373
- Reason["UNKNOWN_REASON"] = "UNKNOWN_REASON";
374
- /** Authorization was voided by user. */
375
- Reason["MANUAL"] = "MANUAL";
376
- /** Authorization passed execution date. */
377
- Reason["SCHEDULED"] = "SCHEDULED";
378
- })(Reason || (Reason = {}));
379
- export var ActionType;
380
- (function (ActionType) {
381
- ActionType["UNKNOWN_ACTION_TYPE"] = "UNKNOWN_ACTION_TYPE";
382
- ActionType["VOID"] = "VOID";
383
- ActionType["CAPTURE"] = "CAPTURE";
384
- })(ActionType || (ActionType = {}));
385
- export var MembershipPaymentStatus;
386
- (function (MembershipPaymentStatus) {
387
- /** Payment was charged. */
388
- MembershipPaymentStatus["CHARGED"] = "CHARGED";
389
- /** The attempt to charge the payment failed, for example, due to lack of credits. */
390
- MembershipPaymentStatus["CHARGE_FAILED"] = "CHARGE_FAILED";
391
- })(MembershipPaymentStatus || (MembershipPaymentStatus = {}));
392
- /** Refund transaction status. */
393
- export var RefundStatus;
394
- (function (RefundStatus) {
395
- /** Refund was initiated on payment provider side. PENDING status was assigned by provider. */
396
- RefundStatus["PENDING"] = "PENDING";
397
- /** Refund transaction succeeded. */
398
- RefundStatus["SUCCEEDED"] = "SUCCEEDED";
399
- /** Refund transaction failed. */
400
- RefundStatus["FAILED"] = "FAILED";
401
- /** Refund request acknowledged, and will be executed soon. */
402
- RefundStatus["SCHEDULED"] = "SCHEDULED";
403
- /** Refund was initiated on payment provider side. */
404
- RefundStatus["STARTED"] = "STARTED";
405
- })(RefundStatus || (RefundStatus = {}));
406
- export var WebhookIdentityType;
407
- (function (WebhookIdentityType) {
408
- WebhookIdentityType["UNKNOWN"] = "UNKNOWN";
409
- WebhookIdentityType["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
410
- WebhookIdentityType["MEMBER"] = "MEMBER";
411
- WebhookIdentityType["WIX_USER"] = "WIX_USER";
412
- WebhookIdentityType["APP"] = "APP";
413
- })(WebhookIdentityType || (WebhookIdentityType = {}));
414
- export var TextDetection;
415
- (function (TextDetection) {
416
- /** No detection was made */
417
- TextDetection["UNKNOWN_TEXT_DETECTION"] = "UNKNOWN_TEXT_DETECTION";
418
- /** The image contains text */
419
- TextDetection["CONTAINS_TEXT"] = "CONTAINS_TEXT";
420
- /** The image does not contain text */
421
- TextDetection["NO_TEXT"] = "NO_TEXT";
422
- })(TextDetection || (TextDetection = {}));
423
- export var AnimationDetection;
424
- (function (AnimationDetection) {
425
- /** No detection was made */
426
- AnimationDetection["UNKNOWN_ANIMATION_DETECTION"] = "UNKNOWN_ANIMATION_DETECTION";
427
- /** The image contains animation */
428
- AnimationDetection["CONTAINS_ANIMATION"] = "CONTAINS_ANIMATION";
429
- /** The image does not contain animation */
430
- AnimationDetection["NO_ANIMATION"] = "NO_ANIMATION";
431
- })(AnimationDetection || (AnimationDetection = {}));
432
- export var PreviewEmailType;
433
- (function (PreviewEmailType) {
434
- PreviewEmailType["ORDER_PLACED"] = "ORDER_PLACED";
435
- PreviewEmailType["DOWNLOAD_LINKS"] = "DOWNLOAD_LINKS";
436
- PreviewEmailType["ORDER_SHIPPED"] = "ORDER_SHIPPED";
437
- PreviewEmailType["ORDER_READY_FOR_PICKUP"] = "ORDER_READY_FOR_PICKUP";
438
- })(PreviewEmailType || (PreviewEmailType = {}));
439
- /**
440
- * Represents the actual state of the application on site. Do not confuse with the State in the old MetaSiteDTO,
441
- * which has less values and doesn't have 1-to-1 correspondence with this one (this one is exact and correct!)
442
- */
443
- export var State;
444
- (function (State) {
445
- State["UNKNOWN"] = "UNKNOWN";
446
- /** App is installed on a site. */
447
- State["ENABLED"] = "ENABLED";
448
- /** App is removed from a site (but we preserve it just in case). */
449
- State["DISABLED"] = "DISABLED";
450
- /** App is in "demo" mode, meaning that it's in read-only mode (it's in a template OR not installed yet). */
451
- State["TEMPLATE"] = "TEMPLATE";
452
- /** App is not installed, there is a user intention for it only (user will see the pimpl in the editor). */
453
- State["PENDING"] = "PENDING";
454
- })(State || (State = {}));
455
- export var Namespace;
456
- (function (Namespace) {
457
- Namespace["UNKNOWN_NAMESPACE"] = "UNKNOWN_NAMESPACE";
458
- /** Default namespace for UGC sites. MetaSites with this namespace will be shown in a user's site list by default. */
459
- Namespace["WIX"] = "WIX";
460
- /** ShoutOut stand alone product. These are siteless (no actual Wix site, no HtmlWeb). MetaSites with this namespace will *not* be shown in a user's site list by default. */
461
- Namespace["SHOUT_OUT"] = "SHOUT_OUT";
462
- /** MetaSites created by the Albums product, they appear as part of the Albums app. MetaSites with this namespace will *not* be shown in a user's site list by default. */
463
- Namespace["ALBUMS"] = "ALBUMS";
464
- /** Part of the WixStores migration flow, a user tries to migrate and gets this site to view and if the user likes it then stores removes this namespace and deletes the old site with the old stores. MetaSites with this namespace will *not* be shown in a user's site list by default. */
465
- Namespace["WIX_STORES_TEST_DRIVE"] = "WIX_STORES_TEST_DRIVE";
466
- /** Hotels standalone (siteless). MetaSites with this namespace will *not* be shown in a user's site list by default. */
467
- Namespace["HOTELS"] = "HOTELS";
468
- /** Clubs siteless MetaSites, a club without a wix website. MetaSites with this namespace will *not* be shown in a user's site list by default. */
469
- Namespace["CLUBS"] = "CLUBS";
470
- /** A partially created ADI website. MetaSites with this namespace will *not* be shown in a user's site list by default. */
471
- Namespace["ONBOARDING_DRAFT"] = "ONBOARDING_DRAFT";
472
- /** AppBuilder for AppStudio / shmite (c). MetaSites with this namespace will *not* be shown in a user's site list by default. */
473
- Namespace["DEV_SITE"] = "DEV_SITE";
474
- /** LogoMaker websites offered to the user after logo purchase. MetaSites with this namespace will *not* be shown in a user's site list by default. */
475
- Namespace["LOGOS"] = "LOGOS";
476
- /** VideoMaker websites offered to the user after video purchase. MetaSites with this namespace will *not* be shown in a user's site list by default. */
477
- Namespace["VIDEO_MAKER"] = "VIDEO_MAKER";
478
- /** MetaSites with this namespace will *not* be shown in a user's site list by default. */
479
- Namespace["PARTNER_DASHBOARD"] = "PARTNER_DASHBOARD";
480
- /** MetaSites with this namespace will *not* be shown in a user's site list by default. */
481
- Namespace["DEV_CENTER_COMPANY"] = "DEV_CENTER_COMPANY";
482
- /**
483
- * A draft created by HTML editor on open. Upon "first save" it will be moved to be of WIX domain.
484
- *
485
- * Meta site with this namespace will *not* be shown in a user's site list by default.
486
- */
487
- Namespace["HTML_DRAFT"] = "HTML_DRAFT";
488
- /**
489
- * the user-journey for Fitness users who want to start from managing their business instead of designing their website.
490
- * Will be accessible from Site List and will not have a website app.
491
- * Once the user attaches a site, the site will become a regular wixsite.
492
- */
493
- Namespace["SITELESS_BUSINESS"] = "SITELESS_BUSINESS";
494
- /** Belongs to "strategic products" company. Supports new product in the creator's economy space. */
495
- Namespace["CREATOR_ECONOMY"] = "CREATOR_ECONOMY";
496
- /** It is to be used in the Business First efforts. */
497
- Namespace["DASHBOARD_FIRST"] = "DASHBOARD_FIRST";
498
- /** Bookings business flow with no site. */
499
- Namespace["ANYWHERE"] = "ANYWHERE";
500
- /** Namespace for Headless Backoffice with no editor */
501
- Namespace["HEADLESS"] = "HEADLESS";
502
- /**
503
- * Namespace for master site that will exist in parent account that will be referenced by subaccounts
504
- * The site will be used for account level CSM feature for enterprise
505
- */
506
- Namespace["ACCOUNT_MASTER_CMS"] = "ACCOUNT_MASTER_CMS";
507
- /** Rise.ai Siteless account management for Gift Cards and Store Credit. */
508
- Namespace["RISE"] = "RISE";
509
- /**
510
- * As part of the branded app new funnel, users now can create a meta site that will be branded app first.
511
- * There's a blank site behind the scene but it's blank).
512
- * The Mobile company will be the owner of this namespace.
513
- */
514
- Namespace["BRANDED_FIRST"] = "BRANDED_FIRST";
515
- /** Nownia.com Siteless account management for Ai Scheduling Assistant. */
516
- Namespace["NOWNIA"] = "NOWNIA";
517
- /**
518
- * UGC Templates are templates that are created by users for personal use and to sale to other users.
519
- * The Partners company owns this namespace.
520
- */
521
- Namespace["UGC_TEMPLATE"] = "UGC_TEMPLATE";
522
- /** Codux Headless Sites */
523
- Namespace["CODUX"] = "CODUX";
524
- /** Bobb - AI Design Creator. */
525
- Namespace["MEDIA_DESIGN_CREATOR"] = "MEDIA_DESIGN_CREATOR";
526
- /**
527
- * Shared Blog Site is a unique single site across Enterprise account,
528
- * This site will hold all Blog posts related to the Marketing product.
529
- */
530
- Namespace["SHARED_BLOG_ENTERPRISE"] = "SHARED_BLOG_ENTERPRISE";
531
- /** Standalone forms (siteless). MetaSites with this namespace will *not* be shown in a user's site list by default. */
532
- Namespace["STANDALONE_FORMS"] = "STANDALONE_FORMS";
533
- /** Standalone events (siteless). MetaSites with this namespace will *not* be shown in a user's site list by default. */
534
- Namespace["STANDALONE_EVENTS"] = "STANDALONE_EVENTS";
535
- /** MIMIR - Siteless account for MIMIR Ai Job runner. */
536
- Namespace["MIMIR"] = "MIMIR";
537
- })(Namespace || (Namespace = {}));
538
- export var SortOrder;
539
- (function (SortOrder) {
540
- SortOrder["ASC"] = "ASC";
541
- SortOrder["DESC"] = "DESC";
542
- })(SortOrder || (SortOrder = {}));
543
- export var VersioningMode;
544
- (function (VersioningMode) {
545
- /** use default versioning mode agreed with search team */
546
- VersioningMode["DEFAULT"] = "DEFAULT";
547
- /** execute only if version is greater than existing */
548
- VersioningMode["GREATER_THAN"] = "GREATER_THAN";
549
- /** execute only if version is greater or equal to existing */
550
- VersioningMode["GREATER_OR_EQUAL"] = "GREATER_OR_EQUAL";
551
- })(VersioningMode || (VersioningMode = {}));
552
- export var OrderApprovalStrategy;
553
- (function (OrderApprovalStrategy) {
554
- /** Order is automatically approved when `order.priceSummary.total = 0`, **or** after receiving payment. */
555
- OrderApprovalStrategy["DEFAULT"] = "DEFAULT";
556
- /** Order is automatically approved **only** after receiving payment. */
557
- OrderApprovalStrategy["PAYMENT_RECEIVED"] = "PAYMENT_RECEIVED";
558
- /** Order is automatically approved when payment method is saved for it. */
559
- OrderApprovalStrategy["PAYMENT_METHOD_SAVED"] = "PAYMENT_METHOD_SAVED";
560
- })(OrderApprovalStrategy || (OrderApprovalStrategy = {}));
561
- /** Type of selected payment option for catalog item */
562
- export var DeltaPaymentOptionType;
563
- (function (DeltaPaymentOptionType) {
564
- /** Irrelevant */
565
- DeltaPaymentOptionType["UNKNOWN_PAYMENT_OPTION"] = "UNKNOWN_PAYMENT_OPTION";
566
- /** The entire payment for the given item will happen after checkout. */
567
- DeltaPaymentOptionType["FULL_PAYMENT_OFFLINE"] = "FULL_PAYMENT_OFFLINE";
568
- /**
569
- * Payment for this item can only be done using a membership and must be manually redeemed in the dashboard by the site owner.
570
- * Note: when this option is used, the price will be 0.
571
- */
572
- DeltaPaymentOptionType["MEMBERSHIP_OFFLINE"] = "MEMBERSHIP_OFFLINE";
573
- })(DeltaPaymentOptionType || (DeltaPaymentOptionType = {}));
574
- export var InventoryAction;
575
- (function (InventoryAction) {
576
- /** Restock inventory */
577
- InventoryAction["RESTOCK"] = "RESTOCK";
578
- /** Decrease inventory. Without failing on negative inventory. */
579
- InventoryAction["DECREASE"] = "DECREASE";
580
- })(InventoryAction || (InventoryAction = {}));
581
- export var Placement;
582
- (function (Placement) {
583
- Placement["Unknown"] = "Unknown";
584
- Placement["Replace"] = "Replace";
585
- Placement["Before"] = "Before";
586
- Placement["After"] = "After";
587
- })(Placement || (Placement = {}));
588
- export var SubdivisionType;
589
- (function (SubdivisionType) {
590
- SubdivisionType["UNKNOWN_SUBDIVISION_TYPE"] = "UNKNOWN_SUBDIVISION_TYPE";
591
- /** State */
592
- SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_1"] = "ADMINISTRATIVE_AREA_LEVEL_1";
593
- /** County */
594
- SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_2"] = "ADMINISTRATIVE_AREA_LEVEL_2";
595
- /** City/town */
596
- SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_3"] = "ADMINISTRATIVE_AREA_LEVEL_3";
597
- /** Neighborhood/quarter */
598
- SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_4"] = "ADMINISTRATIVE_AREA_LEVEL_4";
599
- /** Street/block */
600
- SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_5"] = "ADMINISTRATIVE_AREA_LEVEL_5";
601
- /** ADMINISTRATIVE_AREA_LEVEL_0. Indicates the national political entity, and is typically the highest order type returned by the Geocoder. */
602
- SubdivisionType["COUNTRY"] = "COUNTRY";
603
- })(SubdivisionType || (SubdivisionType = {}));
604
- export var SourceType;
605
- (function (SourceType) {
606
- SourceType["UNKNOWN_SOURCE_TYPE"] = "UNKNOWN_SOURCE_TYPE";
607
- SourceType["WIX_APP"] = "WIX_APP";
608
- SourceType["EXTERNAL"] = "EXTERNAL";
609
- SourceType["ADMIN"] = "ADMIN";
610
- SourceType["OTHER"] = "OTHER";
611
- })(SourceType || (SourceType = {}));
612
- export var CustomFieldGroup;
613
- (function (CustomFieldGroup) {
614
- CustomFieldGroup["UNKNOWN_CUSTOM_FIELD_GROUP"] = "UNKNOWN_CUSTOM_FIELD_GROUP";
615
- CustomFieldGroup["BUSINESS_DETAILS"] = "BUSINESS_DETAILS";
616
- CustomFieldGroup["CUSTOMER_DETAILS"] = "CUSTOMER_DETAILS";
617
- CustomFieldGroup["DOCUMENT"] = "DOCUMENT";
618
- CustomFieldGroup["FOOTER"] = "FOOTER";
619
- CustomFieldGroup["OTHER"] = "OTHER";
620
- })(CustomFieldGroup || (CustomFieldGroup = {}));
621
- export var ValueType;
622
- (function (ValueType) {
623
- ValueType["UNKNOWN_VALUE_TYPE"] = "UNKNOWN_VALUE_TYPE";
624
- ValueType["STRING"] = "STRING";
625
- ValueType["DATE"] = "DATE";
626
- ValueType["BOOLEAN"] = "BOOLEAN";
627
- ValueType["NUMBER"] = "NUMBER";
628
- })(ValueType || (ValueType = {}));
629
- export var DepositType;
630
- (function (DepositType) {
631
- DepositType["UNKNOWN"] = "UNKNOWN";
632
- DepositType["FLAT"] = "FLAT";
633
- DepositType["PERCENTAGE"] = "PERCENTAGE";
634
- })(DepositType || (DepositType = {}));
635
- /**
636
- * InvoiceStatus allowed transitions based on current status:
637
- * Draft -> Deleted, Paid, Partially Paid, Sent
638
- * Sent -> Draft, Deleted, Void, Paid, Partially Paid, Processing, (Overdue)
639
- * Processing -> PartiallyPaid, Paid, Sent
640
- * Paid -> Void
641
- * PartiallyPaid -> Void, (PartialAndOverdue)
642
- * Void -> Deleted
643
- * Deleted
644
- */
645
- export var InvoiceStatus;
646
- (function (InvoiceStatus) {
647
- InvoiceStatus["Draft"] = "Draft";
648
- InvoiceStatus["Sent"] = "Sent";
649
- InvoiceStatus["Processing"] = "Processing";
650
- InvoiceStatus["Paid"] = "Paid";
651
- InvoiceStatus["Overdue"] = "Overdue";
652
- InvoiceStatus["Void"] = "Void";
653
- InvoiceStatus["Deleted"] = "Deleted";
654
- InvoiceStatus["PartiallyPaid"] = "PartiallyPaid";
655
- InvoiceStatus["PartialAndOverdue"] = "PartialAndOverdue";
656
- })(InvoiceStatus || (InvoiceStatus = {}));
657
- /**
658
- * Prepares payment collection for given ecom order. This is the first of 2-step process of payment collection.
659
- * Here we ensure that payment collection is possible for given order and store and prepare payment gateway order for future charge.
660
- * 2nd step is an actual charge of prepared payment gateway order. This could be done either
661
- * via Wix-Cashier's API (https://bo.wix.com/wix-docs/rest/wix-cashier/pay/charge/charge-for-order)
662
- * or using Cashier Payments Widget (https://github.com/wix-private/cashier-client/tree/master/packages/cashier-payments-widget)
663
- * @param ecomOrderId - Ecom order ID.
664
- * @param amount - Amount to collect
665
- * @public
666
- * @documentationMaturity preview
667
- * @requiredField amount
668
- * @requiredField ecomOrderId
669
- * @permissionId ECOM.COLLECT_PAYMENTS
670
- * @permissionScope Manage Stores - all permissions
671
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
672
- * @permissionScope Manage Stores
673
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
674
- * @permissionScope Manage Restaurants - all permissions
675
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
676
- * @permissionScope Manage eCommerce - all permissions
677
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
678
- * @applicableIdentity APP
679
- * @fqn com.wix.ecom.orders.payments_collector.v1.PaymentsCollector.PreparePaymentCollection
680
- */
681
- export async function preparePaymentCollection(ecomOrderId, amount, options) {
682
- // @ts-ignore
683
- const { httpClient, sideEffects } = arguments[3];
684
- const payload = renameKeysFromSDKRequestToRESTRequest({
685
- ecomOrderId: ecomOrderId,
686
- amount: amount,
687
- paymentGatewayOrderId: options?.paymentGatewayOrderId,
688
- delayedCapture: options?.delayedCapture,
689
- delayedCaptureSettings: options?.delayedCaptureSettings,
690
- });
691
- const reqOpts = ambassadorWixEcomV1Order.preparePaymentCollection(payload);
692
- sideEffects?.onSiteCall?.();
693
- try {
694
- const result = await httpClient.request(reqOpts);
695
- sideEffects?.onSuccess?.(result);
696
- return renameKeysFromRESTResponseToSDKResponse(result.data);
697
- }
698
- catch (err) {
699
- const transformedError = sdkTransformError(err, {
700
- spreadPathsToArguments: {},
701
- explicitPathsToArguments: {
702
- ecomOrderId: '$[0]',
703
- amount: '$[1]',
704
- paymentGatewayOrderId: '$[2].paymentGatewayOrderId',
705
- delayedCapture: '$[2].delayedCapture',
706
- delayedCaptureSettings: '$[2].delayedCaptureSettings',
707
- },
708
- singleArgumentUnchanged: false,
709
- }, ['ecomOrderId', 'amount', 'options']);
710
- sideEffects?.onError?.(err);
711
- throw transformedError;
712
- }
713
- }
714
- /**
715
- * Provides payment collectability status for given order. If payment collection is possible
716
- * response will contain collectable amount for given ecom order. If not - response will contain
717
- * reason why payment collection is not possible.
718
- * @param ecomOrderId - Ecom order ID.
719
- * @public
720
- * @documentationMaturity preview
721
- * @requiredField ecomOrderId
722
- * @permissionId ECOM.COLLECT_PAYMENTS
723
- * @permissionScope Manage Stores - all permissions
724
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
725
- * @permissionScope Manage Stores
726
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
727
- * @permissionScope Manage Restaurants - all permissions
728
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
729
- * @permissionScope Manage eCommerce - all permissions
730
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
731
- * @applicableIdentity APP
732
- * @fqn com.wix.ecom.orders.payments_collector.v1.PaymentsCollector.GetPaymentCollectabilityStatus
733
- */
734
- export async function getPaymentCollectabilityStatus(ecomOrderId) {
735
- // @ts-ignore
736
- const { httpClient, sideEffects } = arguments[1];
737
- const payload = renameKeysFromSDKRequestToRESTRequest({
738
- ecomOrderId: ecomOrderId,
739
- });
740
- const reqOpts = ambassadorWixEcomV1Order.getPaymentCollectabilityStatus(payload);
741
- sideEffects?.onSiteCall?.();
742
- try {
743
- const result = await httpClient.request(reqOpts);
744
- sideEffects?.onSuccess?.(result);
745
- return renameKeysFromRESTResponseToSDKResponse(result.data);
746
- }
747
- catch (err) {
748
- const transformedError = sdkTransformError(err, {
749
- spreadPathsToArguments: {},
750
- explicitPathsToArguments: { ecomOrderId: '$[0]' },
751
- singleArgumentUnchanged: false,
752
- }, ['ecomOrderId']);
753
- sideEffects?.onError?.(err);
754
- throw transformedError;
755
- }
756
- }
757
- /**
758
- * Records and approves new manual payment with provided custom amount on given order.
759
- * Existing pending payments are ignored.
760
- * 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)
761
- * @param orderId - Order ID.
762
- * @param amount - Amount to be recorded as approved manual payment for given order
763
- * @internal
764
- * @documentationMaturity preview
765
- * @requiredField amount
766
- * @requiredField orderId
767
- * @permissionId ECOM.COLLECT_PAYMENTS
768
- * @permissionScope Manage Stores - all permissions
769
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
770
- * @permissionScope Manage Stores
771
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
772
- * @permissionScope Manage Restaurants - all permissions
773
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
774
- * @permissionScope Manage eCommerce - all permissions
775
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
776
- * @applicableIdentity APP
777
- * @fqn com.wix.ecom.orders.payments_collector.v1.PaymentsCollector.RecordManuallyCollectedPayment
778
- */
779
- export async function recordManuallyCollectedPayment(orderId, amount) {
780
- // @ts-ignore
781
- const { httpClient, sideEffects } = arguments[2];
782
- const payload = renameKeysFromSDKRequestToRESTRequest({
783
- orderId: orderId,
784
- amount: amount,
785
- });
786
- const reqOpts = ambassadorWixEcomV1Order.recordManuallyCollectedPayment(payload);
787
- sideEffects?.onSiteCall?.();
788
- try {
789
- const result = await httpClient.request(reqOpts);
790
- sideEffects?.onSuccess?.(result);
791
- }
792
- catch (err) {
793
- const transformedError = sdkTransformError(err, {
794
- spreadPathsToArguments: {},
795
- explicitPathsToArguments: { orderId: '$[0]', amount: '$[1]' },
796
- singleArgumentUnchanged: false,
797
- }, ['orderId', 'amount']);
798
- sideEffects?.onError?.(err);
799
- throw transformedError;
800
- }
801
- }
802
- /**
803
- * Marks the order as paid. `order.paymentStatus` field *eventually* changes to `PAID`.
804
- * In case the order already has an offline payment transaction associated with it
805
- * (usually when manual payment method is chosen at checkout) - This transaction will become approved.
806
- * In case the order has no payment transactions associated with it
807
- * (usually when the item is set to be paid offline after checkout or when an order is created from the backoffice) - A payment transaction
808
- * will be created and approved.
809
- * @param ecomOrderId - Ecom order ID.
810
- * @internal
811
- * @documentationMaturity preview
812
- * @requiredField ecomOrderId
813
- * @permissionId ECOM.MODIFY_ORDERS
814
- * @permissionScope Manage Stores - all permissions
815
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
816
- * @permissionScope Manage Stores
817
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
818
- * @permissionScope Manage Restaurants - all permissions
819
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
820
- * @permissionScope Manage eCommerce - all permissions
821
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
822
- * @permissionScope Manage Orders
823
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
824
- * @applicableIdentity APP
825
- * @fqn com.wix.ecom.orders.payments_collector.v1.PaymentsCollector.MarkOrderAsPaid
826
- */
827
- export async function paymentCollectionMarkOrderAsPaid(ecomOrderId) {
828
- // @ts-ignore
829
- const { httpClient, sideEffects } = arguments[1];
830
- const payload = renameKeysFromSDKRequestToRESTRequest({
831
- ecomOrderId: ecomOrderId,
832
- });
833
- const reqOpts = ambassadorWixEcomV1Order.paymentCollectionMarkOrderAsPaid(payload);
834
- sideEffects?.onSiteCall?.();
835
- try {
836
- const result = await httpClient.request(reqOpts);
837
- sideEffects?.onSuccess?.(result);
838
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
839
- {
840
- transformFn: transformRESTImageToSDKImage,
841
- paths: [{ path: 'order.lineItems.image' }],
842
- },
843
- {
844
- transformFn: transformRESTAddressToSDKAddress,
845
- paths: [
846
- { path: 'order.billingInfo.address' },
847
- {
848
- path: 'order.shippingInfo.logistics.shippingDestination.address',
849
- },
850
- { path: 'order.shippingInfo.logistics.pickupDetails.address' },
851
- { path: 'order.recipientInfo.address' },
852
- ],
853
- },
854
- ]));
855
- }
856
- catch (err) {
857
- const transformedError = sdkTransformError(err, {
858
- spreadPathsToArguments: {},
859
- explicitPathsToArguments: { ecomOrderId: '$[0]' },
860
- singleArgumentUnchanged: false,
861
- }, ['ecomOrderId']);
862
- sideEffects?.onError?.(err);
863
- throw transformedError;
864
- }
865
- }
866
- /**
867
- * Marks multiple orders as paid. `order.paymentStatus` field *eventually* changes to `PAID`.
868
- * @param ecomOrderIds - IDs of orders to mark as paid.
869
- * @internal
870
- * @documentationMaturity preview
871
- * @requiredField ecomOrderIds
872
- * @permissionId ECOM.MODIFY_ORDERS
873
- * @permissionScope Manage Stores - all permissions
874
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
875
- * @permissionScope Manage Stores
876
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
877
- * @permissionScope Manage Restaurants - all permissions
878
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
879
- * @permissionScope Manage eCommerce - all permissions
880
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
881
- * @permissionScope Manage Orders
882
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
883
- * @applicableIdentity APP
884
- * @fqn com.wix.ecom.orders.payments_collector.v1.PaymentsCollector.BulkMarkOrdersAsPaid
885
- */
886
- export async function paymentCollectionBulkMarkOrdersAsPaid(ecomOrderIds) {
887
- // @ts-ignore
888
- const { httpClient, sideEffects } = arguments[1];
889
- const payload = renameKeysFromSDKRequestToRESTRequest({
890
- ecomOrderIds: ecomOrderIds,
891
- });
892
- const reqOpts = ambassadorWixEcomV1Order.paymentCollectionBulkMarkOrdersAsPaid(payload);
893
- sideEffects?.onSiteCall?.();
894
- try {
895
- const result = await httpClient.request(reqOpts);
896
- sideEffects?.onSuccess?.(result);
897
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
898
- {
899
- transformFn: transformRESTImageToSDKImage,
900
- paths: [{ path: 'results.item.lineItems.image' }],
901
- },
902
- {
903
- transformFn: transformRESTAddressToSDKAddress,
904
- paths: [
905
- { path: 'results.item.billingInfo.address' },
906
- {
907
- path: 'results.item.shippingInfo.logistics.shippingDestination.address',
908
- },
909
- {
910
- path: 'results.item.shippingInfo.logistics.pickupDetails.address',
911
- },
912
- { path: 'results.item.recipientInfo.address' },
913
- ],
914
- },
915
- ]));
916
- }
917
- catch (err) {
918
- const transformedError = sdkTransformError(err, {
919
- spreadPathsToArguments: {},
920
- explicitPathsToArguments: { ecomOrderIds: '$[0]' },
921
- singleArgumentUnchanged: false,
922
- }, ['ecomOrderIds']);
923
- sideEffects?.onError?.(err);
924
- throw transformedError;
925
- }
926
- }
927
- /**
928
- * Checks whether this order can be refunded.
929
- * @param ecomOrderId - Order ID.
930
- * @internal
931
- * @documentationMaturity preview
932
- * @requiredField ecomOrderId
933
- * @permissionId ECOM.READ_TRANSACTIONS
934
- * @permissionScope Manage Stores - all permissions
935
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
936
- * @permissionScope Manage Stores
937
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
938
- * @permissionScope Read eCommerce - all read permissions
939
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.READ-ECOM
940
- * @permissionScope Read Orders
941
- * @permissionScopeId SCOPE.DC-STORES.READ-ORDERS
942
- * @permissionScope Read Stores - all read permissions
943
- * @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
944
- * @permissionScope Manage Restaurants - all permissions
945
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
946
- * @permissionScope Manage eCommerce - all permissions
947
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
948
- * @permissionScope Manage Orders
949
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
950
- * @applicableIdentity APP
951
- * @fqn com.wix.ecom.orders.payments_collector.v1.PaymentsCollector.GetRefundabilityStatus
952
- */
953
- export async function getRefundabilityStatus(ecomOrderId) {
954
- // @ts-ignore
955
- const { httpClient, sideEffects } = arguments[1];
956
- const payload = renameKeysFromSDKRequestToRESTRequest({
957
- ecomOrderId: ecomOrderId,
958
- });
959
- const reqOpts = ambassadorWixEcomV1Order.getRefundabilityStatus(payload);
960
- sideEffects?.onSiteCall?.();
961
- try {
962
- const result = await httpClient.request(reqOpts);
963
- sideEffects?.onSuccess?.(result);
964
- return renameKeysFromRESTResponseToSDKResponse(result.data);
965
- }
966
- catch (err) {
967
- const transformedError = sdkTransformError(err, {
968
- spreadPathsToArguments: {},
969
- explicitPathsToArguments: { ecomOrderId: '$[0]' },
970
- singleArgumentUnchanged: false,
971
- }, ['ecomOrderId']);
972
- sideEffects?.onError?.(err);
973
- throw transformedError;
974
- }
975
- }
976
- /**
977
- * Call this endpoint to create an order in the payment gateway system. The amount of the order would be either:
978
- * 1. An explicit amount provided in the request, or;
979
- * 2. If an explicit amount is not provided - the remaining amount to complete the payment of that eCom order.
980
- * As a result, an ID of the created payment gateway order would be returned.
981
- * 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).
982
- * @param ecomOrderId - Ecom order ID.
983
- * @internal
984
- * @documentationMaturity preview
985
- * @requiredField ecomOrderId
986
- * @permissionId ECOM.MODIFY_ORDERS
987
- * @permissionScope Manage Stores - all permissions
988
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
989
- * @permissionScope Manage Stores
990
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
991
- * @permissionScope Manage Restaurants - all permissions
992
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
993
- * @permissionScope Manage eCommerce - all permissions
994
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
995
- * @permissionScope Manage Orders
996
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
997
- * @applicableIdentity APP
998
- * @fqn com.wix.ecom.orders.payments_collector.v1.PaymentsCollector.CreatePaymentGatewayOrder
999
- */
1000
- export async function paymentCollectionCreatePaymentGatewayOrder(ecomOrderId, options) {
1001
- // @ts-ignore
1002
- const { httpClient, sideEffects } = arguments[2];
1003
- const payload = renameKeysFromSDKRequestToRESTRequest({
1004
- ecomOrderId: ecomOrderId,
1005
- chargedBy: options?.chargedBy,
1006
- });
1007
- const reqOpts = ambassadorWixEcomV1Order.paymentCollectionCreatePaymentGatewayOrder(payload);
1008
- sideEffects?.onSiteCall?.();
1009
- try {
1010
- const result = await httpClient.request(reqOpts);
1011
- sideEffects?.onSuccess?.(result);
1012
- return renameKeysFromRESTResponseToSDKResponse(result.data);
1013
- }
1014
- catch (err) {
1015
- const transformedError = sdkTransformError(err, {
1016
- spreadPathsToArguments: {},
1017
- explicitPathsToArguments: {
1018
- ecomOrderId: '$[0]',
1019
- chargedBy: '$[1].chargedBy',
1020
- },
1021
- singleArgumentUnchanged: false,
1022
- }, ['ecomOrderId', 'options']);
1023
- sideEffects?.onError?.(err);
1024
- throw transformedError;
1025
- }
1026
- }
1027
- /** @param ecomOrderId - Order ID.
1028
- * @param memberId - The member id. Do not attempt to get it from the request context, since in some cases the caller is not a member
1029
- * but a user which is using the membership on behalf of the a member
1030
- * @internal
1031
- * @documentationMaturity preview
1032
- * @requiredField ecomOrderId
1033
- * @requiredField memberId
1034
- * @requiredField options.membershipCharges.appId
1035
- * @requiredField options.membershipCharges.catalogReference
1036
- * @requiredField options.membershipCharges.catalogReference.appId
1037
- * @requiredField options.membershipCharges.catalogReference.catalogItemId
1038
- * @requiredField options.membershipCharges.membershipId
1039
- * @requiredField options.membershipCharges.membershipName
1040
- * @requiredField options.membershipCharges.membershipName.original
1041
- * @requiredField options.membershipCharges.rootCatalogItemId
1042
- * @permissionId ECOM.MODIFY_TRANSACTIONS
1043
- * @permissionScope Manage Stores - all permissions
1044
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
1045
- * @permissionScope Manage Stores
1046
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
1047
- * @permissionScope Manage Restaurants - all permissions
1048
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
1049
- * @permissionScope Manage eCommerce - all permissions
1050
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
1051
- * @permissionScope Manage Orders
1052
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
1053
- * @applicableIdentity APP
1054
- * @fqn com.wix.ecom.orders.payments_collector.v1.PaymentsCollector.ChargeMemberships
1055
- */
1056
- export async function chargeMemberships(ecomOrderId, memberId, options) {
1057
- // @ts-ignore
1058
- const { httpClient, sideEffects } = arguments[3];
1059
- const payload = renameKeysFromSDKRequestToRESTRequest({
1060
- ecomOrderId: ecomOrderId,
1061
- memberId: memberId,
1062
- membershipCharges: options?.membershipCharges,
1063
- });
1064
- const reqOpts = ambassadorWixEcomV1Order.chargeMemberships(payload);
1065
- sideEffects?.onSiteCall?.();
1066
- try {
1067
- const result = await httpClient.request(reqOpts);
1068
- sideEffects?.onSuccess?.(result);
1069
- }
1070
- catch (err) {
1071
- const transformedError = sdkTransformError(err, {
1072
- spreadPathsToArguments: {},
1073
- explicitPathsToArguments: {
1074
- ecomOrderId: '$[0]',
1075
- memberId: '$[1]',
1076
- membershipCharges: '$[2].membershipCharges',
1077
- },
1078
- singleArgumentUnchanged: false,
1079
- }, ['ecomOrderId', 'memberId', 'options']);
1080
- sideEffects?.onError?.(err);
1081
- throw transformedError;
1082
- }
1083
- }
1084
- /**
1085
- * Calls corresponding payment providers and creates refund transactions for requested payments.
1086
- * Updates order transactions based on refund results.
1087
- * For requested payments with `TriggerRefundRequest.payments.external_refund = true` will not call payment providers and
1088
- * will only update order transactions.
1089
- * @param ecomOrderId - The order this refund related to
1090
- * @param payments - Refund operations information
1091
- * @internal
1092
- * @documentationMaturity preview
1093
- * @requiredField ecomOrderId
1094
- * @requiredField payments
1095
- * @requiredField payments.paymentId
1096
- * @permissionId ECOM.MODIFY_TRANSACTIONS
1097
- * @permissionScope Manage Stores - all permissions
1098
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
1099
- * @permissionScope Manage Stores
1100
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
1101
- * @permissionScope Manage Restaurants - all permissions
1102
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
1103
- * @permissionScope Manage eCommerce - all permissions
1104
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
1105
- * @permissionScope Manage Orders
1106
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
1107
- * @applicableIdentity APP
1108
- * @fqn com.wix.ecom.orders.payments_collector.v1.PaymentsCollector.TriggerRefund
1109
- */
1110
- export async function triggerRefund(ecomOrderId, payments, options) {
1111
- // @ts-ignore
1112
- const { httpClient, sideEffects } = arguments[3];
1113
- const payload = renameKeysFromSDKRequestToRESTRequest({
1114
- ecomOrderId: ecomOrderId,
1115
- payments: payments,
1116
- details: options?.details,
1117
- sideEffects: options?.sideEffects,
1118
- });
1119
- const reqOpts = ambassadorWixEcomV1Order.triggerRefund(payload);
1120
- sideEffects?.onSiteCall?.();
1121
- try {
1122
- const result = await httpClient.request(reqOpts);
1123
- sideEffects?.onSuccess?.(result);
1124
- return renameKeysFromRESTResponseToSDKResponse(result.data);
1125
- }
1126
- catch (err) {
1127
- const transformedError = sdkTransformError(err, {
1128
- spreadPathsToArguments: {},
1129
- explicitPathsToArguments: {
1130
- ecomOrderId: '$[0]',
1131
- payments: '$[1]',
1132
- details: '$[2].details',
1133
- sideEffects: '$[2].sideEffects',
1134
- },
1135
- singleArgumentUnchanged: false,
1136
- }, ['ecomOrderId', 'payments', 'options']);
1137
- sideEffects?.onError?.(err);
1138
- throw transformedError;
1139
- }
1140
- }
1141
- /**
1142
- * Void authorized payments
1143
- * Transaction statuses for related payments will be updated in async way
1144
- * @param ecomOrderId - Wix eCommerce order ID
1145
- * @param paymentIds - Payment IDs
1146
- * @public
1147
- * @documentationMaturity preview
1148
- * @requiredField ecomOrderId
1149
- * @requiredField paymentIds
1150
- * @permissionId ECOM.ORDER_VOID_AUTHORIZED_PAYMENT
1151
- * @permissionScope Manage Stores - all permissions
1152
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
1153
- * @permissionScope Manage Stores
1154
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
1155
- * @permissionScope Manage Restaurants - all permissions
1156
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
1157
- * @permissionScope Manage eCommerce - all permissions
1158
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
1159
- * @permissionScope Manage Orders
1160
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
1161
- * @applicableIdentity APP
1162
- * @fqn com.wix.ecom.orders.payments_collector.v1.PaymentsCollector.VoidAuthorizedPayments
1163
- */
1164
- export async function voidAuthorizedPayments(ecomOrderId, paymentIds) {
1165
- // @ts-ignore
1166
- const { httpClient, sideEffects } = arguments[2];
1167
- const payload = renameKeysFromSDKRequestToRESTRequest({
1168
- ecomOrderId: ecomOrderId,
1169
- paymentIds: paymentIds,
1170
- });
1171
- const reqOpts = ambassadorWixEcomV1Order.voidAuthorizedPayments(payload);
1172
- sideEffects?.onSiteCall?.();
1173
- try {
1174
- const result = await httpClient.request(reqOpts);
1175
- sideEffects?.onSuccess?.(result);
1176
- return renameKeysFromRESTResponseToSDKResponse(result.data);
1177
- }
1178
- catch (err) {
1179
- const transformedError = sdkTransformError(err, {
1180
- spreadPathsToArguments: {},
1181
- explicitPathsToArguments: { ecomOrderId: '$[0]', paymentIds: '$[1]' },
1182
- singleArgumentUnchanged: false,
1183
- }, ['ecomOrderId', 'paymentIds']);
1184
- sideEffects?.onError?.(err);
1185
- throw transformedError;
1186
- }
1187
- }
1188
- /**
1189
- * Capture authorized payments
1190
- * Transaction statuses for related payments will be updated in async way
1191
- * @param ecomOrderId - Wix eCommerce order ID
1192
- * @param payments - Capture payments information
1193
- * @public
1194
- * @documentationMaturity preview
1195
- * @requiredField ecomOrderId
1196
- * @requiredField payments
1197
- * @requiredField payments.paymentId
1198
- * @permissionId ECOM.ORDER_CAPTURE_AUTHORIZED_PAYMENT
1199
- * @permissionScope Manage Stores - all permissions
1200
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
1201
- * @permissionScope Manage Stores
1202
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
1203
- * @permissionScope Manage Restaurants - all permissions
1204
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
1205
- * @permissionScope Manage eCommerce - all permissions
1206
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
1207
- * @permissionScope Manage Orders
1208
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
1209
- * @applicableIdentity APP
1210
- * @fqn com.wix.ecom.orders.payments_collector.v1.PaymentsCollector.CaptureAuthorizedPayments
1211
- */
1212
- export async function captureAuthorizedPayments(ecomOrderId, payments) {
1213
- // @ts-ignore
1214
- const { httpClient, sideEffects } = arguments[2];
1215
- const payload = renameKeysFromSDKRequestToRESTRequest({
1216
- ecomOrderId: ecomOrderId,
1217
- payments: payments,
1218
- });
1219
- const reqOpts = ambassadorWixEcomV1Order.captureAuthorizedPayments(payload);
1220
- sideEffects?.onSiteCall?.();
1221
- try {
1222
- const result = await httpClient.request(reqOpts);
1223
- sideEffects?.onSuccess?.(result);
1224
- return renameKeysFromRESTResponseToSDKResponse(result.data);
1225
- }
1226
- catch (err) {
1227
- const transformedError = sdkTransformError(err, {
1228
- spreadPathsToArguments: {},
1229
- explicitPathsToArguments: { ecomOrderId: '$[0]', payments: '$[1]' },
1230
- singleArgumentUnchanged: false,
1231
- }, ['ecomOrderId', 'payments']);
1232
- sideEffects?.onError?.(err);
1233
- throw transformedError;
1234
- }
1235
- }
1236
- /**
1237
- * Retrieves an order.
1238
- *
1239
- *
1240
- * The `getOrder()` function returns a Promise that resolves when the specified order is retrieved.
1241
- *
1242
- * 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).
1243
- * @param _id - ID of the order to retrieve.
1244
- * @public
1245
- * @requiredField _id
1246
- * @permissionId ECOM.READ_ORDERS
1247
- * @permissionId ECOM.ORDER_READ_ALL_EXTENDED_FIELDS
1248
- * @permissionScope Manage Stores - all permissions
1249
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
1250
- * @permissionScope Manage Stores
1251
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
1252
- * @permissionScope Read eCommerce - all read permissions
1253
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.READ-ECOM
1254
- * @permissionScope Read Orders
1255
- * @permissionScopeId SCOPE.DC-STORES.READ-ORDERS
1256
- * @permissionScope Read Stores - all read permissions
1257
- * @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
1258
- * @permissionScope Manage Restaurants - all permissions
1259
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
1260
- * @permissionScope Manage eCommerce - all permissions
1261
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
1262
- * @permissionScope Manage Orders
1263
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
1264
- * @applicableIdentity APP
1265
- * @returns Fulfilled - The requested order.
1266
- * @fqn com.wix.ecom.orders.v1.Orders.GetOrder
1267
- */
1268
- export async function getOrder(_id) {
1269
- // @ts-ignore
1270
- const { httpClient, sideEffects } = arguments[1];
1271
- const payload = renameKeysFromSDKRequestToRESTRequest({ id: _id });
1272
- const reqOpts = ambassadorWixEcomV1Order.getOrder(payload);
1273
- sideEffects?.onSiteCall?.();
1274
- try {
1275
- const result = await httpClient.request(reqOpts);
1276
- sideEffects?.onSuccess?.(result);
1277
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
1278
- {
1279
- transformFn: transformRESTImageToSDKImage,
1280
- paths: [{ path: 'order.lineItems.image' }],
1281
- },
1282
- {
1283
- transformFn: transformRESTAddressToSDKAddress,
1284
- paths: [
1285
- { path: 'order.billingInfo.address' },
1286
- {
1287
- path: 'order.shippingInfo.logistics.shippingDestination.address',
1288
- },
1289
- { path: 'order.shippingInfo.logistics.pickupDetails.address' },
1290
- { path: 'order.recipientInfo.address' },
1291
- ],
1292
- },
1293
- ]))?.order;
1294
- }
1295
- catch (err) {
1296
- const transformedError = sdkTransformError(err, {
1297
- spreadPathsToArguments: {},
1298
- explicitPathsToArguments: { id: '$[0]' },
1299
- singleArgumentUnchanged: false,
1300
- }, ['_id']);
1301
- sideEffects?.onError?.(err);
1302
- throw transformedError;
1303
- }
1304
- }
1305
- /**
1306
- * Retrieves a list of orders, given the provided paging, filtering, and sorting.
1307
- *
1308
- *
1309
- * Search Orders runs with these defaults, which you can override:
1310
- *
1311
- * - `createdDate` is sorted in `DESC` order
1312
- * - `cursorPaging.limit` is `100`
1313
- * - `filter: {"status": {"$ne": "INITIALIZED"}}` - other order statuses can be queried, but orders with `status: "INITIALIZED"` are never returned
1314
- *
1315
- * 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).
1316
- *
1317
- * To learn about working with _Search_ endpoints, see
1318
- * [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language), and
1319
- * [Sorting and Paging](https://dev.wix.com/docs/rest/articles/getting-started/sorting-and-paging).
1320
- * @param search - Search options.
1321
- * @public
1322
- * @requiredField search
1323
- * @permissionId ECOM.READ_ORDERS
1324
- * @permissionScope Manage Stores - all permissions
1325
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
1326
- * @permissionScope Manage Stores
1327
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
1328
- * @permissionScope Read eCommerce - all read permissions
1329
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.READ-ECOM
1330
- * @permissionScope Read Orders
1331
- * @permissionScopeId SCOPE.DC-STORES.READ-ORDERS
1332
- * @permissionScope Read Stores - all read permissions
1333
- * @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
1334
- * @permissionScope Manage Restaurants - all permissions
1335
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
1336
- * @permissionScope Manage eCommerce - all permissions
1337
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
1338
- * @permissionScope Manage Orders
1339
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
1340
- * @applicableIdentity APP
1341
- * @fqn com.wix.ecom.orders.v1.Orders.SearchOrders
1342
- */
1343
- export async function searchOrders(search) {
1344
- // @ts-ignore
1345
- const { httpClient, sideEffects } = arguments[1];
1346
- const payload = renameKeysFromSDKRequestToRESTRequest({ search: search });
1347
- const reqOpts = ambassadorWixEcomV1Order.searchOrders(payload);
1348
- sideEffects?.onSiteCall?.();
1349
- try {
1350
- const result = await httpClient.request(reqOpts);
1351
- sideEffects?.onSuccess?.(result);
1352
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
1353
- {
1354
- transformFn: transformRESTImageToSDKImage,
1355
- paths: [{ path: 'orders.lineItems.image' }],
1356
- },
1357
- {
1358
- transformFn: transformRESTAddressToSDKAddress,
1359
- paths: [
1360
- { path: 'orders.billingInfo.address' },
1361
- {
1362
- path: 'orders.shippingInfo.logistics.shippingDestination.address',
1363
- },
1364
- { path: 'orders.shippingInfo.logistics.pickupDetails.address' },
1365
- { path: 'orders.recipientInfo.address' },
1366
- ],
1367
- },
1368
- ]));
1369
- }
1370
- catch (err) {
1371
- const transformedError = sdkTransformError(err, {
1372
- spreadPathsToArguments: {},
1373
- explicitPathsToArguments: { search: '$[0]' },
1374
- singleArgumentUnchanged: false,
1375
- }, ['search']);
1376
- sideEffects?.onError?.(err);
1377
- throw transformedError;
1378
- }
1379
- }
1380
- /**
1381
- * Creates an order.
1382
- *
1383
- *
1384
- * The `createOrder()` function returns a Promise that resolves when the order is created.
1385
- *
1386
- * > **Notes:**
1387
- * > + If an item is digital - `lineItems[i].itemType.preset: DIGITAL` - then `lineItems[i].digitalFile` must be provided.
1388
- * > + If `lineItems[i].id` is passed, it must be either a valid GUID, or empty.
1389
- * @param order - Order info.
1390
- * @public
1391
- * @requiredField order
1392
- * @requiredField order.billingInfo.contactDetails
1393
- * @requiredField order.channelInfo
1394
- * @requiredField order.currencyConversionDetails.conversionRate
1395
- * @requiredField order.currencyConversionDetails.originalCurrency
1396
- * @requiredField order.lineItems
1397
- * @requiredField order.lineItems.catalogReference.appId
1398
- * @requiredField order.lineItems.catalogReference.catalogItemId
1399
- * @requiredField order.lineItems.itemType
1400
- * @requiredField order.lineItems.price
1401
- * @requiredField order.lineItems.productName
1402
- * @requiredField order.lineItems.productName.original
1403
- * @requiredField order.lineItems.quantity
1404
- * @requiredField order.priceSummary
1405
- * @permissionId ECOM.CREATE_ORDERS
1406
- * @permissionId ECOM.ORDER_WRITE_ALL_EXTENDED_FIELDS
1407
- * @permissionScope Manage Stores - all permissions
1408
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
1409
- * @permissionScope Manage Stores
1410
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
1411
- * @permissionScope Manage Restaurants - all permissions
1412
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
1413
- * @permissionScope Manage eCommerce - all permissions
1414
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
1415
- * @permissionScope Manage Orders
1416
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
1417
- * @applicableIdentity APP
1418
- * @returns Newly created order.
1419
- * @fqn com.wix.ecom.orders.v1.Orders.CreateOrder
1420
- */
1421
- export async function createOrder(order, options) {
1422
- // @ts-ignore
1423
- const { httpClient, sideEffects } = arguments[2];
1424
- const payload = transformPaths(renameKeysFromSDKRequestToRESTRequest({
1425
- order: order,
1426
- settings: options?.settings,
1427
- }), [
1428
- {
1429
- transformFn: transformSDKImageToRESTImage,
1430
- paths: [{ path: 'order.lineItems.image' }],
1431
- },
1432
- {
1433
- transformFn: transformSDKAddressToRESTAddress,
1434
- paths: [
1435
- { path: 'order.billingInfo.address' },
1436
- { path: 'order.shippingInfo.logistics.shippingDestination.address' },
1437
- { path: 'order.shippingInfo.logistics.pickupDetails.address' },
1438
- { path: 'order.recipientInfo.address' },
1439
- ],
1440
- },
1441
- ]);
1442
- const reqOpts = ambassadorWixEcomV1Order.createOrder(payload);
1443
- sideEffects?.onSiteCall?.();
1444
- try {
1445
- const result = await httpClient.request(reqOpts);
1446
- sideEffects?.onSuccess?.(result);
1447
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
1448
- {
1449
- transformFn: transformRESTImageToSDKImage,
1450
- paths: [{ path: 'order.lineItems.image' }],
1451
- },
1452
- {
1453
- transformFn: transformRESTAddressToSDKAddress,
1454
- paths: [
1455
- { path: 'order.billingInfo.address' },
1456
- {
1457
- path: 'order.shippingInfo.logistics.shippingDestination.address',
1458
- },
1459
- { path: 'order.shippingInfo.logistics.pickupDetails.address' },
1460
- { path: 'order.recipientInfo.address' },
1461
- ],
1462
- },
1463
- ]))?.order;
1464
- }
1465
- catch (err) {
1466
- const transformedError = sdkTransformError(err, {
1467
- spreadPathsToArguments: {},
1468
- explicitPathsToArguments: { order: '$[0]', settings: '$[1].settings' },
1469
- singleArgumentUnchanged: false,
1470
- }, ['order', 'options']);
1471
- sideEffects?.onError?.(err);
1472
- throw transformedError;
1473
- }
1474
- }
1475
- /**
1476
- * Updates an order.
1477
- *
1478
- *
1479
- * The `updateOrder()` function returns a Promise that resolves when the specified order's information is updated.
1480
- *
1481
- * Currently, the following fields can be updated:
1482
- * + `order.buyerInfo.email`
1483
- * + `order.buyerLanguage`
1484
- * + `order.weightUnit`
1485
- * + `order.billingInfo.address`
1486
- * + `order.billingInfo.contactDetails`
1487
- * + `order.archived`
1488
- * + `order.attributionSource`
1489
- * + `order.seenByAHuman`
1490
- * + `order.recipientInfo.address`
1491
- * + `order.recipientInfo.contactDetails`
1492
- * + `order.shippingInfo.logistics.shippingDestination.address`
1493
- * + `order.shippingInfo.logistics.shippingDestination.contactDetails`
1494
- *
1495
- * To update a field's value, include the new value in the `order` object in the method parameters.
1496
- * To remove a field's value, pass `null`.
1497
- *
1498
- * > **Note:** Removing `buyerInfo` or `contactDetails` fields results in an error.
1499
- *
1500
- * To update an order's payment status, use [`updatePaymentStatus( )`](https://www.wix.com/velo/reference/wix-ecom-backend/ordertransactions/updatepaymentstatus).
1501
- * @param _id - Order ID.
1502
- * @public
1503
- * @requiredField _id
1504
- * @requiredField order
1505
- * @permissionId ECOM.MODIFY_ORDERS
1506
- * @permissionId ECOM.ORDER_WRITE_ALL_EXTENDED_FIELDS
1507
- * @permissionScope Manage Stores - all permissions
1508
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
1509
- * @permissionScope Manage Stores
1510
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
1511
- * @permissionScope Manage Restaurants - all permissions
1512
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
1513
- * @permissionScope Manage eCommerce - all permissions
1514
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
1515
- * @permissionScope Manage Orders
1516
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
1517
- * @applicableIdentity APP
1518
- * @returns Newly created order.
1519
- * @fqn com.wix.ecom.orders.v1.Orders.UpdateOrder
1520
- */
1521
- export async function updateOrder(_id, order) {
1522
- // @ts-ignore
1523
- const { httpClient, sideEffects } = arguments[2];
1524
- const payload = transformPaths(renameKeysFromSDKRequestToRESTRequest({ order: { ...order, id: _id } }), [
1525
- {
1526
- transformFn: transformSDKImageToRESTImage,
1527
- paths: [{ path: 'order.lineItems.image' }],
1528
- },
1529
- {
1530
- transformFn: transformSDKAddressToRESTAddress,
1531
- paths: [
1532
- { path: 'order.billingInfo.address' },
1533
- { path: 'order.shippingInfo.logistics.shippingDestination.address' },
1534
- { path: 'order.shippingInfo.logistics.pickupDetails.address' },
1535
- { path: 'order.recipientInfo.address' },
1536
- ],
1537
- },
1538
- ]);
1539
- const reqOpts = ambassadorWixEcomV1Order.updateOrder(payload);
1540
- sideEffects?.onSiteCall?.();
1541
- try {
1542
- const result = await httpClient.request(reqOpts);
1543
- sideEffects?.onSuccess?.(result);
1544
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
1545
- {
1546
- transformFn: transformRESTImageToSDKImage,
1547
- paths: [{ path: 'order.lineItems.image' }],
1548
- },
1549
- {
1550
- transformFn: transformRESTAddressToSDKAddress,
1551
- paths: [
1552
- { path: 'order.billingInfo.address' },
1553
- {
1554
- path: 'order.shippingInfo.logistics.shippingDestination.address',
1555
- },
1556
- { path: 'order.shippingInfo.logistics.pickupDetails.address' },
1557
- { path: 'order.recipientInfo.address' },
1558
- ],
1559
- },
1560
- ]))?.order;
1561
- }
1562
- catch (err) {
1563
- const transformedError = sdkTransformError(err, {
1564
- spreadPathsToArguments: { order: '$[1]' },
1565
- explicitPathsToArguments: { 'order.id': '$[0]' },
1566
- singleArgumentUnchanged: false,
1567
- }, ['_id', 'order']);
1568
- sideEffects?.onError?.(err);
1569
- throw transformedError;
1570
- }
1571
- }
1572
- /**
1573
- * Updates up to 100 orders.
1574
- *
1575
- *
1576
- * The `bulkUpdateOrders()` function returns a Promise that resolves when the specified orders' information is updated.
1577
- *
1578
- * Currently, the following fields can be updated:
1579
- * + `order.buyerInfo.email`
1580
- * + `order.buyerLanguage`
1581
- * + `order.weightUnit`
1582
- * + `order.billingInfo.address`
1583
- * + `order.billingInfo.contactDetails`
1584
- * + `order.archived`
1585
- * + `order.attributionSource`
1586
- * + `order.seenByAHuman`
1587
- * + `order.recipientInfo.address`
1588
- * + `order.recipientInfo.contactDetails`
1589
- * + `order.shippingInfo.logistics.shippingDestination.address`
1590
- * + `order.shippingInfo.logistics.shippingDestination.contactDetails`
1591
- *
1592
- * To update a field's value, include the new value in the `orders.order` object in the method parameters.
1593
- * To remove a field's value, pass `null`.
1594
- *
1595
- * > **Note:** Removing `buyerInfo` or `contactDetails` fields results in an error.
1596
- *
1597
- * To update an order's payment status, use [`updatePaymentStatus( )`](https://www.wix.com/velo/reference/wix-ecom-backend/ordertransactions/updatepaymentstatus).
1598
- * @param orders - Orders to update.
1599
- * @public
1600
- * @requiredField orders
1601
- * @requiredField orders.order
1602
- * @requiredField orders.order._id
1603
- * @permissionId ECOM.MODIFY_ORDERS
1604
- * @permissionScope Manage Stores - all permissions
1605
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
1606
- * @permissionScope Manage Stores
1607
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
1608
- * @permissionScope Manage Restaurants - all permissions
1609
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
1610
- * @permissionScope Manage eCommerce - all permissions
1611
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
1612
- * @permissionScope Manage Orders
1613
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
1614
- * @applicableIdentity APP
1615
- * @fqn com.wix.ecom.orders.v1.Orders.BulkUpdateOrders
1616
- */
1617
- export async function bulkUpdateOrders(orders, options) {
1618
- // @ts-ignore
1619
- const { httpClient, sideEffects } = arguments[2];
1620
- const payload = transformPaths(renameKeysFromSDKRequestToRESTRequest({
1621
- orders: orders,
1622
- returnEntity: options?.returnEntity,
1623
- }), [
1624
- {
1625
- transformFn: transformSDKImageToRESTImage,
1626
- paths: [{ path: 'orders.order.lineItems.image' }],
1627
- },
1628
- {
1629
- transformFn: transformSDKAddressToRESTAddress,
1630
- paths: [
1631
- { path: 'orders.order.billingInfo.address' },
1632
- {
1633
- path: 'orders.order.shippingInfo.logistics.shippingDestination.address',
1634
- },
1635
- { path: 'orders.order.shippingInfo.logistics.pickupDetails.address' },
1636
- { path: 'orders.order.recipientInfo.address' },
1637
- ],
1638
- },
1639
- ]);
1640
- const reqOpts = ambassadorWixEcomV1Order.bulkUpdateOrders(payload);
1641
- sideEffects?.onSiteCall?.();
1642
- try {
1643
- const result = await httpClient.request(reqOpts);
1644
- sideEffects?.onSuccess?.(result);
1645
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
1646
- {
1647
- transformFn: transformRESTImageToSDKImage,
1648
- paths: [{ path: 'results.item.lineItems.image' }],
1649
- },
1650
- {
1651
- transformFn: transformRESTAddressToSDKAddress,
1652
- paths: [
1653
- { path: 'results.item.billingInfo.address' },
1654
- {
1655
- path: 'results.item.shippingInfo.logistics.shippingDestination.address',
1656
- },
1657
- {
1658
- path: 'results.item.shippingInfo.logistics.pickupDetails.address',
1659
- },
1660
- { path: 'results.item.recipientInfo.address' },
1661
- ],
1662
- },
1663
- ]));
1664
- }
1665
- catch (err) {
1666
- const transformedError = sdkTransformError(err, {
1667
- spreadPathsToArguments: {},
1668
- explicitPathsToArguments: {
1669
- orders: '$[0]',
1670
- returnEntity: '$[1].returnEntity',
1671
- },
1672
- singleArgumentUnchanged: false,
1673
- }, ['orders', 'options']);
1674
- sideEffects?.onError?.(err);
1675
- throw transformedError;
1676
- }
1677
- }
1678
- /** @param _id - Order id to be updated
1679
- * @internal
1680
- * @documentationMaturity preview
1681
- * @requiredField _id
1682
- * @requiredField options.changes
1683
- * @requiredField options.changes.priceSummary.subtotal
1684
- * @requiredField options.changes.priceSummary.total
1685
- * @permissionId ECOM.ORDERS_DELTAS_COMMIT
1686
- * @permissionId ECOM.ORDER_WRITE_ALL_EXTENDED_FIELDS
1687
- * @permissionScope Manage Stores
1688
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
1689
- * @applicableIdentity APP
1690
- * @fqn com.wix.ecom.orders.v1.Orders.CommitDeltas
1691
- */
1692
- export async function commitDeltas(_id, options) {
1693
- // @ts-ignore
1694
- const { httpClient, sideEffects } = arguments[2];
1695
- const payload = transformPaths(renameKeysFromSDKRequestToRESTRequest({
1696
- id: _id,
1697
- draftOrderId: options?.draftOrderId,
1698
- changes: options?.changes,
1699
- commitSettings: options?.commitSettings,
1700
- reason: options?.reason,
1701
- }), [
1702
- {
1703
- transformFn: transformSDKAddressToRESTAddress,
1704
- paths: [
1705
- {
1706
- path: 'changes.changedShippingInfo.logistics.shippingDestination.address',
1707
- },
1708
- {
1709
- path: 'changes.changedShippingInfo.logistics.pickupDetails.address',
1710
- },
1711
- { path: 'changes.changedBillingInfo.address' },
1712
- { path: 'changes.changedRecipientInfo.address' },
1713
- ],
1714
- },
1715
- {
1716
- transformFn: transformSDKImageToRESTImage,
1717
- paths: [{ path: 'changes.lineItems.lineItem.image' }],
1718
- },
1719
- ]);
1720
- const reqOpts = ambassadorWixEcomV1Order.commitDeltas(payload);
1721
- sideEffects?.onSiteCall?.();
1722
- try {
1723
- const result = await httpClient.request(reqOpts);
1724
- sideEffects?.onSuccess?.(result);
1725
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
1726
- {
1727
- transformFn: transformRESTImageToSDKImage,
1728
- paths: [{ path: 'order.lineItems.image' }],
1729
- },
1730
- {
1731
- transformFn: transformRESTAddressToSDKAddress,
1732
- paths: [
1733
- { path: 'order.billingInfo.address' },
1734
- {
1735
- path: 'order.shippingInfo.logistics.shippingDestination.address',
1736
- },
1737
- { path: 'order.shippingInfo.logistics.pickupDetails.address' },
1738
- { path: 'order.recipientInfo.address' },
1739
- ],
1740
- },
1741
- ]));
1742
- }
1743
- catch (err) {
1744
- const transformedError = sdkTransformError(err, {
1745
- spreadPathsToArguments: {},
1746
- explicitPathsToArguments: {
1747
- id: '$[0]',
1748
- draftOrderId: '$[1].draftOrderId',
1749
- changes: '$[1].changes',
1750
- commitSettings: '$[1].commitSettings',
1751
- reason: '$[1].reason',
1752
- },
1753
- singleArgumentUnchanged: false,
1754
- }, ['_id', 'options']);
1755
- sideEffects?.onError?.(err);
1756
- throw transformedError;
1757
- }
1758
- }
1759
- /** @internal
1760
- * @documentationMaturity preview
1761
- * @requiredField identifiers
1762
- * @requiredField identifiers._id
1763
- * @requiredField identifiers.lineItemId
1764
- * @requiredField lineItem
1765
- * @permissionId ECOM.MODIFY_ORDERS
1766
- * @permissionScope Manage Stores - all permissions
1767
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
1768
- * @permissionScope Manage Stores
1769
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
1770
- * @permissionScope Manage Restaurants - all permissions
1771
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
1772
- * @permissionScope Manage eCommerce - all permissions
1773
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
1774
- * @permissionScope Manage Orders
1775
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
1776
- * @applicableIdentity APP
1777
- * @fqn com.wix.ecom.orders.v1.Orders.UpdateOrderLineItem
1778
- * @deprecated
1779
- * @targetRemovalDate 2024-02-15
1780
- */
1781
- export async function updateOrderLineItem(identifiers, lineItem) {
1782
- // @ts-ignore
1783
- const { httpClient, sideEffects } = arguments[2];
1784
- const payload = transformPaths(renameKeysFromSDKRequestToRESTRequest({
1785
- id: identifiers?._id,
1786
- lineItem: { ...lineItem, id: identifiers?.lineItemId },
1787
- }), [
1788
- {
1789
- transformFn: transformSDKImageToRESTImage,
1790
- paths: [{ path: 'lineItem.image' }],
1791
- },
1792
- ]);
1793
- const reqOpts = ambassadorWixEcomV1Order.updateOrderLineItem(payload);
1794
- sideEffects?.onSiteCall?.();
1795
- try {
1796
- const result = await httpClient.request(reqOpts);
1797
- sideEffects?.onSuccess?.(result);
1798
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
1799
- {
1800
- transformFn: transformRESTImageToSDKImage,
1801
- paths: [{ path: 'order.lineItems.image' }],
1802
- },
1803
- {
1804
- transformFn: transformRESTAddressToSDKAddress,
1805
- paths: [
1806
- { path: 'order.billingInfo.address' },
1807
- {
1808
- path: 'order.shippingInfo.logistics.shippingDestination.address',
1809
- },
1810
- { path: 'order.shippingInfo.logistics.pickupDetails.address' },
1811
- { path: 'order.recipientInfo.address' },
1812
- ],
1813
- },
1814
- ]));
1815
- }
1816
- catch (err) {
1817
- const transformedError = sdkTransformError(err, {
1818
- spreadPathsToArguments: { lineItem: '$[1]' },
1819
- explicitPathsToArguments: {
1820
- id: '$[0]._id',
1821
- 'lineItem.id': '$[0].lineItemId',
1822
- },
1823
- singleArgumentUnchanged: false,
1824
- }, ['identifiers', 'lineItem']);
1825
- sideEffects?.onError?.(err);
1826
- throw transformedError;
1827
- }
1828
- }
1829
- /**
1830
- * Adds a merchant comment to an order.
1831
- * > **Note:** Activities with type CustomActivity not supported
1832
- * @param _id - Order ID.
1833
- * @param activity - Activity info.
1834
- * @internal
1835
- * @documentationMaturity preview
1836
- * @requiredField _id
1837
- * @requiredField activity
1838
- * @permissionId ECOM.MODIFY_ORDERS
1839
- * @permissionScope Manage Stores - all permissions
1840
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
1841
- * @permissionScope Manage Stores
1842
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
1843
- * @permissionScope Manage Restaurants - all permissions
1844
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
1845
- * @permissionScope Manage eCommerce - all permissions
1846
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
1847
- * @permissionScope Manage Orders
1848
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
1849
- * @applicableIdentity APP
1850
- * @fqn com.wix.ecom.orders.v1.Orders.AddActivity
1851
- * @deprecated
1852
- * @replacedBy com.wix.ecom.orders.v1.OrdersService.AddActivities
1853
- * @targetRemovalDate 2024-11-01
1854
- */
1855
- export async function addActivity(_id, activity) {
1856
- // @ts-ignore
1857
- const { httpClient, sideEffects } = arguments[2];
1858
- const payload = renameKeysFromSDKRequestToRESTRequest({
1859
- id: _id,
1860
- activity: activity,
1861
- });
1862
- const reqOpts = ambassadorWixEcomV1Order.addActivity(payload);
1863
- sideEffects?.onSiteCall?.();
1864
- try {
1865
- const result = await httpClient.request(reqOpts);
1866
- sideEffects?.onSuccess?.(result);
1867
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
1868
- {
1869
- transformFn: transformRESTImageToSDKImage,
1870
- paths: [{ path: 'order.lineItems.image' }],
1871
- },
1872
- {
1873
- transformFn: transformRESTAddressToSDKAddress,
1874
- paths: [
1875
- { path: 'order.billingInfo.address' },
1876
- {
1877
- path: 'order.shippingInfo.logistics.shippingDestination.address',
1878
- },
1879
- { path: 'order.shippingInfo.logistics.pickupDetails.address' },
1880
- { path: 'order.recipientInfo.address' },
1881
- ],
1882
- },
1883
- ]));
1884
- }
1885
- catch (err) {
1886
- const transformedError = sdkTransformError(err, {
1887
- spreadPathsToArguments: {},
1888
- explicitPathsToArguments: { id: '$[0]', activity: '$[1]' },
1889
- singleArgumentUnchanged: false,
1890
- }, ['_id', 'activity']);
1891
- sideEffects?.onError?.(err);
1892
- throw transformedError;
1893
- }
1894
- }
1895
- /**
1896
- * Updates an order's activity.
1897
- * @param activity - Activity info.
1898
- * @internal
1899
- * @documentationMaturity preview
1900
- * @requiredField activity
1901
- * @requiredField identifiers
1902
- * @requiredField identifiers._id
1903
- * @requiredField identifiers.activityId
1904
- * @permissionId ECOM.MODIFY_ORDERS
1905
- * @permissionScope Manage Stores - all permissions
1906
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
1907
- * @permissionScope Manage Stores
1908
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
1909
- * @permissionScope Manage Restaurants - all permissions
1910
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
1911
- * @permissionScope Manage eCommerce - all permissions
1912
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
1913
- * @permissionScope Manage Orders
1914
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
1915
- * @applicableIdentity APP
1916
- * @fqn com.wix.ecom.orders.v1.Orders.UpdateActivity
1917
- */
1918
- export async function updateActivity(identifiers, activity) {
1919
- // @ts-ignore
1920
- const { httpClient, sideEffects } = arguments[2];
1921
- const payload = renameKeysFromSDKRequestToRESTRequest({
1922
- id: identifiers?._id,
1923
- activityId: identifiers?.activityId,
1924
- activity: activity,
1925
- });
1926
- const reqOpts = ambassadorWixEcomV1Order.updateActivity(payload);
1927
- sideEffects?.onSiteCall?.();
1928
- try {
1929
- const result = await httpClient.request(reqOpts);
1930
- sideEffects?.onSuccess?.(result);
1931
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
1932
- {
1933
- transformFn: transformRESTImageToSDKImage,
1934
- paths: [{ path: 'order.lineItems.image' }],
1935
- },
1936
- {
1937
- transformFn: transformRESTAddressToSDKAddress,
1938
- paths: [
1939
- { path: 'order.billingInfo.address' },
1940
- {
1941
- path: 'order.shippingInfo.logistics.shippingDestination.address',
1942
- },
1943
- { path: 'order.shippingInfo.logistics.pickupDetails.address' },
1944
- { path: 'order.recipientInfo.address' },
1945
- ],
1946
- },
1947
- ]));
1948
- }
1949
- catch (err) {
1950
- const transformedError = sdkTransformError(err, {
1951
- spreadPathsToArguments: {},
1952
- explicitPathsToArguments: {
1953
- id: '$[0]._id',
1954
- activityId: '$[0].activityId',
1955
- activity: '$[1]',
1956
- },
1957
- singleArgumentUnchanged: false,
1958
- }, ['identifiers', 'activity']);
1959
- sideEffects?.onError?.(err);
1960
- throw transformedError;
1961
- }
1962
- }
1963
- /**
1964
- * Delete's an order's activity.
1965
- *
1966
- * Only custom activities and merchant comments can be deleted.
1967
- * @internal
1968
- * @documentationMaturity preview
1969
- * @requiredField identifiers
1970
- * @requiredField identifiers._id
1971
- * @requiredField identifiers.activityId
1972
- * @permissionId ECOM.MODIFY_ORDERS
1973
- * @permissionScope Manage Stores - all permissions
1974
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
1975
- * @permissionScope Manage Stores
1976
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
1977
- * @permissionScope Manage Restaurants - all permissions
1978
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
1979
- * @permissionScope Manage eCommerce - all permissions
1980
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
1981
- * @permissionScope Manage Orders
1982
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
1983
- * @applicableIdentity APP
1984
- * @fqn com.wix.ecom.orders.v1.Orders.DeleteActivity
1985
- */
1986
- export async function deleteActivity(identifiers) {
1987
- // @ts-ignore
1988
- const { httpClient, sideEffects } = arguments[1];
1989
- const payload = renameKeysFromSDKRequestToRESTRequest({
1990
- id: identifiers?._id,
1991
- activityId: identifiers?.activityId,
1992
- });
1993
- const reqOpts = ambassadorWixEcomV1Order.deleteActivity(payload);
1994
- sideEffects?.onSiteCall?.();
1995
- try {
1996
- const result = await httpClient.request(reqOpts);
1997
- sideEffects?.onSuccess?.(result);
1998
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
1999
- {
2000
- transformFn: transformRESTImageToSDKImage,
2001
- paths: [{ path: 'order.lineItems.image' }],
2002
- },
2003
- {
2004
- transformFn: transformRESTAddressToSDKAddress,
2005
- paths: [
2006
- { path: 'order.billingInfo.address' },
2007
- {
2008
- path: 'order.shippingInfo.logistics.shippingDestination.address',
2009
- },
2010
- { path: 'order.shippingInfo.logistics.pickupDetails.address' },
2011
- { path: 'order.recipientInfo.address' },
2012
- ],
2013
- },
2014
- ]));
2015
- }
2016
- catch (err) {
2017
- const transformedError = sdkTransformError(err, {
2018
- spreadPathsToArguments: {},
2019
- explicitPathsToArguments: {
2020
- id: '$[0]._id',
2021
- activityId: '$[0].activityId',
2022
- },
2023
- singleArgumentUnchanged: false,
2024
- }, ['identifiers']);
2025
- sideEffects?.onError?.(err);
2026
- throw transformedError;
2027
- }
2028
- }
2029
- /**
2030
- * Cancels an order.
2031
- *
2032
- *
2033
- * The `cancelOrder()` function returns a Promise that resolves when the specified order is canceled and the `order.status` field changes to `CANCELED`.
2034
- * @param _id - Order ID.
2035
- * @public
2036
- * @requiredField _id
2037
- * @permissionId ECOM.MODIFY_ORDERS
2038
- * @permissionScope Manage Stores - all permissions
2039
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
2040
- * @permissionScope Manage Stores
2041
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
2042
- * @permissionScope Manage Restaurants - all permissions
2043
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
2044
- * @permissionScope Manage eCommerce - all permissions
2045
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
2046
- * @permissionScope Manage Orders
2047
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
2048
- * @applicableIdentity APP
2049
- * @fqn com.wix.ecom.orders.v1.Orders.CancelOrder
2050
- */
2051
- export async function cancelOrder(_id, options) {
2052
- // @ts-ignore
2053
- const { httpClient, sideEffects } = arguments[2];
2054
- const payload = renameKeysFromSDKRequestToRESTRequest({
2055
- id: _id,
2056
- sendOrderCanceledEmail: options?.sendOrderCanceledEmail,
2057
- customMessage: options?.customMessage,
2058
- restockAllItems: options?.restockAllItems,
2059
- });
2060
- const reqOpts = ambassadorWixEcomV1Order.cancelOrder(payload);
2061
- sideEffects?.onSiteCall?.();
2062
- try {
2063
- const result = await httpClient.request(reqOpts);
2064
- sideEffects?.onSuccess?.(result);
2065
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
2066
- {
2067
- transformFn: transformRESTImageToSDKImage,
2068
- paths: [{ path: 'order.lineItems.image' }],
2069
- },
2070
- {
2071
- transformFn: transformRESTAddressToSDKAddress,
2072
- paths: [
2073
- { path: 'order.billingInfo.address' },
2074
- {
2075
- path: 'order.shippingInfo.logistics.shippingDestination.address',
2076
- },
2077
- { path: 'order.shippingInfo.logistics.pickupDetails.address' },
2078
- { path: 'order.recipientInfo.address' },
2079
- ],
2080
- },
2081
- ]));
2082
- }
2083
- catch (err) {
2084
- const transformedError = sdkTransformError(err, {
2085
- spreadPathsToArguments: {},
2086
- explicitPathsToArguments: {
2087
- id: '$[0]',
2088
- sendOrderCanceledEmail: '$[1].sendOrderCanceledEmail',
2089
- customMessage: '$[1].customMessage',
2090
- restockAllItems: '$[1].restockAllItems',
2091
- },
2092
- singleArgumentUnchanged: false,
2093
- }, ['_id', 'options']);
2094
- sideEffects?.onError?.(err);
2095
- throw transformedError;
2096
- }
2097
- }
2098
- /**
2099
- * Updates order status.
2100
- *
2101
- * >CANCELED and REJECTED are final statuses. Update from either of those will fail.
2102
- * >Updates into INITIALIZED are not supported.
2103
- *
2104
- * Approving order:
2105
- * APPROVED status can be set while order has one of [INITIALIZED, PENDING] statuses.
2106
- *
2107
- * Approving an order which was created with CreateOrderRequest.settings.order_approval_strategy = PAYMENT_METHOD_SAVED
2108
- * will cause an error.
2109
- *
2110
- * Setting PENDING status:
2111
- * Only orders in INITIALIZED status can be updated into PENDING.
2112
- * @param orderId - Order ID.
2113
- * @param status - New order status.
2114
- * @internal
2115
- * @documentationMaturity preview
2116
- * @requiredField orderId
2117
- * @requiredField status
2118
- * @permissionId ECOM.ORDER_UPDATE_STATUS
2119
- * @permissionScope Manage Stores - all permissions
2120
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
2121
- * @permissionScope Manage Stores
2122
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
2123
- * @permissionScope Manage Restaurants - all permissions
2124
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
2125
- * @permissionScope Manage eCommerce - all permissions
2126
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
2127
- * @permissionScope Manage Orders
2128
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
2129
- * @applicableIdentity APP
2130
- * @fqn com.wix.ecom.orders.v1.Orders.UpdateOrderStatus
2131
- */
2132
- export async function updateOrderStatus(orderId, status) {
2133
- // @ts-ignore
2134
- const { httpClient, sideEffects } = arguments[2];
2135
- const payload = renameKeysFromSDKRequestToRESTRequest({
2136
- orderId: orderId,
2137
- status: status,
2138
- });
2139
- const reqOpts = ambassadorWixEcomV1Order.updateOrderStatus(payload);
2140
- sideEffects?.onSiteCall?.();
2141
- try {
2142
- const result = await httpClient.request(reqOpts);
2143
- sideEffects?.onSuccess?.(result);
2144
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
2145
- {
2146
- transformFn: transformRESTImageToSDKImage,
2147
- paths: [{ path: 'order.lineItems.image' }],
2148
- },
2149
- {
2150
- transformFn: transformRESTAddressToSDKAddress,
2151
- paths: [
2152
- { path: 'order.billingInfo.address' },
2153
- {
2154
- path: 'order.shippingInfo.logistics.shippingDestination.address',
2155
- },
2156
- { path: 'order.shippingInfo.logistics.pickupDetails.address' },
2157
- { path: 'order.recipientInfo.address' },
2158
- ],
2159
- },
2160
- ]));
2161
- }
2162
- catch (err) {
2163
- const transformedError = sdkTransformError(err, {
2164
- spreadPathsToArguments: {},
2165
- explicitPathsToArguments: { orderId: '$[0]', status: '$[1]' },
2166
- singleArgumentUnchanged: false,
2167
- }, ['orderId', 'status']);
2168
- sideEffects?.onError?.(err);
2169
- throw transformedError;
2170
- }
2171
- }
2172
- /** @internal
2173
- * @documentationMaturity preview
2174
- * @requiredField options.aggregation
2175
- * @permissionId ECOM.READ_ORDERS
2176
- * @permissionScope Manage Stores - all permissions
2177
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
2178
- * @permissionScope Manage Stores
2179
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
2180
- * @permissionScope Read eCommerce - all read permissions
2181
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.READ-ECOM
2182
- * @permissionScope Read Orders
2183
- * @permissionScopeId SCOPE.DC-STORES.READ-ORDERS
2184
- * @permissionScope Read Stores - all read permissions
2185
- * @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
2186
- * @permissionScope Manage Restaurants - all permissions
2187
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
2188
- * @permissionScope Manage eCommerce - all permissions
2189
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
2190
- * @permissionScope Manage Orders
2191
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
2192
- * @applicableIdentity APP
2193
- * @fqn com.wix.ecom.orders.v1.Orders.AggregateOrders
2194
- */
2195
- export async function aggregateOrders(options) {
2196
- // @ts-ignore
2197
- const { httpClient, sideEffects } = arguments[1];
2198
- const payload = renameKeysFromSDKRequestToRESTRequest({
2199
- filter: options?.filter,
2200
- aggregation: options?.aggregation,
2201
- hierarchySeparatorOverride: options?.hierarchySeparatorOverride,
2202
- });
2203
- const reqOpts = ambassadorWixEcomV1Order.aggregateOrders(payload);
2204
- sideEffects?.onSiteCall?.();
2205
- try {
2206
- const result = await httpClient.request(reqOpts);
2207
- sideEffects?.onSuccess?.(result);
2208
- return renameKeysFromRESTResponseToSDKResponse(result.data);
2209
- }
2210
- catch (err) {
2211
- const transformedError = sdkTransformError(err, {
2212
- spreadPathsToArguments: {},
2213
- explicitPathsToArguments: {
2214
- filter: '$[0].filter',
2215
- aggregation: '$[0].aggregation',
2216
- hierarchySeparatorOverride: '$[0].hierarchySeparatorOverride',
2217
- },
2218
- singleArgumentUnchanged: false,
2219
- }, ['options']);
2220
- sideEffects?.onError?.(err);
2221
- throw transformedError;
2222
- }
2223
- }
2224
- /**
2225
- * Synchronously update tags on multiple orders, by list of order IDs.
2226
- *
2227
- * > **Note:** If the same tag is passed to both the `assignTags` and `unassignTags` fields, it will be assigned.
2228
- * @param orderIds - IDs of orders to update tags for.
2229
- * @public
2230
- * @requiredField orderIds
2231
- * @permissionId ECOM.MODIFY_ORDERS
2232
- * @permissionId ECOM.ORDER_MODIFY_PRIVATE_TAGS
2233
- * @permissionScope Manage Stores - all permissions
2234
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
2235
- * @permissionScope Manage Stores
2236
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
2237
- * @permissionScope Manage Restaurants - all permissions
2238
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
2239
- * @permissionScope Manage eCommerce - all permissions
2240
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
2241
- * @permissionScope Manage Orders
2242
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
2243
- * @permissionScope Manage Stores - all permissions
2244
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
2245
- * @permissionScope Manage Stores
2246
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
2247
- * @permissionScope Manage Restaurants - all permissions
2248
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
2249
- * @permissionScope Manage eCommerce - all permissions
2250
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
2251
- * @permissionScope Manage Orders
2252
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
2253
- * @applicableIdentity APP
2254
- * @fqn com.wix.ecom.orders.v1.Orders.BulkUpdateOrderTags
2255
- */
2256
- export async function bulkUpdateOrderTags(orderIds, options) {
2257
- // @ts-ignore
2258
- const { httpClient, sideEffects } = arguments[2];
2259
- const payload = renameKeysFromSDKRequestToRESTRequest({
2260
- orderIds: orderIds,
2261
- assignTags: options?.assignTags,
2262
- unassignTags: options?.unassignTags,
2263
- });
2264
- const reqOpts = ambassadorWixEcomV1Order.bulkUpdateOrderTags(payload);
2265
- sideEffects?.onSiteCall?.();
2266
- try {
2267
- const result = await httpClient.request(reqOpts);
2268
- sideEffects?.onSuccess?.(result);
2269
- return renameKeysFromRESTResponseToSDKResponse(result.data);
2270
- }
2271
- catch (err) {
2272
- const transformedError = sdkTransformError(err, {
2273
- spreadPathsToArguments: {},
2274
- explicitPathsToArguments: {
2275
- orderIds: '$[0]',
2276
- assignTags: '$[1].assignTags',
2277
- unassignTags: '$[1].unassignTags',
2278
- },
2279
- singleArgumentUnchanged: false,
2280
- }, ['orderIds', 'options']);
2281
- sideEffects?.onError?.(err);
2282
- throw transformedError;
2283
- }
2284
- }
2285
- //# sourceMappingURL=ecom-v1-order-orders.universal.js.map