@wix/auto_sdk_ecom_orders 1.0.34 → 1.0.36

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