@wix/pricing-plans 1.0.54 → 1.0.56
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.
- package/build/cjs/context.d.ts +2 -2
- package/build/cjs/context.js +2 -2
- package/build/cjs/context.js.map +1 -1
- package/build/cjs/index.d.ts +2 -2
- package/build/cjs/index.js +2 -2
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/meta.d.ts +2 -2
- package/build/cjs/meta.js +2 -2
- package/build/cjs/meta.js.map +1 -1
- package/build/es/context.d.ts +2 -2
- package/build/es/context.js +2 -2
- package/build/es/context.js.map +1 -1
- package/build/es/index.d.ts +2 -2
- package/build/es/index.js +2 -2
- package/build/es/index.js.map +1 -1
- package/build/es/meta.d.ts +2 -2
- package/build/es/meta.js +2 -2
- package/build/es/meta.js.map +1 -1
- package/package.json +12 -9
- package/build/cjs/index.typings.d.ts +0 -2
- package/build/cjs/index.typings.js +0 -29
- package/build/cjs/index.typings.js.map +0 -1
- package/build/cjs/src/pricing-plans-v2-order.context.d.ts +0 -15
- package/build/cjs/src/pricing-plans-v2-order.context.js +0 -148
- package/build/cjs/src/pricing-plans-v2-order.context.js.map +0 -1
- package/build/cjs/src/pricing-plans-v2-order.http.d.ts +0 -165
- package/build/cjs/src/pricing-plans-v2-order.http.js +0 -818
- package/build/cjs/src/pricing-plans-v2-order.http.js.map +0 -1
- package/build/cjs/src/pricing-plans-v2-order.meta.d.ts +0 -41
- package/build/cjs/src/pricing-plans-v2-order.meta.js +0 -275
- package/build/cjs/src/pricing-plans-v2-order.meta.js.map +0 -1
- package/build/cjs/src/pricing-plans-v2-order.public.d.ts +0 -104
- package/build/cjs/src/pricing-plans-v2-order.public.js +0 -110
- package/build/cjs/src/pricing-plans-v2-order.public.js.map +0 -1
- package/build/cjs/src/pricing-plans-v2-order.types.d.ts +0 -1801
- package/build/cjs/src/pricing-plans-v2-order.types.js +0 -135
- package/build/cjs/src/pricing-plans-v2-order.types.js.map +0 -1
- package/build/cjs/src/pricing-plans-v2-order.universal.d.ts +0 -2225
- package/build/cjs/src/pricing-plans-v2-order.universal.js +0 -1151
- package/build/cjs/src/pricing-plans-v2-order.universal.js.map +0 -1
- package/build/cjs/src/pricing-plans-v2-plan.context.d.ts +0 -14
- package/build/cjs/src/pricing-plans-v2-plan.context.js +0 -137
- package/build/cjs/src/pricing-plans-v2-plan.context.js.map +0 -1
- package/build/cjs/src/pricing-plans-v2-plan.http.d.ts +0 -134
- package/build/cjs/src/pricing-plans-v2-plan.http.js +0 -544
- package/build/cjs/src/pricing-plans-v2-plan.http.js.map +0 -1
- package/build/cjs/src/pricing-plans-v2-plan.meta.d.ts +0 -34
- package/build/cjs/src/pricing-plans-v2-plan.meta.js +0 -256
- package/build/cjs/src/pricing-plans-v2-plan.meta.js.map +0 -1
- package/build/cjs/src/pricing-plans-v2-plan.public.d.ts +0 -86
- package/build/cjs/src/pricing-plans-v2-plan.public.js +0 -89
- package/build/cjs/src/pricing-plans-v2-plan.public.js.map +0 -1
- package/build/cjs/src/pricing-plans-v2-plan.types.d.ts +0 -732
- package/build/cjs/src/pricing-plans-v2-plan.types.js +0 -41
- package/build/cjs/src/pricing-plans-v2-plan.types.js.map +0 -1
- package/build/cjs/src/pricing-plans-v2-plan.universal.d.ts +0 -1176
- package/build/cjs/src/pricing-plans-v2-plan.universal.js +0 -913
- package/build/cjs/src/pricing-plans-v2-plan.universal.js.map +0 -1
- package/build/es/index.typings.d.ts +0 -2
- package/build/es/index.typings.js +0 -3
- package/build/es/index.typings.js.map +0 -1
- package/build/es/src/pricing-plans-v2-order.context.d.ts +0 -15
- package/build/es/src/pricing-plans-v2-order.context.js +0 -132
- package/build/es/src/pricing-plans-v2-order.context.js.map +0 -1
- package/build/es/src/pricing-plans-v2-order.http.d.ts +0 -165
- package/build/es/src/pricing-plans-v2-order.http.js +0 -802
- package/build/es/src/pricing-plans-v2-order.http.js.map +0 -1
- package/build/es/src/pricing-plans-v2-order.meta.d.ts +0 -41
- package/build/es/src/pricing-plans-v2-order.meta.js +0 -236
- package/build/es/src/pricing-plans-v2-order.meta.js.map +0 -1
- package/build/es/src/pricing-plans-v2-order.public.d.ts +0 -104
- package/build/es/src/pricing-plans-v2-order.public.js +0 -70
- package/build/es/src/pricing-plans-v2-order.public.js.map +0 -1
- package/build/es/src/pricing-plans-v2-order.types.d.ts +0 -1801
- package/build/es/src/pricing-plans-v2-order.types.js +0 -132
- package/build/es/src/pricing-plans-v2-order.types.js.map +0 -1
- package/build/es/src/pricing-plans-v2-order.universal.d.ts +0 -2225
- package/build/es/src/pricing-plans-v2-order.universal.js +0 -1112
- package/build/es/src/pricing-plans-v2-order.universal.js.map +0 -1
- package/build/es/src/pricing-plans-v2-plan.context.d.ts +0 -14
- package/build/es/src/pricing-plans-v2-plan.context.js +0 -122
- package/build/es/src/pricing-plans-v2-plan.context.js.map +0 -1
- package/build/es/src/pricing-plans-v2-plan.http.d.ts +0 -134
- package/build/es/src/pricing-plans-v2-plan.http.js +0 -529
- package/build/es/src/pricing-plans-v2-plan.http.js.map +0 -1
- package/build/es/src/pricing-plans-v2-plan.meta.d.ts +0 -34
- package/build/es/src/pricing-plans-v2-plan.meta.js +0 -218
- package/build/es/src/pricing-plans-v2-plan.meta.js.map +0 -1
- package/build/es/src/pricing-plans-v2-plan.public.d.ts +0 -86
- package/build/es/src/pricing-plans-v2-plan.public.js +0 -65
- package/build/es/src/pricing-plans-v2-plan.public.js.map +0 -1
- package/build/es/src/pricing-plans-v2-plan.types.d.ts +0 -732
- package/build/es/src/pricing-plans-v2-plan.types.js +0 -38
- package/build/es/src/pricing-plans-v2-plan.types.js.map +0 -1
- package/build/es/src/pricing-plans-v2-plan.universal.d.ts +0 -1176
- package/build/es/src/pricing-plans-v2-plan.universal.js +0 -875
- package/build/es/src/pricing-plans-v2-plan.universal.js.map +0 -1
@@ -1,2225 +0,0 @@
|
|
1
|
-
import { EventDefinition } from '@wix/sdk-types';
|
2
|
-
/**
|
3
|
-
* An order object includes all of the details related to the purchase of a Pricing Plan.
|
4
|
-
* You can manage existing orders, create offline orders, and preview orders not yet purchased.
|
5
|
-
*
|
6
|
-
* Orders are based on pricing models based on the payment and duration cycles for each plan. See here to
|
7
|
-
* [learn more about pricing models](https://dev.wix.com/api/rest/wix-pricing-plans/pricing-plans/introduction#wix-pricing-plans_pricing-plans_introduction_pricing-models).
|
8
|
-
*/
|
9
|
-
export interface Order {
|
10
|
-
/**
|
11
|
-
* Order ID.
|
12
|
-
* @readonly
|
13
|
-
*/
|
14
|
-
_id?: string;
|
15
|
-
/**
|
16
|
-
* ID of the plan purchased with the order.
|
17
|
-
* @readonly
|
18
|
-
*/
|
19
|
-
planId?: string;
|
20
|
-
/**
|
21
|
-
* ID of the related Wix subscription.
|
22
|
-
*
|
23
|
-
* Every pricing plan order corresponds to a Wix subscription, including orders for single payment plans. See a [Pricing Plans overview](https://support.wix.com/en/article/pricing-plans-an-overview#create-plans-to-suit-your-business).
|
24
|
-
* @readonly
|
25
|
-
*/
|
26
|
-
subscriptionId?: string;
|
27
|
-
/**
|
28
|
-
* Wix Pay order ID.
|
29
|
-
*
|
30
|
-
* Provided by Wix whether the order is created online or offline. The field is omitted when the order is free.
|
31
|
-
* @readonly
|
32
|
-
*/
|
33
|
-
wixPayOrderId?: string | null;
|
34
|
-
/**
|
35
|
-
* The buyer's IDs. Includes `memberId` and `contactId`.
|
36
|
-
*
|
37
|
-
* Currently, Pricing Plan purchases are limited to members only. `contactId` is returned,
|
38
|
-
* but a buyer will not be able to purchase a plan without a `memberId`.
|
39
|
-
* @readonly
|
40
|
-
*/
|
41
|
-
buyer?: Buyer;
|
42
|
-
/**
|
43
|
-
* @internal
|
44
|
-
* @internal
|
45
|
-
* @readonly
|
46
|
-
*/
|
47
|
-
priceDetails?: PriceDetails;
|
48
|
-
/**
|
49
|
-
* Pricing model, price, and payment schedule for the order.
|
50
|
-
* @readonly
|
51
|
-
*/
|
52
|
-
pricing?: PricingDetails;
|
53
|
-
/**
|
54
|
-
* How the order was processed. Supported values:
|
55
|
-
* + `"ONLINE"`: The buyer purchased the plan using the site.
|
56
|
-
* + `"OFFLINE"`: The buyer made a manual, offline purchase without using the site.
|
57
|
-
* @readonly
|
58
|
-
*/
|
59
|
-
type?: OrderType;
|
60
|
-
/**
|
61
|
-
* Status of the order. Supported values:
|
62
|
-
* + `DRAFT`: Order has been initiated but payment hasn't been processed yet. The plan isn't yet available for use to the buyer.
|
63
|
-
* + `PENDING`: Order has been purchased and its start date is set in the future.
|
64
|
-
* + `ACTIVE`: Order has been processed. The plan is available for use.
|
65
|
-
* + `PAUSED`: Order, and use of the plan, is [paused](#pauseorder). The order, and use of the plan, can be [resumed](#resumeorder).
|
66
|
-
* + `ENDED`: Order has completed its duration and is no longer available for use.
|
67
|
-
* + `CANCELED`: Order has been [canceled](#cancelorder).
|
68
|
-
* @readonly
|
69
|
-
*/
|
70
|
-
status?: OrderStatus;
|
71
|
-
/**
|
72
|
-
* Whether the order will be canceled at the next payment date.
|
73
|
-
*
|
74
|
-
* If `true`, the order status will be `CANCELED` and the next payment won't be charged. Omitted for single payment orders.
|
75
|
-
* @readonly
|
76
|
-
*/
|
77
|
-
autoRenewCanceled?: boolean | null;
|
78
|
-
/**
|
79
|
-
* Details about the cancellation of an order.
|
80
|
-
*
|
81
|
-
*
|
82
|
-
* @readonly
|
83
|
-
*/
|
84
|
-
cancellation?: Cancellation;
|
85
|
-
/**
|
86
|
-
* Status of the last payment for the order.
|
87
|
-
* Updated automatically for online orders. Updated manually by the site owner for offline orders.
|
88
|
-
*
|
89
|
-
* Supported values:
|
90
|
-
* + `PAID`: The last payment was paid.
|
91
|
-
* + `REFUNDED`: The last payment was refunded.
|
92
|
-
* + `FAILED`: The last payment transaction didn't complete.
|
93
|
-
* + `UNPAID`: The last payment wasn't paid.
|
94
|
-
* + `PENDING`: Awaiting payment.
|
95
|
-
* + `NOT_APPLICABLE`: No payment was necessary. For example, for free plans or free trials.
|
96
|
-
* @readonly
|
97
|
-
*/
|
98
|
-
lastPaymentStatus?: PaymentStatus;
|
99
|
-
/**
|
100
|
-
* Start date and time for the ordered plan.
|
101
|
-
* @readonly
|
102
|
-
*/
|
103
|
-
startDate?: Date;
|
104
|
-
/**
|
105
|
-
* Current end date and time for the ordered plan.
|
106
|
-
*
|
107
|
-
* `endDate` may be updated over the course of an order. If the order is [paused](#pauseorder),
|
108
|
-
* it will have a later `endDate` once it [resumes](#resumeorder). `endDate` may also be [postponed](#postponeenddate).
|
109
|
-
*
|
110
|
-
* Omitted if the order is valid until canceled and still `ACTIVE`.
|
111
|
-
* @readonly
|
112
|
-
*/
|
113
|
-
endDate?: Date;
|
114
|
-
/**
|
115
|
-
* List of periods during which the order is paused.
|
116
|
-
* @readonly
|
117
|
-
*/
|
118
|
-
pausePeriods?: PausePeriod[];
|
119
|
-
/**
|
120
|
-
* Free trial period for the order, in days.
|
121
|
-
*
|
122
|
-
* Only available for recurring plans.
|
123
|
-
* @readonly
|
124
|
-
*/
|
125
|
-
freeTrialDays?: number | null;
|
126
|
-
/**
|
127
|
-
* Earliest end date and time that the plan for the order can expire.
|
128
|
-
*
|
129
|
-
* Calculated by using the original end date plus any pause periods. Omitted if the order is active until canceled. Reserved for future use.
|
130
|
-
* @readonly
|
131
|
-
*/
|
132
|
-
earliestEndDate?: Date;
|
133
|
-
/**
|
134
|
-
* Current payment cycle for the order.
|
135
|
-
*
|
136
|
-
* `currentCycle` will be omitted if the order's status is `CANCELED` or `ENDED`, or if the `startDate` hasn't passed yet.
|
137
|
-
* @readonly
|
138
|
-
*/
|
139
|
-
currentCycle?: CurrentCycle;
|
140
|
-
/**
|
141
|
-
* Plan name at the time of purchase.
|
142
|
-
* @readonly
|
143
|
-
*/
|
144
|
-
planName?: string;
|
145
|
-
/**
|
146
|
-
* Plan description at the time of purchase
|
147
|
-
* @readonly
|
148
|
-
*/
|
149
|
-
planDescription?: string;
|
150
|
-
/**
|
151
|
-
* Plan price as it was at the moment of order creation.
|
152
|
-
* @readonly
|
153
|
-
*/
|
154
|
-
planPrice?: string;
|
155
|
-
/**
|
156
|
-
* Date and time the order was created.
|
157
|
-
* @readonly
|
158
|
-
*/
|
159
|
-
_createdDate?: Date;
|
160
|
-
/**
|
161
|
-
* Date and time the order was updated.
|
162
|
-
* @readonly
|
163
|
-
*/
|
164
|
-
_updatedDate?: Date;
|
165
|
-
/**
|
166
|
-
* Information about the form submitted during the plan's checkout.
|
167
|
-
* @readonly
|
168
|
-
*/
|
169
|
-
formData?: FormData;
|
170
|
-
}
|
171
|
-
export interface Buyer {
|
172
|
-
/**
|
173
|
-
* Member ID for a buyer.
|
174
|
-
* @readonly
|
175
|
-
*/
|
176
|
-
memberId?: string;
|
177
|
-
/**
|
178
|
-
* Contact ID for a buyer.
|
179
|
-
* @readonly
|
180
|
-
*/
|
181
|
-
contactId?: string;
|
182
|
-
}
|
183
|
-
export interface PriceDetails extends PriceDetailsPricingModelOneOf {
|
184
|
-
/** Order has recurring payments. */
|
185
|
-
subscription?: Recurrence;
|
186
|
-
/** One-time payment. Order is valid for a specified duration. */
|
187
|
-
singlePaymentForDuration?: Duration;
|
188
|
-
/** One-time payment. Order is valid until it is canceled. */
|
189
|
-
singlePaymentUnlimited?: boolean | null;
|
190
|
-
/** Price of the order excluding tax, specified as a monetary amount. for example, `"9.99"`. */
|
191
|
-
subtotal?: string;
|
192
|
-
/** Total discount applied. */
|
193
|
-
discount?: string;
|
194
|
-
/** Tax applied. */
|
195
|
-
tax?: Tax;
|
196
|
-
/**
|
197
|
-
* Price after tax and discount is applied, specified as a monetary amount. For example, `"13.98"`.
|
198
|
-
*
|
199
|
-
* If no tax is applied, the amount is the same as `subtotal`.
|
200
|
-
*/
|
201
|
-
total?: string;
|
202
|
-
/** Plan price as it was at the moment of order creation. */
|
203
|
-
planPrice?: string;
|
204
|
-
/** Currency code. Must be valid ISO 4217 currency code (e.g., USD). */
|
205
|
-
currency?: string;
|
206
|
-
/** Free trial period for the order in days. Only available for recurring plans. */
|
207
|
-
freeTrialDays?: number | null;
|
208
|
-
/** Coupon applied to the order. Empty means no coupon was applied. */
|
209
|
-
coupon?: Coupon;
|
210
|
-
}
|
211
|
-
/** @oneof */
|
212
|
-
export interface PriceDetailsPricingModelOneOf {
|
213
|
-
/** Order has recurring payments. */
|
214
|
-
subscription?: Recurrence;
|
215
|
-
/** One-time payment. Order is valid for a specified duration. */
|
216
|
-
singlePaymentForDuration?: Duration;
|
217
|
-
/** One-time payment. Order is valid until it is canceled. */
|
218
|
-
singlePaymentUnlimited?: boolean | null;
|
219
|
-
}
|
220
|
-
export interface Tax {
|
221
|
-
/** Name of the tax. For example, VAT. */
|
222
|
-
name?: string;
|
223
|
-
/** Whether tax is included in the original price. When `false`, tax is added at checkout. */
|
224
|
-
includedInPrice?: boolean;
|
225
|
-
/** Tax rate percentage, as a number between 0 and 100. For example, a 7% tax rate is `"7.00"`. */
|
226
|
-
rate?: string;
|
227
|
-
/** Total tax, specified as a monetary amount. For example, `"3.99"`. */
|
228
|
-
amount?: string;
|
229
|
-
}
|
230
|
-
/** An object specifying how often and for how long payments recur (may be forever). */
|
231
|
-
export interface Recurrence {
|
232
|
-
/** Length of one payment cycle. */
|
233
|
-
cycleDuration?: Duration;
|
234
|
-
/**
|
235
|
-
* Amount of payment cycles this subscription is valid for.
|
236
|
-
*
|
237
|
-
* `0` for unlimited or until-canceled.
|
238
|
-
*/
|
239
|
-
cycleCount?: number | null;
|
240
|
-
}
|
241
|
-
/** A duration expressed in number of time units. */
|
242
|
-
export interface Duration {
|
243
|
-
/**
|
244
|
-
* The amount of a duration `unit` in a single payment cycle.
|
245
|
-
*
|
246
|
-
* Currently limited to support only `1`.
|
247
|
-
*/
|
248
|
-
count?: number | null;
|
249
|
-
/** Unit of time for the cycle duration. */
|
250
|
-
unit?: PeriodUnit;
|
251
|
-
}
|
252
|
-
export declare enum PeriodUnit {
|
253
|
-
UNDEFINED = "UNDEFINED",
|
254
|
-
DAY = "DAY",
|
255
|
-
WEEK = "WEEK",
|
256
|
-
MONTH = "MONTH",
|
257
|
-
YEAR = "YEAR"
|
258
|
-
}
|
259
|
-
export interface Coupon {
|
260
|
-
/** Code of the applied coupon. */
|
261
|
-
code?: string;
|
262
|
-
/** Total discount of the coupon, as a monetary amount. */
|
263
|
-
amount?: string;
|
264
|
-
/**
|
265
|
-
* Coupon ID.
|
266
|
-
* @readonly
|
267
|
-
*/
|
268
|
-
_id?: string;
|
269
|
-
}
|
270
|
-
export interface PricingDetails extends PricingDetailsPricingModelOneOf {
|
271
|
-
/** Pricing model for an order with recurring payment cycles. */
|
272
|
-
subscription?: Recurrence;
|
273
|
-
/** Pricing model for an order with a one-time payment and the order is valid for a specific amount of time. */
|
274
|
-
singlePaymentForDuration?: Duration;
|
275
|
-
/** Pricing model for an order with a one-time payment and the order is valid until canceled. */
|
276
|
-
singlePaymentUnlimited?: boolean | null;
|
277
|
-
/**
|
278
|
-
* Pricing details for all pricing models.
|
279
|
-
* @readonly
|
280
|
-
*/
|
281
|
-
prices?: SpannedPrice[];
|
282
|
-
}
|
283
|
-
/** @oneof */
|
284
|
-
export interface PricingDetailsPricingModelOneOf {
|
285
|
-
/** Pricing model for an order with recurring payment cycles. */
|
286
|
-
subscription?: Recurrence;
|
287
|
-
/** Pricing model for an order with a one-time payment and the order is valid for a specific amount of time. */
|
288
|
-
singlePaymentForDuration?: Duration;
|
289
|
-
/** Pricing model for an order with a one-time payment and the order is valid until canceled. */
|
290
|
-
singlePaymentUnlimited?: boolean | null;
|
291
|
-
}
|
292
|
-
export interface SpannedPrice {
|
293
|
-
/**
|
294
|
-
* Cycle duration to apply `price` for.
|
295
|
-
*
|
296
|
-
* Use with all pricing models.
|
297
|
-
* Can apply the same price to multiple payment cycles.
|
298
|
-
*/
|
299
|
-
duration?: PriceDuration;
|
300
|
-
/** Order price. */
|
301
|
-
price?: Price;
|
302
|
-
}
|
303
|
-
export interface PriceDuration {
|
304
|
-
/**
|
305
|
-
* Price starts to apply with this cycle.
|
306
|
-
*
|
307
|
-
* `1` is the first payment cycle for all pricing models.
|
308
|
-
*/
|
309
|
-
cycleFrom?: number;
|
310
|
-
/**
|
311
|
-
* Amount of cycles to apply price for.
|
312
|
-
*
|
313
|
-
* For `subscription` pricing models with a finite number of cycles, the `numberOfCycles` is the same as `pricing.subscription.cycleCount`.
|
314
|
-
*
|
315
|
-
* For `subscription` pricing models that are unlimited or until-canceled, the `numberOfCycles` is not returned.
|
316
|
-
*
|
317
|
-
* For `singlePaymentForDuration` and `singlePaymentUnlimited` pricing models, the `numberOfCycles` is `1`.
|
318
|
-
*/
|
319
|
-
numberOfCycles?: number | null;
|
320
|
-
}
|
321
|
-
export interface Price {
|
322
|
-
/** Price of the order excluding tax, specified as a monetary amount. For example, `"9.99"`. */
|
323
|
-
subtotal?: string;
|
324
|
-
/** Coupon applied to the order. */
|
325
|
-
coupon?: Coupon;
|
326
|
-
/** Total discount applied to the order. */
|
327
|
-
discount?: string;
|
328
|
-
/**
|
329
|
-
* Tax applied to the order.
|
330
|
-
*
|
331
|
-
* Tax is only applied if the site [has it configured](https://support.wix.com/en/article/pricing-plans-setting-up-tax-collection).
|
332
|
-
*/
|
333
|
-
tax?: Tax;
|
334
|
-
/**
|
335
|
-
* Price after tax and discount is applied. Specified as a monetary amount, for example, `"13.98"`.
|
336
|
-
*
|
337
|
-
* If no tax is applied, the amount is the same as `subtotal`.
|
338
|
-
*/
|
339
|
-
total?: string;
|
340
|
-
/**
|
341
|
-
* Three-letter currency code in
|
342
|
-
* [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format.
|
343
|
-
*/
|
344
|
-
currency?: string;
|
345
|
-
/** Price change after billing date was change and price was adjusted. Could be positive and negative values. */
|
346
|
-
proration?: string;
|
347
|
-
}
|
348
|
-
export interface Fee {
|
349
|
-
/** Fee name */
|
350
|
-
name?: string;
|
351
|
-
/** Amount of fee to be charged */
|
352
|
-
amount?: string;
|
353
|
-
}
|
354
|
-
export declare enum OrderType {
|
355
|
-
UNDEFINED = "UNDEFINED",
|
356
|
-
/** Payments made by the buyer */
|
357
|
-
ONLINE = "ONLINE",
|
358
|
-
/** Payments managed manually by the site owner */
|
359
|
-
OFFLINE = "OFFLINE",
|
360
|
-
/** Payments managed externally */
|
361
|
-
EXTERNAL = "EXTERNAL"
|
362
|
-
}
|
363
|
-
export declare enum OrderMethod {
|
364
|
-
UNKNOWN = "UNKNOWN",
|
365
|
-
/** Mail Order / Telephone Order transaction */
|
366
|
-
MOTO = "MOTO",
|
367
|
-
/** Point of Sale transaction */
|
368
|
-
POS = "POS"
|
369
|
-
}
|
370
|
-
export declare enum OrderStatus {
|
371
|
-
/** Order status undefined */
|
372
|
-
UNDEFINED = "UNDEFINED",
|
373
|
-
/** Order created, but hasn't been paid for yet. Filtered out in ListOrders response by default. */
|
374
|
-
DRAFT = "DRAFT",
|
375
|
-
/** Order has been paid for, but the start date is in the future */
|
376
|
-
PENDING = "PENDING",
|
377
|
-
/** Order is active */
|
378
|
-
ACTIVE = "ACTIVE",
|
379
|
-
/** Order is paused until site owner resumes it */
|
380
|
-
PAUSED = "PAUSED",
|
381
|
-
/** Order has ended */
|
382
|
-
ENDED = "ENDED",
|
383
|
-
/** Order has been canceled */
|
384
|
-
CANCELED = "CANCELED"
|
385
|
-
}
|
386
|
-
export interface Cancellation {
|
387
|
-
/** Date and time the cancellation was requested. */
|
388
|
-
requestedDate?: Date;
|
389
|
-
/**
|
390
|
-
* Reason for the cancellation. One of:
|
391
|
-
* + `OWNER_ACTION`: Site owner canceled the order.
|
392
|
-
* + `MEMBER_ACTION`: Buyer initiated the cancellation.
|
393
|
-
* + `PAYMENT_FAILURE`: Payment transaction failed.
|
394
|
-
* + `PAYMENT_SETUP_FAILURE`: Buyer's payment details weren't set up correctly.
|
395
|
-
* + `UNKNOWN`: Reason for the cancellation is unknown.
|
396
|
-
*/
|
397
|
-
cause?: CancellationCause;
|
398
|
-
/**
|
399
|
-
* When the cancellation takes effect. Set when cancelling the order. One of:
|
400
|
-
* + `IMMEDIATELY`: Cancellation occurs immediately and the buyer can no longer use the plan.
|
401
|
-
* + `NEXT_PAYMENT_DATE`: Cancellation occurs at the next payment date and time. Buyer can continue to use the plan until that date and time.
|
402
|
-
*/
|
403
|
-
effectiveAt?: CancellationEffectiveAt;
|
404
|
-
}
|
405
|
-
export declare enum CancellationCause {
|
406
|
-
/** Cancellation initiator undefined */
|
407
|
-
UNDEFINED = "UNDEFINED",
|
408
|
-
/** Order was canceled by site owner (default if canceled by user or service identity) */
|
409
|
-
OWNER_ACTION = "OWNER_ACTION",
|
410
|
-
/** Order was canceled by member (default if canceled by member identity) */
|
411
|
-
MEMBER_ACTION = "MEMBER_ACTION",
|
412
|
-
/** Order was canceled because of payment failure */
|
413
|
-
PAYMENT_FAILURE = "PAYMENT_FAILURE",
|
414
|
-
/** Order was canceled because of payment setup failure */
|
415
|
-
PAYMENT_SETUP_FAILURE = "PAYMENT_SETUP_FAILURE",
|
416
|
-
/** Order was cancelled because of an unknown reason. It's not possible to know with certain payment providers (e.g. paypal) */
|
417
|
-
UNKNOWN = "UNKNOWN"
|
418
|
-
}
|
419
|
-
export declare enum CancellationEffectiveAt {
|
420
|
-
/** Cancellation time undefined */
|
421
|
-
UNDEFINED = "UNDEFINED",
|
422
|
-
/** Will cancel the order now, i.e. update validUntil to the current date */
|
423
|
-
IMMEDIATELY = "IMMEDIATELY",
|
424
|
-
/** Will cancel the order at the date when next payment should have been made */
|
425
|
-
NEXT_PAYMENT_DATE = "NEXT_PAYMENT_DATE"
|
426
|
-
}
|
427
|
-
export declare enum PaymentStatus {
|
428
|
-
/** Payment status undefined */
|
429
|
-
UNDEFINED = "UNDEFINED",
|
430
|
-
/** Payment has been paid */
|
431
|
-
PAID = "PAID",
|
432
|
-
/** Payment has been refunded */
|
433
|
-
REFUNDED = "REFUNDED",
|
434
|
-
/** Recurring payment has failed */
|
435
|
-
FAILED = "FAILED",
|
436
|
-
/** Payment has not been paid */
|
437
|
-
UNPAID = "UNPAID",
|
438
|
-
/** Billing has been initialized, but actual charge is yet to be made. Can happen for free trial and PayPal */
|
439
|
-
PENDING = "PENDING",
|
440
|
-
/** Used in cases where the plan is free */
|
441
|
-
NOT_APPLICABLE = "NOT_APPLICABLE"
|
442
|
-
}
|
443
|
-
export interface PausePeriod {
|
444
|
-
/**
|
445
|
-
* Status of the pause period. Supported values:
|
446
|
-
* + `ACTIVE`: Status while the order is [paused](#pauseorder).
|
447
|
-
* + `ENDED`: Status when the order is [resumed](#resumeorder).
|
448
|
-
*/
|
449
|
-
status?: Status;
|
450
|
-
/** Start date and time of the pause period. */
|
451
|
-
pauseDate?: Date;
|
452
|
-
/**
|
453
|
-
* End date and time of the pause period.
|
454
|
-
*
|
455
|
-
* Omitted while the pause period remains `ACTIVE`.
|
456
|
-
*/
|
457
|
-
resumeDate?: Date;
|
458
|
-
}
|
459
|
-
export declare enum Status {
|
460
|
-
UNDEFINED = "UNDEFINED",
|
461
|
-
/** Order suspension is active */
|
462
|
-
ACTIVE = "ACTIVE",
|
463
|
-
/** Order suspension has ended */
|
464
|
-
ENDED = "ENDED"
|
465
|
-
}
|
466
|
-
/**
|
467
|
-
* Current cycle will be empty when order is cancelled, expired or order start date is in the future
|
468
|
-
* Current cycle start and end dates take into account free trial days and suspensions
|
469
|
-
*/
|
470
|
-
export interface CurrentCycle {
|
471
|
-
/**
|
472
|
-
* Index of the current payment cycle in the order.
|
473
|
-
*
|
474
|
-
* `0` when order is in a free trial period. In all other cases, the index starts with `1`.
|
475
|
-
*/
|
476
|
-
index?: number;
|
477
|
-
/** Start date and time for the current payment cycle. */
|
478
|
-
startedDate?: Date;
|
479
|
-
/** End date and time for the current payment cycle. */
|
480
|
-
endedDate?: Date;
|
481
|
-
}
|
482
|
-
/** Order cycle start and end dates take into account free trial days and suspensions */
|
483
|
-
export interface OrderCycle {
|
484
|
-
/**
|
485
|
-
* Index of this cycle in the order.
|
486
|
-
*
|
487
|
-
* `0` when order is in a free trial period. In all other cases, the index starts with `1`.
|
488
|
-
*/
|
489
|
-
index?: number;
|
490
|
-
/** Start date and time for this order cycle. */
|
491
|
-
startedDate?: Date;
|
492
|
-
/** End date and time for this order cycle. */
|
493
|
-
endedDate?: Date;
|
494
|
-
}
|
495
|
-
export interface FormData {
|
496
|
-
/** ID of the form associated with the plan at checkout. */
|
497
|
-
formId?: string | null;
|
498
|
-
/** ID of a submission to the plan's order form at checkout. Every time a visitor completes the checkout process for a plan, a new submission is created. */
|
499
|
-
submissionId?: string | null;
|
500
|
-
/**
|
501
|
-
* Data submitted to the plan's order form at checkout.
|
502
|
-
*
|
503
|
-
* This field is returned when a method's `fieldset` is set to `"FULL"`.
|
504
|
-
*
|
505
|
-
* @readonly
|
506
|
-
*/
|
507
|
-
submissionData?: Record<string, any>;
|
508
|
-
}
|
509
|
-
export interface DomainEvent<T = string> extends DomainEventBodyOneOf<T> {
|
510
|
-
createdEvent?: EntityCreatedEvent<T>;
|
511
|
-
updatedEvent?: EntityUpdatedEvent<T>;
|
512
|
-
deletedEvent?: EntityDeletedEvent<T>;
|
513
|
-
actionEvent?: ActionEvent<T>;
|
514
|
-
/**
|
515
|
-
* Unique event ID.
|
516
|
-
* Allows clients to ignore duplicate webhooks.
|
517
|
-
*/
|
518
|
-
_id?: string;
|
519
|
-
/**
|
520
|
-
* Assumes actions are also always typed to an entity_type
|
521
|
-
* Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
|
522
|
-
*/
|
523
|
-
entityFqdn?: string;
|
524
|
-
/**
|
525
|
-
* This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
|
526
|
-
* This is although the created/updated/deleted notion is duplication of the oneof types
|
527
|
-
* Example: created/updated/deleted/started/completed/email_opened
|
528
|
-
*/
|
529
|
-
slug?: string;
|
530
|
-
/** ID of the entity associated with the event. */
|
531
|
-
entityId?: string;
|
532
|
-
/** Event timestamp. */
|
533
|
-
eventTime?: Date;
|
534
|
-
/**
|
535
|
-
* Whether the event was triggered as a result of a privacy regulation application
|
536
|
-
* (for example, GDPR).
|
537
|
-
*/
|
538
|
-
triggeredByAnonymizeRequest?: boolean | null;
|
539
|
-
/** If present, indicates the action that triggered the event. */
|
540
|
-
originatedFrom?: string | null;
|
541
|
-
/**
|
542
|
-
* A sequence number defining the order of updates to the underlying entity.
|
543
|
-
* For example, given that some entity was updated at 16:00 and than again at 16:01,
|
544
|
-
* it is guaranteed that the sequence number of the second update is strictly higher than the first.
|
545
|
-
* As the consumer, you can use this value to ensure that you handle messages in the correct order.
|
546
|
-
* To do so, you will need to persist this number on your end, and compare the sequence number from the
|
547
|
-
* message against the one you have stored. Given that the stored number is higher, you should ignore the message.
|
548
|
-
*/
|
549
|
-
entityEventSequence?: string | null;
|
550
|
-
}
|
551
|
-
export interface DomainCreatedEvent<T> extends Omit<DomainEvent<T>, 'deletedEvent' | 'updatedEvent' | 'actionEvent'> {
|
552
|
-
}
|
553
|
-
export interface DomainDeletedEvent<T> extends Omit<DomainEvent<T>, 'createdEvent' | 'updatedEvent' | 'actionEvent'> {
|
554
|
-
}
|
555
|
-
export interface DomainUpdatedEvent<T> extends Omit<DomainEvent<T>, 'createdEvent' | 'deletedEvent' | 'actionEvent'> {
|
556
|
-
}
|
557
|
-
export interface DomainActionEvent<T> extends Omit<DomainEvent<T>, 'createdEvent' | 'deletedEvent' | 'updatedEvent'> {
|
558
|
-
}
|
559
|
-
/** @oneof */
|
560
|
-
export interface DomainEventBodyOneOf<T> {
|
561
|
-
createdEvent?: EntityCreatedEvent<T>;
|
562
|
-
updatedEvent?: EntityUpdatedEvent<T>;
|
563
|
-
deletedEvent?: EntityDeletedEvent<T>;
|
564
|
-
actionEvent?: ActionEvent<T>;
|
565
|
-
}
|
566
|
-
export interface EntityCreatedEvent<T> {
|
567
|
-
entity?: T;
|
568
|
-
}
|
569
|
-
export interface EntityUpdatedEvent<T> {
|
570
|
-
/**
|
571
|
-
* Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
|
572
|
-
* This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
|
573
|
-
* We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
|
574
|
-
*/
|
575
|
-
currentEntity?: T;
|
576
|
-
}
|
577
|
-
export interface EntityDeletedEvent<T> {
|
578
|
-
/** Entity that was deleted */
|
579
|
-
deletedEntity?: T | null;
|
580
|
-
}
|
581
|
-
export interface ActionEvent<T> {
|
582
|
-
body?: T;
|
583
|
-
}
|
584
|
-
export interface Empty {
|
585
|
-
}
|
586
|
-
export interface MemberGetOrderRequest {
|
587
|
-
/** Order ID. */
|
588
|
-
_id: string;
|
589
|
-
fieldSet?: Set;
|
590
|
-
}
|
591
|
-
export declare enum Set {
|
592
|
-
/** Same behavior as BASIC */
|
593
|
-
UNKNOWN_SET = "UNKNOWN_SET",
|
594
|
-
/**
|
595
|
-
* Returns fields of the entity that are available in the database.
|
596
|
-
* By default a field is available in the database unless explicitly specified in the documentation
|
597
|
-
*/
|
598
|
-
BASIC = "BASIC",
|
599
|
-
/**
|
600
|
-
* Returns all fields in the entity.
|
601
|
-
* This might make additional calls to gather the full entity
|
602
|
-
*/
|
603
|
-
FULL = "FULL"
|
604
|
-
}
|
605
|
-
export interface MemberGetOrderResponse {
|
606
|
-
/** Requested order. */
|
607
|
-
order?: Order;
|
608
|
-
}
|
609
|
-
export interface MemberListOrdersRequest {
|
610
|
-
/** Filter by plan IDs. */
|
611
|
-
planIds?: string[];
|
612
|
-
/** Filter for orders where auto renewal was canceled. */
|
613
|
-
autoRenewCanceled?: boolean | null;
|
614
|
-
/** Filter by order status. */
|
615
|
-
orderStatuses?: OrderStatus[];
|
616
|
-
/** Filter by payment status. */
|
617
|
-
paymentStatuses?: PaymentStatus[];
|
618
|
-
/** Limit the number of pricing plans returned. Default limit is 50. */
|
619
|
-
limit?: number | null;
|
620
|
-
/** Number of entries to offset. */
|
621
|
-
offset?: number | null;
|
622
|
-
/** Sorting direction (defaults to ASC) and field to sort by. [See available fields here](https://dev.wix.com/api/rest/pricing-plans/pricing-plans/order-v2/filter-and-sort). */
|
623
|
-
sorting?: Sorting;
|
624
|
-
fieldSet?: Set;
|
625
|
-
}
|
626
|
-
export interface Sorting {
|
627
|
-
/** Name of the field to sort by. */
|
628
|
-
fieldName?: string;
|
629
|
-
/** Sort order. */
|
630
|
-
order?: SortOrder;
|
631
|
-
}
|
632
|
-
export declare enum SortOrder {
|
633
|
-
ASC = "ASC",
|
634
|
-
DESC = "DESC"
|
635
|
-
}
|
636
|
-
export interface MemberListOrdersResponse {
|
637
|
-
/** List of orders. */
|
638
|
-
orders?: Order[];
|
639
|
-
/** Object containing paging-related data (number of orders returned, offset). */
|
640
|
-
pagingMetadata?: PagingMetadataV2;
|
641
|
-
}
|
642
|
-
export interface PagingMetadataV2 {
|
643
|
-
/** Number of items returned in the response. */
|
644
|
-
count?: number | null;
|
645
|
-
/** Offset that was requested. */
|
646
|
-
offset?: number | null;
|
647
|
-
/** Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. */
|
648
|
-
total?: number | null;
|
649
|
-
/** Flag that indicates the server failed to calculate the `total` field. */
|
650
|
-
tooManyToCount?: boolean | null;
|
651
|
-
/** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */
|
652
|
-
cursors?: Cursors;
|
653
|
-
}
|
654
|
-
export interface Cursors {
|
655
|
-
/** Cursor string pointing to the next page in the list of results. */
|
656
|
-
next?: string | null;
|
657
|
-
/** Cursor pointing to the previous page in the list of results. */
|
658
|
-
prev?: string | null;
|
659
|
-
}
|
660
|
-
/**
|
661
|
-
* TODO: Write orders filter and sort docs page
|
662
|
-
* Retrieves a list of up to 1,000 orders, based on the provided paging, [sorting, and filtering](https://dev.wix.com/api/rest/pricing-plans/pricing-plans/order-v2/filter-and-sort).
|
663
|
-
*/
|
664
|
-
export interface QueryOrdersRequest {
|
665
|
-
query?: QueryV2;
|
666
|
-
}
|
667
|
-
export interface QueryV2 extends QueryV2PagingMethodOneOf {
|
668
|
-
/** Paging options to limit and skip the number of items. */
|
669
|
-
paging?: Paging;
|
670
|
-
/** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
|
671
|
-
cursorPaging?: CursorPaging;
|
672
|
-
/**
|
673
|
-
* Filter object in the following format:
|
674
|
-
* `"filter" : {
|
675
|
-
* "fieldName1": "value1",
|
676
|
-
* "fieldName2":{"$operator":"value2"}
|
677
|
-
* }`
|
678
|
-
* Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`
|
679
|
-
*/
|
680
|
-
filter?: Record<string, any> | null;
|
681
|
-
/**
|
682
|
-
* Sort object in the following format:
|
683
|
-
* `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
|
684
|
-
*/
|
685
|
-
sort?: Sorting[];
|
686
|
-
/** Array of projected fields. A list of specific field names to return. If `fieldsets` are also specified, the union of `fieldsets` and `fields` is returned. */
|
687
|
-
fields?: string[];
|
688
|
-
/** Array of named, predefined sets of projected fields. A array of predefined named sets of fields to be returned. Specifying multiple `fieldsets` will return the union of fields from all sets. If `fields` are also specified, the union of `fieldsets` and `fields` is returned. */
|
689
|
-
fieldsets?: string[];
|
690
|
-
}
|
691
|
-
/** @oneof */
|
692
|
-
export interface QueryV2PagingMethodOneOf {
|
693
|
-
/** Paging options to limit and skip the number of items. */
|
694
|
-
paging?: Paging;
|
695
|
-
/** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
|
696
|
-
cursorPaging?: CursorPaging;
|
697
|
-
}
|
698
|
-
export interface Paging {
|
699
|
-
/** Number of items to load. */
|
700
|
-
limit?: number | null;
|
701
|
-
/** Number of items to skip in the current sort order. */
|
702
|
-
offset?: number | null;
|
703
|
-
}
|
704
|
-
export interface CursorPaging {
|
705
|
-
/** Maximum number of items to return in the results. */
|
706
|
-
limit?: number | null;
|
707
|
-
/**
|
708
|
-
* Pointer to the next or previous page in the list of results.
|
709
|
-
*
|
710
|
-
* Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.
|
711
|
-
* Not relevant for the first request.
|
712
|
-
*/
|
713
|
-
cursor?: string | null;
|
714
|
-
}
|
715
|
-
export interface QueryOrdersResponse {
|
716
|
-
/** Order data. */
|
717
|
-
plans?: Order[];
|
718
|
-
/** Paging-related data (number of orders returned, offset). */
|
719
|
-
pagingMetadata?: PagingMetadataV2;
|
720
|
-
}
|
721
|
-
export interface RequestCancellationRequest {
|
722
|
-
/** Order ID. */
|
723
|
-
_id: string;
|
724
|
-
/**
|
725
|
-
* Whether to cancel the order immediately or at the next payment date.
|
726
|
-
* One-time payment orders can only be canceled immediately.
|
727
|
-
*
|
728
|
-
* Supported values:
|
729
|
-
* - `"IMMEDIATELY"`: Indicates that the order should be canceled immediately.
|
730
|
-
* - `"NEXT_PAYMENT_DATE"`: Indicates that the order be canceled at the next payment date.
|
731
|
-
*/
|
732
|
-
effectiveAt: CancellationEffectiveAt;
|
733
|
-
}
|
734
|
-
export interface RequestCancellationResponse {
|
735
|
-
}
|
736
|
-
/**
|
737
|
-
* Emitted when an order is canceled immediately or when cycle ends for an order with canceled auto renewal
|
738
|
-
*
|
739
|
-
* To determine the specific reason of the cancellation check `order.cancellation.cause` field.
|
740
|
-
*/
|
741
|
-
export interface OrderCanceled {
|
742
|
-
/** Canceled order. */
|
743
|
-
order?: Order;
|
744
|
-
}
|
745
|
-
export interface CreateOnlineOrderRequest {
|
746
|
-
/** Plan ID. */
|
747
|
-
planId?: string;
|
748
|
-
/**
|
749
|
-
* Start date for the ordered plan.
|
750
|
-
*
|
751
|
-
* Default: Current date
|
752
|
-
*/
|
753
|
-
startDate?: Date;
|
754
|
-
/** Coupon code to apply. */
|
755
|
-
couponCode?: string | null;
|
756
|
-
/** Provided if checkout is initiated on buyer's behalf. */
|
757
|
-
onBehalf?: OnBehalf;
|
758
|
-
/** Form submission id that was submitted together with the order */
|
759
|
-
submissionId?: string | null;
|
760
|
-
}
|
761
|
-
export interface OnBehalf {
|
762
|
-
/** Member ID. */
|
763
|
-
memberId?: string;
|
764
|
-
/** Method by which checkout is initiated on buyer's behalf */
|
765
|
-
orderMethod?: OrderMethod;
|
766
|
-
}
|
767
|
-
export interface CreateOnlineOrderResponse {
|
768
|
-
/** Order. */
|
769
|
-
order?: Order;
|
770
|
-
}
|
771
|
-
export interface CouponsError {
|
772
|
-
couponCode?: string;
|
773
|
-
planId?: string;
|
774
|
-
}
|
775
|
-
export interface CreateGuestOnlineOrderRequest {
|
776
|
-
/** Plan ID. */
|
777
|
-
planId?: string;
|
778
|
-
/**
|
779
|
-
* Start date for the ordered plan.
|
780
|
-
*
|
781
|
-
* Default: Current date
|
782
|
-
*/
|
783
|
-
startDate?: Date;
|
784
|
-
/** Coupon code to apply. */
|
785
|
-
couponCode?: string | null;
|
786
|
-
/** Captcha data to prove you are not a robot */
|
787
|
-
captcha?: Captcha;
|
788
|
-
/** Visitor info */
|
789
|
-
guest?: Guest;
|
790
|
-
/** Form submission id that was submitted together with the order */
|
791
|
-
submissionId?: string | null;
|
792
|
-
}
|
793
|
-
export interface Captcha {
|
794
|
-
/** Token from captcha */
|
795
|
-
token?: string;
|
796
|
-
}
|
797
|
-
export interface Guest {
|
798
|
-
/** Email for checkout */
|
799
|
-
email?: string;
|
800
|
-
}
|
801
|
-
export interface CreateGuestOnlineOrderResponse {
|
802
|
-
/** Order. */
|
803
|
-
order?: Order;
|
804
|
-
}
|
805
|
-
export interface CreateOfflineOrderRequest {
|
806
|
-
/** ID of the plan being ordered. */
|
807
|
-
planId: string;
|
808
|
-
/** ID of the member ordering the plan. */
|
809
|
-
memberId: string;
|
810
|
-
/**
|
811
|
-
* Start date and time for the ordered plan.
|
812
|
-
*
|
813
|
-
* Default: Current date and time
|
814
|
-
*/
|
815
|
-
startDate?: Date;
|
816
|
-
/**
|
817
|
-
* Whether the order is paid.
|
818
|
-
*
|
819
|
-
* Default: `false`
|
820
|
-
*/
|
821
|
-
paid?: boolean | null;
|
822
|
-
/**
|
823
|
-
* Coupon code to apply.
|
824
|
-
*
|
825
|
-
* See [Coupons to learn more](https://dev.wix.com/api/rest/coupons).
|
826
|
-
*/
|
827
|
-
couponCode?: string | null;
|
828
|
-
/** Form submission id that was submitted together with the order */
|
829
|
-
submissionId?: string | null;
|
830
|
-
}
|
831
|
-
export interface CreateOfflineOrderResponse {
|
832
|
-
/** Order. */
|
833
|
-
order?: Order;
|
834
|
-
}
|
835
|
-
export interface CreateExternalOrderRequest {
|
836
|
-
/** Plan ID. */
|
837
|
-
planId?: string;
|
838
|
-
/** Form submission id that was submitted together with the order */
|
839
|
-
submissionId?: string | null;
|
840
|
-
}
|
841
|
-
export interface CreateExternalOrderResponse {
|
842
|
-
/** Created order */
|
843
|
-
order?: Order;
|
844
|
-
}
|
845
|
-
export interface GetOnlineOrderPreviewRequest {
|
846
|
-
/** Plan ID. */
|
847
|
-
planId?: string;
|
848
|
-
/**
|
849
|
-
* Start date for the ordered plan.
|
850
|
-
*
|
851
|
-
* Default: Current date
|
852
|
-
*/
|
853
|
-
startDate?: Date;
|
854
|
-
/** Coupon code to apply. */
|
855
|
-
couponCode?: string | null;
|
856
|
-
}
|
857
|
-
export interface GetOnlineOrderPreviewResponse {
|
858
|
-
/** Will be missing if limit is exceeded */
|
859
|
-
order?: Order;
|
860
|
-
/**
|
861
|
-
* Whether the purchase limit has already been reached for this plan by this member.
|
862
|
-
* Always false for plans without purchase limits.
|
863
|
-
*/
|
864
|
-
purchaseLimitExceeded?: boolean;
|
865
|
-
}
|
866
|
-
export interface GetGuestOnlineOrderPreviewRequest {
|
867
|
-
/** Plan ID. */
|
868
|
-
planId?: string;
|
869
|
-
/**
|
870
|
-
* Start date for the ordered plan.
|
871
|
-
*
|
872
|
-
* Default: Current date
|
873
|
-
*/
|
874
|
-
startDate?: Date;
|
875
|
-
/** Coupon code to apply. */
|
876
|
-
couponCode?: string | null;
|
877
|
-
email?: string;
|
878
|
-
}
|
879
|
-
export interface GetGuestOnlineOrderPreviewResponse {
|
880
|
-
/** Will be missing if limit is exceeded */
|
881
|
-
order?: Order;
|
882
|
-
/**
|
883
|
-
* Whether the purchase limit has already been reached for this plan by this email.
|
884
|
-
* Always false for plans without purchase limits.
|
885
|
-
*/
|
886
|
-
purchaseLimitExceeded?: boolean;
|
887
|
-
}
|
888
|
-
export interface GetOfflineOrderPreviewRequest {
|
889
|
-
/** ID of the plan of the previewed order. See [Plans for more information about plan IDs](https://dev.wix.com/api/rest/wix-pricing-plans/pricing-plans/plans). */
|
890
|
-
planId: string;
|
891
|
-
/** Member ID of the buyer the previewed order is for. */
|
892
|
-
memberId: string;
|
893
|
-
/**
|
894
|
-
* Start date and time for plan of the previewed order.
|
895
|
-
*
|
896
|
-
* Default: Current date and time
|
897
|
-
*/
|
898
|
-
startDate?: Date;
|
899
|
-
/** Coupon code to apply. See [Coupons to learn more](https://dev.wix.com/api/rest/coupons). */
|
900
|
-
couponCode?: string | null;
|
901
|
-
}
|
902
|
-
export interface GetOfflineOrderPreviewResponse {
|
903
|
-
/** The previewed order, as if the plan had been ordered. */
|
904
|
-
order?: Order;
|
905
|
-
/**
|
906
|
-
* Whether this previewed order would exceed the permitted amount of purchases available
|
907
|
-
* for this plan for this buyer.
|
908
|
-
*
|
909
|
-
* Always `false` for plans that do not have purchase limits.
|
910
|
-
*/
|
911
|
-
purchaseLimitExceeded?: boolean;
|
912
|
-
}
|
913
|
-
export interface GetPricePreviewRequest {
|
914
|
-
/** ID of plan to preview. */
|
915
|
-
planId: string;
|
916
|
-
/**
|
917
|
-
* Coupon code to apply.
|
918
|
-
*
|
919
|
-
* See Coupons [to learn more](https://dev.wix.com/api/rest/coupons).
|
920
|
-
*/
|
921
|
-
couponCode?: string | null;
|
922
|
-
}
|
923
|
-
export interface GetPricePreviewResponse {
|
924
|
-
/**
|
925
|
-
* @internal
|
926
|
-
* @internal */
|
927
|
-
price?: PriceDetails;
|
928
|
-
/** Pricing details. */
|
929
|
-
prices?: SpannedPrice[];
|
930
|
-
}
|
931
|
-
export interface ChangeStartDateRequest {
|
932
|
-
/** Draft order ID. */
|
933
|
-
orderId?: string;
|
934
|
-
/** New valid from date (timestamp). */
|
935
|
-
startDate?: Date;
|
936
|
-
}
|
937
|
-
export interface ChangeStartDateResponse {
|
938
|
-
/** Updated draft order. */
|
939
|
-
order?: Order;
|
940
|
-
}
|
941
|
-
export interface OrderStartDateChanged {
|
942
|
-
/** Order whose `startDate` changed. */
|
943
|
-
order?: Order;
|
944
|
-
}
|
945
|
-
export interface ApplyCouponRequest {
|
946
|
-
/** Draft order ID. */
|
947
|
-
orderId?: string;
|
948
|
-
/** Coupon code to apply. */
|
949
|
-
couponCode?: string;
|
950
|
-
}
|
951
|
-
export interface ApplyCouponResponse {
|
952
|
-
/** Order with applied coupon and recalculated tax. */
|
953
|
-
order?: Order;
|
954
|
-
}
|
955
|
-
export interface SetSubmissionRequest {
|
956
|
-
orderId?: string;
|
957
|
-
submissionId?: string;
|
958
|
-
}
|
959
|
-
export interface SetSubmissionResponse {
|
960
|
-
/** Order with submission id */
|
961
|
-
order?: Order;
|
962
|
-
}
|
963
|
-
export interface OrderPurchased {
|
964
|
-
/** Order that was paid for. If a free or an offline order, the order that was created. */
|
965
|
-
order?: Order;
|
966
|
-
}
|
967
|
-
export interface OrderStarted {
|
968
|
-
/** Order that reached its `startDate`. */
|
969
|
-
order?: Order;
|
970
|
-
}
|
971
|
-
/**
|
972
|
-
* Triggered at the start of a new payment cycle for an existing order.
|
973
|
-
*
|
974
|
-
* This webhook does not trigger at the initial start of an offline order.
|
975
|
-
*/
|
976
|
-
export interface OrderCycleStarted {
|
977
|
-
/** Order whose new cycle started. */
|
978
|
-
order?: Order;
|
979
|
-
/** Number of the payment cycle will be 0 when the order is in the free trial period. In other cases, the cycle number starts from 1. */
|
980
|
-
cycleNumber?: number;
|
981
|
-
}
|
982
|
-
/** Emitted when a recurring order is canceled for the next payment cycle */
|
983
|
-
export interface OrderAutoRenewCanceled {
|
984
|
-
/** Order that is canceled, effective at the end of the current payment cycle. */
|
985
|
-
order?: Order;
|
986
|
-
}
|
987
|
-
export interface OrderEnded {
|
988
|
-
/** Order that ended. */
|
989
|
-
order?: Order;
|
990
|
-
}
|
991
|
-
export interface GetOrderRequest {
|
992
|
-
/** Order ID. */
|
993
|
-
_id: string;
|
994
|
-
fieldSet?: Set;
|
995
|
-
}
|
996
|
-
export interface GetOrderResponse {
|
997
|
-
/** Order. */
|
998
|
-
order?: Order;
|
999
|
-
}
|
1000
|
-
export interface ListOrdersRequest {
|
1001
|
-
/** Filter by a buyer's member ID. See [Members to learn more about a site's members](https://dev.wix.com/api/rest/members/members). */
|
1002
|
-
buyerIds?: string[];
|
1003
|
-
/** Filter by plan IDs. See [Plans to learn more about pricing plans](https://dev.wix.com/api/rest/wix-pricing-plans/pricing-plans/plans). */
|
1004
|
-
planIds?: string[];
|
1005
|
-
/** Filter by whether or not the auto-renewal of recurring orders was canceled. */
|
1006
|
-
autoRenewCanceled?: boolean | null;
|
1007
|
-
/** Filter by order status. */
|
1008
|
-
orderStatuses?: OrderStatus[];
|
1009
|
-
/** Filter by payment status. */
|
1010
|
-
paymentStatuses?: PaymentStatus[];
|
1011
|
-
/**
|
1012
|
-
* Number of orders to return. See [Pagination](https://dev.wix.com/api/rest/getting-started/sorting-and-paging#getting-started_sorting-and-paging_paging) for more information.
|
1013
|
-
*
|
1014
|
-
* Max: `50`
|
1015
|
-
*/
|
1016
|
-
limit?: number | null;
|
1017
|
-
/** Number of orders to skip in the current sort order. */
|
1018
|
-
offset?: number | null;
|
1019
|
-
/**
|
1020
|
-
* Sort order.
|
1021
|
-
*
|
1022
|
-
* Use `ASC` for ascending order or `DESC` for descending order.
|
1023
|
-
*
|
1024
|
-
* Default: `DESC`
|
1025
|
-
*/
|
1026
|
-
sorting?: Sorting;
|
1027
|
-
/** Parameter to define amount of fields to return. FULL returns each order's submission data. Supported values: UNKNOWN_SET, BASIC, FULL */
|
1028
|
-
fieldSet?: Set;
|
1029
|
-
}
|
1030
|
-
export interface ListOrdersResponse {
|
1031
|
-
/** List of orders. */
|
1032
|
-
orders?: Order[];
|
1033
|
-
/** Object containing paging-related data (number of orders returned, offset). */
|
1034
|
-
pagingMetadata?: PagingMetadataV2;
|
1035
|
-
}
|
1036
|
-
export interface OrdersQueryOrdersRequest {
|
1037
|
-
/** [See available fields here](https://dev.wix.com/api/rest/pricing-plans/pricing-plans/order-v2/filter-and-sort). */
|
1038
|
-
query?: QueryV2;
|
1039
|
-
}
|
1040
|
-
export interface OrdersQueryOrdersResponse {
|
1041
|
-
/** Retrieved orders. */
|
1042
|
-
plans?: Order[];
|
1043
|
-
/** Paging-related data (number of orders returned, offset). */
|
1044
|
-
pagingMetadata?: PagingMetadataV2;
|
1045
|
-
}
|
1046
|
-
export interface GetOrdersStatsRequest {
|
1047
|
-
}
|
1048
|
-
export interface GetOrdersStatsResponse {
|
1049
|
-
/** Total number of orders. */
|
1050
|
-
totalOrderCount?: number;
|
1051
|
-
/** Number of active orders. */
|
1052
|
-
activeOrderCount?: number;
|
1053
|
-
}
|
1054
|
-
export interface GetAvailableOrderActionsRequest {
|
1055
|
-
/** Order ID. */
|
1056
|
-
_id?: string;
|
1057
|
-
}
|
1058
|
-
export interface GetAvailableOrderActionsResponse {
|
1059
|
-
/** Whether the order can be suspended. */
|
1060
|
-
suspendable?: boolean;
|
1061
|
-
/** If the order cannot be suspended, a reason is returned here. */
|
1062
|
-
notSuspendableReason?: ReasonNotSuspendable;
|
1063
|
-
/** Whether the order can be canceled by the buyer. */
|
1064
|
-
cancelableByBuyer?: boolean;
|
1065
|
-
}
|
1066
|
-
export declare enum ReasonNotSuspendable {
|
1067
|
-
/** Reason unknown */
|
1068
|
-
UNDEFINED = "UNDEFINED",
|
1069
|
-
/** Saved in the database but is awaiting payment. Non-active orders cannot be suspended */
|
1070
|
-
PENDING = "PENDING",
|
1071
|
-
/** Trial orders cannot be suspended */
|
1072
|
-
TRIAL = "TRIAL",
|
1073
|
-
/** Canceled orders cannot be suspended */
|
1074
|
-
CANCELED = "CANCELED",
|
1075
|
-
/** Ended orders cannot be suspended */
|
1076
|
-
ENDED = "ENDED",
|
1077
|
-
/** Paid for orders with future start dates cannot be suspended */
|
1078
|
-
NOT_STARTED = "NOT_STARTED",
|
1079
|
-
/** Order is already suspended */
|
1080
|
-
ALREADY_SUSPENDED = "ALREADY_SUSPENDED",
|
1081
|
-
/** Orders based on recurring payments using older Stripe versions cannot be suspended */
|
1082
|
-
OLD_STRIPE = "OLD_STRIPE"
|
1083
|
-
}
|
1084
|
-
export interface PostponeEndDateRequest {
|
1085
|
-
/** Order ID. */
|
1086
|
-
_id: string;
|
1087
|
-
/**
|
1088
|
-
* New end date and time.
|
1089
|
-
*
|
1090
|
-
* Must be later than the current end date and time.
|
1091
|
-
*/
|
1092
|
-
endDate: Date;
|
1093
|
-
}
|
1094
|
-
export interface PostponeEndDateResponse {
|
1095
|
-
}
|
1096
|
-
export interface OrderEndDatePostponed {
|
1097
|
-
/** Order whose `endDate` was postponed. */
|
1098
|
-
order?: Order;
|
1099
|
-
}
|
1100
|
-
export interface CancelOrderRequest {
|
1101
|
-
/** Order ID. */
|
1102
|
-
_id: string;
|
1103
|
-
/**
|
1104
|
-
* When the order is canceled.
|
1105
|
-
*
|
1106
|
-
* One time orders can only be canceled immediately. Supported values:
|
1107
|
-
* - `"IMMEDIATELY"`: The order is canceled immediately.
|
1108
|
-
* - `"NEXT_PAYMENT_DATE"`: The order is canceled at the next payment date.
|
1109
|
-
*/
|
1110
|
-
effectiveAt: CancellationEffectiveAt;
|
1111
|
-
}
|
1112
|
-
export interface CancelOrderResponse {
|
1113
|
-
}
|
1114
|
-
export interface MarkAsPaidRequest {
|
1115
|
-
/** Order ID. */
|
1116
|
-
_id: string;
|
1117
|
-
}
|
1118
|
-
export interface MarkAsPaidResponse {
|
1119
|
-
}
|
1120
|
-
export interface OrderMarkedAsPaid {
|
1121
|
-
/** Order that was marked as paid. */
|
1122
|
-
order?: Order;
|
1123
|
-
}
|
1124
|
-
export interface PauseOrderRequest {
|
1125
|
-
/** Order ID. */
|
1126
|
-
_id: string;
|
1127
|
-
}
|
1128
|
-
export interface PauseOrderResponse {
|
1129
|
-
}
|
1130
|
-
export interface OrderPaused {
|
1131
|
-
/** Paused order. */
|
1132
|
-
order?: Order;
|
1133
|
-
}
|
1134
|
-
export interface BulkPauseOrderRequest {
|
1135
|
-
/** List of Order IDs. */
|
1136
|
-
ids?: string[];
|
1137
|
-
/** Set to true to return Order entity in response. */
|
1138
|
-
returnFullEntity?: boolean;
|
1139
|
-
}
|
1140
|
-
export interface BulkPauseOrderResponse {
|
1141
|
-
results?: BulkOrderResult[];
|
1142
|
-
bulkActionMetadata?: BulkActionMetadata;
|
1143
|
-
}
|
1144
|
-
export interface BulkOrderResult {
|
1145
|
-
itemMetadata?: ItemMetadata;
|
1146
|
-
order?: Order;
|
1147
|
-
}
|
1148
|
-
export interface ItemMetadata {
|
1149
|
-
/** Item ID. Should always be available, unless it's impossible (for example, when failing to create an item). */
|
1150
|
-
_id?: string | null;
|
1151
|
-
/** Index of the item within the request array. Allows for correlation between request and response items. */
|
1152
|
-
originalIndex?: number;
|
1153
|
-
/** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */
|
1154
|
-
success?: boolean;
|
1155
|
-
/** Details about the error in case of failure. */
|
1156
|
-
error?: ApplicationError;
|
1157
|
-
}
|
1158
|
-
export interface ApplicationError {
|
1159
|
-
/** Error code. */
|
1160
|
-
code?: string;
|
1161
|
-
/** Description of the error. */
|
1162
|
-
description?: string;
|
1163
|
-
/** Data related to the error. */
|
1164
|
-
data?: Record<string, any> | null;
|
1165
|
-
}
|
1166
|
-
export interface BulkActionMetadata {
|
1167
|
-
/** Number of items that were successfully processed. */
|
1168
|
-
totalSuccesses?: number;
|
1169
|
-
/** Number of items that couldn't be processed. */
|
1170
|
-
totalFailures?: number;
|
1171
|
-
/** Number of failures without details because detailed failure threshold was exceeded. */
|
1172
|
-
undetailedFailures?: number;
|
1173
|
-
}
|
1174
|
-
export interface ResumeOrderRequest {
|
1175
|
-
/** Order ID. */
|
1176
|
-
_id: string;
|
1177
|
-
}
|
1178
|
-
export interface ResumeOrderResponse {
|
1179
|
-
}
|
1180
|
-
export interface OrderResumed {
|
1181
|
-
/** Resumed order. */
|
1182
|
-
order?: Order;
|
1183
|
-
}
|
1184
|
-
export interface BulkResumeOrderRequest {
|
1185
|
-
/** List of Order IDs. */
|
1186
|
-
ids?: string[];
|
1187
|
-
/** Set to true to return Order entity in response. */
|
1188
|
-
returnFullEntity?: boolean;
|
1189
|
-
}
|
1190
|
-
export interface BulkResumeOrderResponse {
|
1191
|
-
results?: BulkOrderResult[];
|
1192
|
-
bulkActionMetadata?: BulkActionMetadata;
|
1193
|
-
}
|
1194
|
-
export interface MemberGetOrderResponseNonNullableFields {
|
1195
|
-
order?: {
|
1196
|
-
_id: string;
|
1197
|
-
planId: string;
|
1198
|
-
subscriptionId: string;
|
1199
|
-
buyer?: {
|
1200
|
-
memberId: string;
|
1201
|
-
contactId: string;
|
1202
|
-
};
|
1203
|
-
priceDetails?: {
|
1204
|
-
subscription?: {
|
1205
|
-
cycleDuration?: {
|
1206
|
-
unit: PeriodUnit;
|
1207
|
-
};
|
1208
|
-
};
|
1209
|
-
singlePaymentForDuration?: {
|
1210
|
-
unit: PeriodUnit;
|
1211
|
-
};
|
1212
|
-
subtotal: string;
|
1213
|
-
discount: string;
|
1214
|
-
tax?: {
|
1215
|
-
name: string;
|
1216
|
-
includedInPrice: boolean;
|
1217
|
-
rate: string;
|
1218
|
-
amount: string;
|
1219
|
-
};
|
1220
|
-
total: string;
|
1221
|
-
planPrice: string;
|
1222
|
-
currency: string;
|
1223
|
-
coupon?: {
|
1224
|
-
code: string;
|
1225
|
-
amount: string;
|
1226
|
-
_id: string;
|
1227
|
-
};
|
1228
|
-
};
|
1229
|
-
pricing?: {
|
1230
|
-
subscription?: {
|
1231
|
-
cycleDuration?: {
|
1232
|
-
unit: PeriodUnit;
|
1233
|
-
};
|
1234
|
-
};
|
1235
|
-
singlePaymentForDuration?: {
|
1236
|
-
unit: PeriodUnit;
|
1237
|
-
};
|
1238
|
-
prices: {
|
1239
|
-
duration?: {
|
1240
|
-
cycleFrom: number;
|
1241
|
-
};
|
1242
|
-
price?: {
|
1243
|
-
subtotal: string;
|
1244
|
-
coupon?: {
|
1245
|
-
code: string;
|
1246
|
-
amount: string;
|
1247
|
-
_id: string;
|
1248
|
-
};
|
1249
|
-
discount: string;
|
1250
|
-
tax?: {
|
1251
|
-
name: string;
|
1252
|
-
includedInPrice: boolean;
|
1253
|
-
rate: string;
|
1254
|
-
amount: string;
|
1255
|
-
};
|
1256
|
-
total: string;
|
1257
|
-
currency: string;
|
1258
|
-
proration: string;
|
1259
|
-
};
|
1260
|
-
}[];
|
1261
|
-
};
|
1262
|
-
type: OrderType;
|
1263
|
-
status: OrderStatus;
|
1264
|
-
cancellation?: {
|
1265
|
-
cause: CancellationCause;
|
1266
|
-
effectiveAt: CancellationEffectiveAt;
|
1267
|
-
};
|
1268
|
-
lastPaymentStatus: PaymentStatus;
|
1269
|
-
pausePeriods: {
|
1270
|
-
status: Status;
|
1271
|
-
}[];
|
1272
|
-
currentCycle?: {
|
1273
|
-
index: number;
|
1274
|
-
};
|
1275
|
-
planName: string;
|
1276
|
-
planDescription: string;
|
1277
|
-
planPrice: string;
|
1278
|
-
};
|
1279
|
-
}
|
1280
|
-
export interface MemberListOrdersResponseNonNullableFields {
|
1281
|
-
orders: {
|
1282
|
-
_id: string;
|
1283
|
-
planId: string;
|
1284
|
-
subscriptionId: string;
|
1285
|
-
buyer?: {
|
1286
|
-
memberId: string;
|
1287
|
-
contactId: string;
|
1288
|
-
};
|
1289
|
-
priceDetails?: {
|
1290
|
-
subscription?: {
|
1291
|
-
cycleDuration?: {
|
1292
|
-
unit: PeriodUnit;
|
1293
|
-
};
|
1294
|
-
};
|
1295
|
-
singlePaymentForDuration?: {
|
1296
|
-
unit: PeriodUnit;
|
1297
|
-
};
|
1298
|
-
subtotal: string;
|
1299
|
-
discount: string;
|
1300
|
-
tax?: {
|
1301
|
-
name: string;
|
1302
|
-
includedInPrice: boolean;
|
1303
|
-
rate: string;
|
1304
|
-
amount: string;
|
1305
|
-
};
|
1306
|
-
total: string;
|
1307
|
-
planPrice: string;
|
1308
|
-
currency: string;
|
1309
|
-
coupon?: {
|
1310
|
-
code: string;
|
1311
|
-
amount: string;
|
1312
|
-
_id: string;
|
1313
|
-
};
|
1314
|
-
};
|
1315
|
-
pricing?: {
|
1316
|
-
subscription?: {
|
1317
|
-
cycleDuration?: {
|
1318
|
-
unit: PeriodUnit;
|
1319
|
-
};
|
1320
|
-
};
|
1321
|
-
singlePaymentForDuration?: {
|
1322
|
-
unit: PeriodUnit;
|
1323
|
-
};
|
1324
|
-
prices: {
|
1325
|
-
duration?: {
|
1326
|
-
cycleFrom: number;
|
1327
|
-
};
|
1328
|
-
price?: {
|
1329
|
-
subtotal: string;
|
1330
|
-
coupon?: {
|
1331
|
-
code: string;
|
1332
|
-
amount: string;
|
1333
|
-
_id: string;
|
1334
|
-
};
|
1335
|
-
discount: string;
|
1336
|
-
tax?: {
|
1337
|
-
name: string;
|
1338
|
-
includedInPrice: boolean;
|
1339
|
-
rate: string;
|
1340
|
-
amount: string;
|
1341
|
-
};
|
1342
|
-
total: string;
|
1343
|
-
currency: string;
|
1344
|
-
proration: string;
|
1345
|
-
};
|
1346
|
-
}[];
|
1347
|
-
};
|
1348
|
-
type: OrderType;
|
1349
|
-
status: OrderStatus;
|
1350
|
-
cancellation?: {
|
1351
|
-
cause: CancellationCause;
|
1352
|
-
effectiveAt: CancellationEffectiveAt;
|
1353
|
-
};
|
1354
|
-
lastPaymentStatus: PaymentStatus;
|
1355
|
-
pausePeriods: {
|
1356
|
-
status: Status;
|
1357
|
-
}[];
|
1358
|
-
currentCycle?: {
|
1359
|
-
index: number;
|
1360
|
-
};
|
1361
|
-
planName: string;
|
1362
|
-
planDescription: string;
|
1363
|
-
planPrice: string;
|
1364
|
-
}[];
|
1365
|
-
}
|
1366
|
-
export interface CreateOfflineOrderResponseNonNullableFields {
|
1367
|
-
order?: {
|
1368
|
-
_id: string;
|
1369
|
-
planId: string;
|
1370
|
-
subscriptionId: string;
|
1371
|
-
buyer?: {
|
1372
|
-
memberId: string;
|
1373
|
-
contactId: string;
|
1374
|
-
};
|
1375
|
-
priceDetails?: {
|
1376
|
-
subscription?: {
|
1377
|
-
cycleDuration?: {
|
1378
|
-
unit: PeriodUnit;
|
1379
|
-
};
|
1380
|
-
};
|
1381
|
-
singlePaymentForDuration?: {
|
1382
|
-
unit: PeriodUnit;
|
1383
|
-
};
|
1384
|
-
subtotal: string;
|
1385
|
-
discount: string;
|
1386
|
-
tax?: {
|
1387
|
-
name: string;
|
1388
|
-
includedInPrice: boolean;
|
1389
|
-
rate: string;
|
1390
|
-
amount: string;
|
1391
|
-
};
|
1392
|
-
total: string;
|
1393
|
-
planPrice: string;
|
1394
|
-
currency: string;
|
1395
|
-
coupon?: {
|
1396
|
-
code: string;
|
1397
|
-
amount: string;
|
1398
|
-
_id: string;
|
1399
|
-
};
|
1400
|
-
};
|
1401
|
-
pricing?: {
|
1402
|
-
subscription?: {
|
1403
|
-
cycleDuration?: {
|
1404
|
-
unit: PeriodUnit;
|
1405
|
-
};
|
1406
|
-
};
|
1407
|
-
singlePaymentForDuration?: {
|
1408
|
-
unit: PeriodUnit;
|
1409
|
-
};
|
1410
|
-
prices: {
|
1411
|
-
duration?: {
|
1412
|
-
cycleFrom: number;
|
1413
|
-
};
|
1414
|
-
price?: {
|
1415
|
-
subtotal: string;
|
1416
|
-
coupon?: {
|
1417
|
-
code: string;
|
1418
|
-
amount: string;
|
1419
|
-
_id: string;
|
1420
|
-
};
|
1421
|
-
discount: string;
|
1422
|
-
tax?: {
|
1423
|
-
name: string;
|
1424
|
-
includedInPrice: boolean;
|
1425
|
-
rate: string;
|
1426
|
-
amount: string;
|
1427
|
-
};
|
1428
|
-
total: string;
|
1429
|
-
currency: string;
|
1430
|
-
proration: string;
|
1431
|
-
};
|
1432
|
-
}[];
|
1433
|
-
};
|
1434
|
-
type: OrderType;
|
1435
|
-
status: OrderStatus;
|
1436
|
-
cancellation?: {
|
1437
|
-
cause: CancellationCause;
|
1438
|
-
effectiveAt: CancellationEffectiveAt;
|
1439
|
-
};
|
1440
|
-
lastPaymentStatus: PaymentStatus;
|
1441
|
-
pausePeriods: {
|
1442
|
-
status: Status;
|
1443
|
-
}[];
|
1444
|
-
currentCycle?: {
|
1445
|
-
index: number;
|
1446
|
-
};
|
1447
|
-
planName: string;
|
1448
|
-
planDescription: string;
|
1449
|
-
planPrice: string;
|
1450
|
-
};
|
1451
|
-
}
|
1452
|
-
export interface GetOfflineOrderPreviewResponseNonNullableFields {
|
1453
|
-
order?: {
|
1454
|
-
_id: string;
|
1455
|
-
planId: string;
|
1456
|
-
subscriptionId: string;
|
1457
|
-
buyer?: {
|
1458
|
-
memberId: string;
|
1459
|
-
contactId: string;
|
1460
|
-
};
|
1461
|
-
priceDetails?: {
|
1462
|
-
subscription?: {
|
1463
|
-
cycleDuration?: {
|
1464
|
-
unit: PeriodUnit;
|
1465
|
-
};
|
1466
|
-
};
|
1467
|
-
singlePaymentForDuration?: {
|
1468
|
-
unit: PeriodUnit;
|
1469
|
-
};
|
1470
|
-
subtotal: string;
|
1471
|
-
discount: string;
|
1472
|
-
tax?: {
|
1473
|
-
name: string;
|
1474
|
-
includedInPrice: boolean;
|
1475
|
-
rate: string;
|
1476
|
-
amount: string;
|
1477
|
-
};
|
1478
|
-
total: string;
|
1479
|
-
planPrice: string;
|
1480
|
-
currency: string;
|
1481
|
-
coupon?: {
|
1482
|
-
code: string;
|
1483
|
-
amount: string;
|
1484
|
-
_id: string;
|
1485
|
-
};
|
1486
|
-
};
|
1487
|
-
pricing?: {
|
1488
|
-
subscription?: {
|
1489
|
-
cycleDuration?: {
|
1490
|
-
unit: PeriodUnit;
|
1491
|
-
};
|
1492
|
-
};
|
1493
|
-
singlePaymentForDuration?: {
|
1494
|
-
unit: PeriodUnit;
|
1495
|
-
};
|
1496
|
-
prices: {
|
1497
|
-
duration?: {
|
1498
|
-
cycleFrom: number;
|
1499
|
-
};
|
1500
|
-
price?: {
|
1501
|
-
subtotal: string;
|
1502
|
-
coupon?: {
|
1503
|
-
code: string;
|
1504
|
-
amount: string;
|
1505
|
-
_id: string;
|
1506
|
-
};
|
1507
|
-
discount: string;
|
1508
|
-
tax?: {
|
1509
|
-
name: string;
|
1510
|
-
includedInPrice: boolean;
|
1511
|
-
rate: string;
|
1512
|
-
amount: string;
|
1513
|
-
};
|
1514
|
-
total: string;
|
1515
|
-
currency: string;
|
1516
|
-
proration: string;
|
1517
|
-
};
|
1518
|
-
}[];
|
1519
|
-
};
|
1520
|
-
type: OrderType;
|
1521
|
-
status: OrderStatus;
|
1522
|
-
cancellation?: {
|
1523
|
-
cause: CancellationCause;
|
1524
|
-
effectiveAt: CancellationEffectiveAt;
|
1525
|
-
};
|
1526
|
-
lastPaymentStatus: PaymentStatus;
|
1527
|
-
pausePeriods: {
|
1528
|
-
status: Status;
|
1529
|
-
}[];
|
1530
|
-
currentCycle?: {
|
1531
|
-
index: number;
|
1532
|
-
};
|
1533
|
-
planName: string;
|
1534
|
-
planDescription: string;
|
1535
|
-
planPrice: string;
|
1536
|
-
};
|
1537
|
-
purchaseLimitExceeded: boolean;
|
1538
|
-
}
|
1539
|
-
export interface GetPricePreviewResponseNonNullableFields {
|
1540
|
-
price?: {
|
1541
|
-
subscription?: {
|
1542
|
-
cycleDuration?: {
|
1543
|
-
unit: PeriodUnit;
|
1544
|
-
};
|
1545
|
-
};
|
1546
|
-
singlePaymentForDuration?: {
|
1547
|
-
unit: PeriodUnit;
|
1548
|
-
};
|
1549
|
-
subtotal: string;
|
1550
|
-
discount: string;
|
1551
|
-
tax?: {
|
1552
|
-
name: string;
|
1553
|
-
includedInPrice: boolean;
|
1554
|
-
rate: string;
|
1555
|
-
amount: string;
|
1556
|
-
};
|
1557
|
-
total: string;
|
1558
|
-
planPrice: string;
|
1559
|
-
currency: string;
|
1560
|
-
coupon?: {
|
1561
|
-
code: string;
|
1562
|
-
amount: string;
|
1563
|
-
_id: string;
|
1564
|
-
};
|
1565
|
-
};
|
1566
|
-
prices: {
|
1567
|
-
duration?: {
|
1568
|
-
cycleFrom: number;
|
1569
|
-
};
|
1570
|
-
price?: {
|
1571
|
-
subtotal: string;
|
1572
|
-
coupon?: {
|
1573
|
-
code: string;
|
1574
|
-
amount: string;
|
1575
|
-
_id: string;
|
1576
|
-
};
|
1577
|
-
discount: string;
|
1578
|
-
tax?: {
|
1579
|
-
name: string;
|
1580
|
-
includedInPrice: boolean;
|
1581
|
-
rate: string;
|
1582
|
-
amount: string;
|
1583
|
-
};
|
1584
|
-
total: string;
|
1585
|
-
currency: string;
|
1586
|
-
proration: string;
|
1587
|
-
};
|
1588
|
-
}[];
|
1589
|
-
}
|
1590
|
-
export interface GetOrderResponseNonNullableFields {
|
1591
|
-
order?: {
|
1592
|
-
_id: string;
|
1593
|
-
planId: string;
|
1594
|
-
subscriptionId: string;
|
1595
|
-
buyer?: {
|
1596
|
-
memberId: string;
|
1597
|
-
contactId: string;
|
1598
|
-
};
|
1599
|
-
priceDetails?: {
|
1600
|
-
subscription?: {
|
1601
|
-
cycleDuration?: {
|
1602
|
-
unit: PeriodUnit;
|
1603
|
-
};
|
1604
|
-
};
|
1605
|
-
singlePaymentForDuration?: {
|
1606
|
-
unit: PeriodUnit;
|
1607
|
-
};
|
1608
|
-
subtotal: string;
|
1609
|
-
discount: string;
|
1610
|
-
tax?: {
|
1611
|
-
name: string;
|
1612
|
-
includedInPrice: boolean;
|
1613
|
-
rate: string;
|
1614
|
-
amount: string;
|
1615
|
-
};
|
1616
|
-
total: string;
|
1617
|
-
planPrice: string;
|
1618
|
-
currency: string;
|
1619
|
-
coupon?: {
|
1620
|
-
code: string;
|
1621
|
-
amount: string;
|
1622
|
-
_id: string;
|
1623
|
-
};
|
1624
|
-
};
|
1625
|
-
pricing?: {
|
1626
|
-
subscription?: {
|
1627
|
-
cycleDuration?: {
|
1628
|
-
unit: PeriodUnit;
|
1629
|
-
};
|
1630
|
-
};
|
1631
|
-
singlePaymentForDuration?: {
|
1632
|
-
unit: PeriodUnit;
|
1633
|
-
};
|
1634
|
-
prices: {
|
1635
|
-
duration?: {
|
1636
|
-
cycleFrom: number;
|
1637
|
-
};
|
1638
|
-
price?: {
|
1639
|
-
subtotal: string;
|
1640
|
-
coupon?: {
|
1641
|
-
code: string;
|
1642
|
-
amount: string;
|
1643
|
-
_id: string;
|
1644
|
-
};
|
1645
|
-
discount: string;
|
1646
|
-
tax?: {
|
1647
|
-
name: string;
|
1648
|
-
includedInPrice: boolean;
|
1649
|
-
rate: string;
|
1650
|
-
amount: string;
|
1651
|
-
};
|
1652
|
-
total: string;
|
1653
|
-
currency: string;
|
1654
|
-
proration: string;
|
1655
|
-
};
|
1656
|
-
}[];
|
1657
|
-
};
|
1658
|
-
type: OrderType;
|
1659
|
-
status: OrderStatus;
|
1660
|
-
cancellation?: {
|
1661
|
-
cause: CancellationCause;
|
1662
|
-
effectiveAt: CancellationEffectiveAt;
|
1663
|
-
};
|
1664
|
-
lastPaymentStatus: PaymentStatus;
|
1665
|
-
pausePeriods: {
|
1666
|
-
status: Status;
|
1667
|
-
}[];
|
1668
|
-
currentCycle?: {
|
1669
|
-
index: number;
|
1670
|
-
};
|
1671
|
-
planName: string;
|
1672
|
-
planDescription: string;
|
1673
|
-
planPrice: string;
|
1674
|
-
};
|
1675
|
-
}
|
1676
|
-
export interface ListOrdersResponseNonNullableFields {
|
1677
|
-
orders: {
|
1678
|
-
_id: string;
|
1679
|
-
planId: string;
|
1680
|
-
subscriptionId: string;
|
1681
|
-
buyer?: {
|
1682
|
-
memberId: string;
|
1683
|
-
contactId: string;
|
1684
|
-
};
|
1685
|
-
priceDetails?: {
|
1686
|
-
subscription?: {
|
1687
|
-
cycleDuration?: {
|
1688
|
-
unit: PeriodUnit;
|
1689
|
-
};
|
1690
|
-
};
|
1691
|
-
singlePaymentForDuration?: {
|
1692
|
-
unit: PeriodUnit;
|
1693
|
-
};
|
1694
|
-
subtotal: string;
|
1695
|
-
discount: string;
|
1696
|
-
tax?: {
|
1697
|
-
name: string;
|
1698
|
-
includedInPrice: boolean;
|
1699
|
-
rate: string;
|
1700
|
-
amount: string;
|
1701
|
-
};
|
1702
|
-
total: string;
|
1703
|
-
planPrice: string;
|
1704
|
-
currency: string;
|
1705
|
-
coupon?: {
|
1706
|
-
code: string;
|
1707
|
-
amount: string;
|
1708
|
-
_id: string;
|
1709
|
-
};
|
1710
|
-
};
|
1711
|
-
pricing?: {
|
1712
|
-
subscription?: {
|
1713
|
-
cycleDuration?: {
|
1714
|
-
unit: PeriodUnit;
|
1715
|
-
};
|
1716
|
-
};
|
1717
|
-
singlePaymentForDuration?: {
|
1718
|
-
unit: PeriodUnit;
|
1719
|
-
};
|
1720
|
-
prices: {
|
1721
|
-
duration?: {
|
1722
|
-
cycleFrom: number;
|
1723
|
-
};
|
1724
|
-
price?: {
|
1725
|
-
subtotal: string;
|
1726
|
-
coupon?: {
|
1727
|
-
code: string;
|
1728
|
-
amount: string;
|
1729
|
-
_id: string;
|
1730
|
-
};
|
1731
|
-
discount: string;
|
1732
|
-
tax?: {
|
1733
|
-
name: string;
|
1734
|
-
includedInPrice: boolean;
|
1735
|
-
rate: string;
|
1736
|
-
amount: string;
|
1737
|
-
};
|
1738
|
-
total: string;
|
1739
|
-
currency: string;
|
1740
|
-
proration: string;
|
1741
|
-
};
|
1742
|
-
}[];
|
1743
|
-
};
|
1744
|
-
type: OrderType;
|
1745
|
-
status: OrderStatus;
|
1746
|
-
cancellation?: {
|
1747
|
-
cause: CancellationCause;
|
1748
|
-
effectiveAt: CancellationEffectiveAt;
|
1749
|
-
};
|
1750
|
-
lastPaymentStatus: PaymentStatus;
|
1751
|
-
pausePeriods: {
|
1752
|
-
status: Status;
|
1753
|
-
}[];
|
1754
|
-
currentCycle?: {
|
1755
|
-
index: number;
|
1756
|
-
};
|
1757
|
-
planName: string;
|
1758
|
-
planDescription: string;
|
1759
|
-
planPrice: string;
|
1760
|
-
}[];
|
1761
|
-
}
|
1762
|
-
export declare const onOrderCanceled: EventDefinition<DomainActionEvent<OrderCanceled>, "wix.pricing_plans.v2.order_canceled">;
|
1763
|
-
export declare const onOrderCreated: EventDefinition<DomainCreatedEvent<Order>, "wix.pricing_plans.v2.order_created">;
|
1764
|
-
export declare const onOrderUpdated: EventDefinition<DomainUpdatedEvent<Order>, "wix.pricing_plans.v2.order_updated">;
|
1765
|
-
export declare const onOrderStartDateChanged: EventDefinition<DomainActionEvent<OrderStartDateChanged>, "wix.pricing_plans.v2.order_start_date_changed">;
|
1766
|
-
export declare const onOrderPurchased: EventDefinition<DomainActionEvent<OrderPurchased>, "wix.pricing_plans.v2.order_purchased">;
|
1767
|
-
export declare const onOrderStarted: EventDefinition<DomainActionEvent<OrderStarted>, "wix.pricing_plans.v2.order_started">;
|
1768
|
-
export declare const onOrderCycleStarted: EventDefinition<DomainActionEvent<OrderCycleStarted>, "wix.pricing_plans.v2.order_cycle_started">;
|
1769
|
-
export declare const onOrderAutoRenewCanceled: EventDefinition<DomainActionEvent<OrderAutoRenewCanceled>, "wix.pricing_plans.v2.order_auto_renew_canceled">;
|
1770
|
-
export declare const onOrderEnded: EventDefinition<DomainActionEvent<OrderEnded>, "wix.pricing_plans.v2.order_ended">;
|
1771
|
-
export declare const onOrderEndDatePostponed: EventDefinition<DomainActionEvent<OrderEndDatePostponed>, "wix.pricing_plans.v2.order_end_date_postponed">;
|
1772
|
-
export declare const onOrderMarkedAsPaid: EventDefinition<DomainActionEvent<OrderMarkedAsPaid>, "wix.pricing_plans.v2.order_marked_as_paid">;
|
1773
|
-
export declare const onOrderPaused: EventDefinition<DomainActionEvent<OrderPaused>, "wix.pricing_plans.v2.order_paused">;
|
1774
|
-
export declare const onOrderResumed: EventDefinition<DomainActionEvent<OrderResumed>, "wix.pricing_plans.v2.order_resumed">;
|
1775
|
-
/**
|
1776
|
-
* Gets an order by ID for the currently logged-in member.
|
1777
|
-
*
|
1778
|
-
* The `memberGetOrder()` function returns a Promise that resolves to information about a specified order for the currently logged-in member.
|
1779
|
-
* @param _id - Order ID.
|
1780
|
-
* @public
|
1781
|
-
* @requiredField _id
|
1782
|
-
* @param options - Options for getting a logged-in member's order.
|
1783
|
-
* @applicableIdentity MEMBER
|
1784
|
-
* @returns Requested order.
|
1785
|
-
*/
|
1786
|
-
export declare function memberGetOrder(_id: string, options?: MemberGetOrderOptions): Promise<Order & NonNullable<MemberGetOrderResponseNonNullableFields>['order']>;
|
1787
|
-
export interface MemberGetOrderOptions {
|
1788
|
-
fieldSet?: Set;
|
1789
|
-
}
|
1790
|
-
/**
|
1791
|
-
* Lists orders for the currently logged-in member.
|
1792
|
-
*
|
1793
|
-
* The `memberListOrders()` function returns a Promise that resolves to a list of up to 100 pricing plan orders.
|
1794
|
-
* @public
|
1795
|
-
* @documentationMaturity preview
|
1796
|
-
* @param options - Filtering, sorting, and pagination options.
|
1797
|
-
* @applicableIdentity MEMBER
|
1798
|
-
*/
|
1799
|
-
export declare function memberListOrders(options?: MemberListOrdersOptions): Promise<MemberListOrdersResponse & MemberListOrdersResponseNonNullableFields>;
|
1800
|
-
export interface MemberListOrdersOptions {
|
1801
|
-
/** Filter by plan IDs. */
|
1802
|
-
planIds?: string[];
|
1803
|
-
/** Filter for orders where auto renewal was canceled. */
|
1804
|
-
autoRenewCanceled?: boolean | null;
|
1805
|
-
/**
|
1806
|
-
* Filter by the order status. Supported values:
|
1807
|
-
* + `DRAFT`: Order has been initiated but payment hasn't been processed yet. The plan isn't yet available for use to the buyer.
|
1808
|
-
* + `PENDING`: Order has been purchased and its start date is set in the future.
|
1809
|
-
* + `ACTIVE`: Order has been processed. The plan is available for use.
|
1810
|
-
* + `PAUSED`: Order, and use of the plan, is [paused](#pauseorder). The order, and use of the plan, can be [resumed](#resumeorder).
|
1811
|
-
* + `ENDED`: Order has completed its duration and is no longer available for use.
|
1812
|
-
* + `CANCELED`: Order has been [canceled](#cancelorder).
|
1813
|
-
*/
|
1814
|
-
orderStatuses?: OrderStatus[];
|
1815
|
-
/**
|
1816
|
-
* Key Path to edit
|
1817
|
-
* ManagementListOrdersOptions.paymentStatuses
|
1818
|
-
* Production value
|
1819
|
-
* Filter by payment status.
|
1820
|
-
* Override
|
1821
|
-
* Filter by payment status.
|
1822
|
-
*
|
1823
|
-
* Supported values:
|
1824
|
-
* + `PAID`: The last payment was paid.
|
1825
|
-
* + `REFUNDED`: The last payment was refunded.
|
1826
|
-
* + `FAILED`: The last payment transaction didn't complete.
|
1827
|
-
* + `UNPAID`: The last payment wasn't paid.
|
1828
|
-
* + `PENDING`: Awaiting payment.
|
1829
|
-
* + `NOT_APPLICABLE`: No payment was necessary. For example, for free plans or free trials.
|
1830
|
-
* Mark down view
|
1831
|
-
* Filter by payment status.
|
1832
|
-
*
|
1833
|
-
* Supported values:
|
1834
|
-
*
|
1835
|
-
* PAID: The last payment was paid.
|
1836
|
-
* REFUNDED: The last payment was refunded.
|
1837
|
-
* FAILED: The last payment transaction didn't complete.
|
1838
|
-
* UNPAID: The last payment wasn't paid.
|
1839
|
-
* PENDING: Awaiting payment.
|
1840
|
-
* NOT_APPLICABLE: No payment was necessary. For example, for free plans or free trials.
|
1841
|
-
*/
|
1842
|
-
paymentStatuses?: PaymentStatus[];
|
1843
|
-
/**
|
1844
|
-
* Number of pricing plan orders to return.
|
1845
|
-
*
|
1846
|
-
* Default: `50`
|
1847
|
-
*/
|
1848
|
-
limit?: number | null;
|
1849
|
-
/** Number of orders to skip in the current sort order. */
|
1850
|
-
offset?: number | null;
|
1851
|
-
/**
|
1852
|
-
* Sort order.
|
1853
|
-
*
|
1854
|
-
* Use `ASC` for ascending order or `DESC` for descending order.
|
1855
|
-
*
|
1856
|
-
* Default: `ASC`
|
1857
|
-
*/
|
1858
|
-
sorting?: Sorting;
|
1859
|
-
fieldSet?: Set;
|
1860
|
-
}
|
1861
|
-
/**
|
1862
|
-
* Starts the process of canceling an order.
|
1863
|
-
*
|
1864
|
-
*
|
1865
|
-
* The `requestCancellation()` function returns a Promise that resolves when the order cancellation is successfully requested.
|
1866
|
-
*
|
1867
|
-
* For orders with recurring payments, a cancellation can be set to occur either immediately or at the next payment date. For orders with one-time payments, a cancellation occurs immediately after the request is processed.
|
1868
|
-
*
|
1869
|
-
* Requesting an order cancellation starts the cancellation process. There may be some operations that continue to be processed before the status of the order is changed to `"CANCELED"`. For example, payments might need to be refunded before the order is fully canceled.
|
1870
|
-
*
|
1871
|
-
* #### Canceling during the free trial period.
|
1872
|
-
*
|
1873
|
-
* When a buyer cancels their order during the free trial period, the buyer's subscription expires at the end of the free trial period and they won't be billed. The buyer may continue using the benefits until the end of the free trial period.
|
1874
|
-
*
|
1875
|
-
* @param _id - Order ID.
|
1876
|
-
* @param effectiveAt - Whether to cancel the order immediately or at the next payment date.
|
1877
|
-
* One-time payment orders can only be canceled immediately.
|
1878
|
-
*
|
1879
|
-
* Supported values:
|
1880
|
-
* - `"IMMEDIATELY"`: Indicates that the order should be canceled immediately.
|
1881
|
-
* - `"NEXT_PAYMENT_DATE"`: Indicates that the order be canceled at the next payment date.
|
1882
|
-
* @public
|
1883
|
-
* @documentationMaturity preview
|
1884
|
-
* @requiredField _id
|
1885
|
-
* @requiredField effectiveAt
|
1886
|
-
* @param options - Options for requesting a cancellation.
|
1887
|
-
* @applicableIdentity MEMBER
|
1888
|
-
* @returns Fulfilled - When the cancellation process is started.
|
1889
|
-
*/
|
1890
|
-
export declare function requestCancellation(_id: string, effectiveAt: CancellationEffectiveAt): Promise<void>;
|
1891
|
-
/**
|
1892
|
-
* Creates an order for a buyer who purchased the plan with an offline transaction.
|
1893
|
-
*
|
1894
|
-
* The `createOfflineOrder()` function returns a Promise that resolves to an `order` object when the order has been created.
|
1895
|
-
*
|
1896
|
-
* Payment of an offline order is handled in 1 of 2 ways.
|
1897
|
-
* - When creating the order, select `true` in the `paid` request parameter.
|
1898
|
-
* - After creation, with the [`markAsPaid()`](#markaspaid) function.
|
1899
|
-
*
|
1900
|
-
* When creating a non-free offline order:
|
1901
|
-
* - The order's status is set to `"PENDING"` if the start date is in the future. Otherwise, the status is set to `"ACTIVE"`.
|
1902
|
-
* The order's last payment status is set to `"UNPAID"` or `"PAID"`.
|
1903
|
-
*
|
1904
|
-
* When creating a free offline order:
|
1905
|
-
* - The order's status is set to `"PENDING"` if the start date is in the future. Otherwise, the status is set to `"ACTIVE"`.
|
1906
|
-
* - The order's last payment status is set to `"NOT_APPLICABLE"`.
|
1907
|
-
* @param memberId - ID of the member ordering the plan.
|
1908
|
-
* @public
|
1909
|
-
* @documentationMaturity preview
|
1910
|
-
* @requiredField memberId
|
1911
|
-
* @requiredField planId
|
1912
|
-
* @param options - Options for creating an offline order.
|
1913
|
-
* @param planId - ID of the plan being ordered. See [Plans for more information about plan IDs](plans)
|
1914
|
-
* @permissionScope Manage Orders
|
1915
|
-
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
|
1916
|
-
* @applicableIdentity APP
|
1917
|
-
* @returns Fulfilled - The order of the plan.
|
1918
|
-
*/
|
1919
|
-
export declare function createOfflineOrder(planId: string, memberId: string, options?: CreateOfflineOrderOptions): Promise<CreateOfflineOrderResponse & CreateOfflineOrderResponseNonNullableFields>;
|
1920
|
-
export interface CreateOfflineOrderOptions {
|
1921
|
-
/**
|
1922
|
-
* Start date and time for the ordered plan.
|
1923
|
-
*
|
1924
|
-
* Default: Current date and time
|
1925
|
-
*/
|
1926
|
-
startDate?: Date;
|
1927
|
-
/**
|
1928
|
-
* Whether the order is paid.
|
1929
|
-
*
|
1930
|
-
* Default: `false`
|
1931
|
-
*/
|
1932
|
-
paid?: boolean | null;
|
1933
|
-
/** Coupon code to apply. */
|
1934
|
-
couponCode?: string | null;
|
1935
|
-
/** Form submission ID that was submitted together with the order. */
|
1936
|
-
submissionId?: string | null;
|
1937
|
-
}
|
1938
|
-
/**
|
1939
|
-
* Provides a preview of an offline order as if it was purchased.
|
1940
|
-
*
|
1941
|
-
* The `getOfflineOrderPreview()` function returns a Promise that resolves to a temporary preview of the offline order.
|
1942
|
-
*
|
1943
|
-
* The preview uses the same logic as purchasing a plan, but the preview is not saved. Because an order is not actually created, the preview's `_id` and `subscriptionId` properties are displayed as a string of multiple zero characters (`000000-0000`).
|
1944
|
-
*
|
1945
|
-
* If [taxes are configured](https://support.wix.com/en/article/pricing-plans-setting-up-tax-collection) for the site, taxes are applied to the preview. If not, `tax` previews as `null`.
|
1946
|
-
*
|
1947
|
-
* You can preview the order to check purchase limitations, but the limitations are not enforced for the preview. If a pricing plan has a limit on the amount of purchases per buyer, that limit is not considered for generating the preview. But, if that limit has been reached and this order would then exceed the amount of purchases permitted for this buyer, then `purchaseLimitExceeded` will return as `true`. Thus function is not available to the buyer. You specify the member ID for the buyer whose order should be previewed. To get a general price preview for a plan that's not buyer-specific, use the [`getPricePreview()`](#getpricepreview) function.
|
1948
|
-
* @param memberId - Member ID of the buyer the previewed order is for.
|
1949
|
-
* @public
|
1950
|
-
* @documentationMaturity preview
|
1951
|
-
* @requiredField memberId
|
1952
|
-
* @requiredField planId
|
1953
|
-
* @param options - Options for previewing the offline order.
|
1954
|
-
* @param planId - ID of the plan of the previewed order.
|
1955
|
-
* @permissionScope Manage Orders
|
1956
|
-
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
|
1957
|
-
* @applicableIdentity APP
|
1958
|
-
* @returns Fulfilled - A preview of the order.
|
1959
|
-
*/
|
1960
|
-
export declare function getOfflineOrderPreview(planId: string, memberId: string, options?: GetOfflineOrderPreviewOptions): Promise<GetOfflineOrderPreviewResponse & GetOfflineOrderPreviewResponseNonNullableFields>;
|
1961
|
-
export interface GetOfflineOrderPreviewOptions {
|
1962
|
-
/**
|
1963
|
-
* Start date and time for plan of the previewed order.
|
1964
|
-
*
|
1965
|
-
* Default: Current date and time
|
1966
|
-
*/
|
1967
|
-
startDate?: Date;
|
1968
|
-
/** Coupon code to apply. */
|
1969
|
-
couponCode?: string | null;
|
1970
|
-
}
|
1971
|
-
/**
|
1972
|
-
* Retrieves a preview of an order's pricing as if it was purchased.
|
1973
|
-
*
|
1974
|
-
* The `getPricePreview()` function returns a Promise that resolves to a temporary preview of the order's price.
|
1975
|
-
*
|
1976
|
-
* The price preview uses the same logic for calculating prices as used when purchasing a plan, but the preview is not saved. If [taxes are configured](https://support.wix.com/en/article/pricing-plans-setting-up-tax-collection) for the site, taxes are applied to the preview. If not, the `tax` previews as `null`.
|
1977
|
-
*
|
1978
|
-
* Buyers do not have to be logged in to preview the price, as such, the details returned by this function are not buyer-specific. To generate a preview of a purchase for a specific-buyer, use the [`getOfflineOrderPreview()`](#getofflineorderpreview).
|
1979
|
-
* @param planId - ID of plan to preview.
|
1980
|
-
* @public
|
1981
|
-
* @documentationMaturity preview
|
1982
|
-
* @requiredField planId
|
1983
|
-
* @param options - Options for getting a price preview.
|
1984
|
-
* @permissionScope Read Pricing Plans
|
1985
|
-
* @permissionScopeId SCOPE.DC-PAIDPLANS.READ-PLANS
|
1986
|
-
* @permissionScope Manage Orders
|
1987
|
-
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
|
1988
|
-
* @permissionScope Manage Bookings Services and Settings
|
1989
|
-
* @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
|
1990
|
-
* @permissionScope Read Orders
|
1991
|
-
* @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
|
1992
|
-
* @permissionScope Manage Pricing Plans
|
1993
|
-
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS
|
1994
|
-
* @applicableIdentity APP
|
1995
|
-
* @applicableIdentity MEMBER
|
1996
|
-
* @applicableIdentity VISITOR
|
1997
|
-
* @returns Fulfilled - A preview of the pricing for the order.
|
1998
|
-
*/
|
1999
|
-
export declare function getPricePreview(planId: string, options?: GetPricePreviewOptions): Promise<GetPricePreviewResponse & GetPricePreviewResponseNonNullableFields>;
|
2000
|
-
export interface GetPricePreviewOptions {
|
2001
|
-
/** Coupon code to apply. */
|
2002
|
-
couponCode?: string | null;
|
2003
|
-
}
|
2004
|
-
/**
|
2005
|
-
* Retrieves an order by ID.
|
2006
|
-
*
|
2007
|
-
* The `managementGetOrder()` function returns a Promise that resolves to information about the specified order.
|
2008
|
-
* @param _id - Order ID.
|
2009
|
-
* @public
|
2010
|
-
* @documentationMaturity preview
|
2011
|
-
* @requiredField _id
|
2012
|
-
* @param options - Options to use when getting an order.
|
2013
|
-
* @permissionScope Manage Orders
|
2014
|
-
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
|
2015
|
-
* @permissionScope Manage Bookings Services and Settings
|
2016
|
-
* @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
|
2017
|
-
* @permissionScope Read Orders
|
2018
|
-
* @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
|
2019
|
-
* @applicableIdentity APP
|
2020
|
-
*/
|
2021
|
-
export declare function managementGetOrder(_id: string, options?: ManagementGetOrderOptions): Promise<GetOrderResponse & GetOrderResponseNonNullableFields>;
|
2022
|
-
export interface ManagementGetOrderOptions {
|
2023
|
-
fieldSet?: Set;
|
2024
|
-
}
|
2025
|
-
/**
|
2026
|
-
* Lists pricing plan orders.
|
2027
|
-
*
|
2028
|
-
* The `managementListOrders()` function returns a Promise that resolves to a list of up to 50 pricing plan orders. You can specify options for filtering, sorting, and paginating the results.
|
2029
|
-
*
|
2030
|
-
* This function returns the orders on the site. To list orders for the currently logged-in member, use [`memberListOrders()`](#memberlistorders).
|
2031
|
-
* @public
|
2032
|
-
* @documentationMaturity preview
|
2033
|
-
* @param options - Filtering, sorting, and pagination options.
|
2034
|
-
* @permissionScope Manage Orders
|
2035
|
-
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
|
2036
|
-
* @permissionScope Manage Bookings Services and Settings
|
2037
|
-
* @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
|
2038
|
-
* @permissionScope Read Orders
|
2039
|
-
* @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
|
2040
|
-
* @applicableIdentity APP
|
2041
|
-
*/
|
2042
|
-
export declare function managementListOrders(options?: ManagementListOrdersOptions): Promise<ListOrdersResponse & ListOrdersResponseNonNullableFields>;
|
2043
|
-
export interface ManagementListOrdersOptions {
|
2044
|
-
/** Filter by specific member IDs of buyers who ordered a pricing plan. */
|
2045
|
-
buyerIds?: string[];
|
2046
|
-
/** Filter by specific IDs of plans that were ordered. */
|
2047
|
-
planIds?: string[];
|
2048
|
-
/** Filter by whether or not the auto-renewal of recurring orders was canceled. */
|
2049
|
-
autoRenewCanceled?: boolean | null;
|
2050
|
-
/**
|
2051
|
-
* Filter by the order status. Supported values:
|
2052
|
-
* + `DRAFT`: Order has been initiated but payment hasn't been processed yet. The plan isn't yet available for use to the buyer.
|
2053
|
-
* + `PENDING`: Order has been purchased and its start date is set in the future.
|
2054
|
-
* + `ACTIVE`: Order has been processed. The plan is available for use.
|
2055
|
-
* + `PAUSED`: Order, and use of the plan, is [paused](#pauseorder). The order, and use of the plan, can be [resumed](#resumeorder).
|
2056
|
-
* + `ENDED`: Order has completed its duration and is no longer available for use.
|
2057
|
-
* + `CANCELED`: Order has been [canceled](#cancelorder).
|
2058
|
-
*/
|
2059
|
-
orderStatuses?: OrderStatus[];
|
2060
|
-
/**
|
2061
|
-
* Filter by payment status.
|
2062
|
-
*
|
2063
|
-
* Supported values:
|
2064
|
-
* + `PAID`: The last payment was paid.
|
2065
|
-
* + `REFUNDED`: The last payment was refunded.
|
2066
|
-
* + `FAILED`: The last payment transaction didn't complete.
|
2067
|
-
* + `UNPAID`: The last payment wasn't paid.
|
2068
|
-
* + `PENDING`: Awaiting payment.
|
2069
|
-
* + `NOT_APPLICABLE`: No payment was necessary. For example, for free plans or free trials.
|
2070
|
-
*/
|
2071
|
-
paymentStatuses?: PaymentStatus[];
|
2072
|
-
/**
|
2073
|
-
* Number of pricing plan orders to return.
|
2074
|
-
*
|
2075
|
-
* Default: `50`
|
2076
|
-
*/
|
2077
|
-
limit?: number | null;
|
2078
|
-
/** Number of orders to skip in the current sort order. */
|
2079
|
-
offset?: number | null;
|
2080
|
-
/**
|
2081
|
-
* Sort order.
|
2082
|
-
*
|
2083
|
-
* Use `ASC` for ascending order or `DESC` for descending order.
|
2084
|
-
*
|
2085
|
-
* Default: `DESC`
|
2086
|
-
*/
|
2087
|
-
sorting?: Sorting;
|
2088
|
-
/** Parameter to define amount of fields to return. FULL returns each order's submission data. Supported values: UNKNOWN_SET, BASIC, FULL */
|
2089
|
-
fieldSet?: Set;
|
2090
|
-
}
|
2091
|
-
/**
|
2092
|
-
* Extends the duration of a pricing plan order by postponing the order's `endDate`.
|
2093
|
-
*
|
2094
|
-
* The `postponeEndDate()` function returns a Promise that resolves when the order's end date is successfully changed.
|
2095
|
-
*
|
2096
|
-
* The new end date and time must be later than the order's current `endDate`.
|
2097
|
-
*
|
2098
|
-
* Postponing the end date of an order does not impact payments. For example, if the pricing plan is for a membership to an online lecture series, and you want to extend the duration of the series because the lecturer could not attend some sessions, you can postpone the end date of the orders for all relevant participants. The participants will not be billed additionally.
|
2099
|
-
*
|
2100
|
-
* Postponing an order causes the following changes:
|
2101
|
-
* - The `endDate` for the order is adjusted to the new end date.
|
2102
|
-
* @param _id - Order ID.
|
2103
|
-
* @param endDate - New end date and time.
|
2104
|
-
*
|
2105
|
-
* Must be later than the current end date and time.
|
2106
|
-
* @public
|
2107
|
-
* @documentationMaturity preview
|
2108
|
-
* @requiredField _id
|
2109
|
-
* @requiredField endDate
|
2110
|
-
* @param options - Options for postponing the end date of an order.
|
2111
|
-
* @permissionScope Manage Orders
|
2112
|
-
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
|
2113
|
-
* @applicableIdentity APP
|
2114
|
-
* @returns Fulfilled - When the order's end date has been postponed or made earlier.
|
2115
|
-
*
|
2116
|
-
*
|
2117
|
-
*/
|
2118
|
-
export declare function postponeEndDate(_id: string, endDate: Date): Promise<void>;
|
2119
|
-
/**
|
2120
|
-
* Cancels an existing order.
|
2121
|
-
*
|
2122
|
-
* The `cancelOrder()` function returns a Promise that resolves when the order is successfully canceled.
|
2123
|
-
*
|
2124
|
-
* For orders with recurring payments, a cancellation can be set to occur either `IMMEDIATELY` or at the `NEXT_PAYMENT_DATE`.
|
2125
|
-
* For orders with one-time payments, a cancellation occurs `IMMEDIATELY`.
|
2126
|
-
*
|
2127
|
-
* Canceling an order changes the order status to `CANCELED`.
|
2128
|
-
*
|
2129
|
-
* #### Canceling during the free trial period.
|
2130
|
-
*
|
2131
|
-
* When a site owner cancels an ordered plan during the free trial period, they choose to apply the cancellation `IMMEDIATELY` or at the `NEXT_PAYMENT_DATE`.
|
2132
|
-
*
|
2133
|
-
* Canceling `IMMEDIATELY` will end the subscription for the buyer
|
2134
|
-
* immediately, even during the free trial period and the buyer won't be billed.
|
2135
|
-
*
|
2136
|
-
* Canceling at the `NEXT_PAYMENT_DATE` allows the buyer to continue using the benefits of the subscription until the end of the free trial period. Then, the subscription ends and the buyer is not billed.
|
2137
|
-
* @param _id - Order ID.
|
2138
|
-
* @param effectiveAt - When the order is canceled.
|
2139
|
-
*
|
2140
|
-
* One time orders can only be canceled immediately. Supported values:
|
2141
|
-
* - `"IMMEDIATELY"`: The order is canceled immediately.
|
2142
|
-
* - `"NEXT_PAYMENT_DATE"`: The order is canceled at the next payment date.
|
2143
|
-
* @public
|
2144
|
-
* @documentationMaturity preview
|
2145
|
-
* @requiredField _id
|
2146
|
-
* @requiredField effectiveAt
|
2147
|
-
* @param options - Options for canceling orders.
|
2148
|
-
* @permissionScope Manage Orders
|
2149
|
-
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
|
2150
|
-
* @applicableIdentity APP
|
2151
|
-
* @returns Fulfilled - When the order is canceled.
|
2152
|
-
*/
|
2153
|
-
export declare function cancelOrder(_id: string, effectiveAt: CancellationEffectiveAt): Promise<void>;
|
2154
|
-
/**
|
2155
|
-
* Marks an offline order as paid.
|
2156
|
-
*
|
2157
|
-
* The `markAsPaid()` function returns a Promise that resolves when the offline order is successfully marked as paid.
|
2158
|
-
*
|
2159
|
-
* The entire order is marked as paid, even if the order's payments are recurring.
|
2160
|
-
*
|
2161
|
-
* >**Note:** Marking separate payment cycles as paid is not yet supported. Subsequent offline payments do trigger events and emails, but are not registered as additional offline payments.
|
2162
|
-
*
|
2163
|
-
* Marking an offline order as paid causes the following changes:
|
2164
|
-
* - The order's `lastPaymentStatus` changes to `"PAID"`.
|
2165
|
-
* - The order's status changes to either `"PENDING"` or `"ACTIVE"`, depending on the order's `startDate`.
|
2166
|
-
*
|
2167
|
-
* An error occurs if you attempt to:
|
2168
|
-
* - Mark an already-paid, offline order as paid. You cannot make an offline order as paid twice.
|
2169
|
-
* - Mark an online order as paid. The `markAsPaid()` function is supported for offline orders only.
|
2170
|
-
* @param _id - Order ID.
|
2171
|
-
* @public
|
2172
|
-
* @documentationMaturity preview
|
2173
|
-
* @requiredField _id
|
2174
|
-
* @permissionScope Manage Orders
|
2175
|
-
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
|
2176
|
-
* @applicableIdentity APP
|
2177
|
-
* @returns Fulfilled - When the order is marked as paid.
|
2178
|
-
*/
|
2179
|
-
export declare function markAsPaid(_id: string): Promise<void>;
|
2180
|
-
/**
|
2181
|
-
* Pauses a pricing plan order.
|
2182
|
-
*
|
2183
|
-
* The `pauseOrder()` function returns a Promise that resolves when the order is successfully paused.
|
2184
|
-
*
|
2185
|
-
* For orders with recurring payments, `pauseOrder()` also pauses the payment schedule. Buyers are not charged when an order is paused. Use `pauseOrder()`, for example, if the buyer is away and would like to put their pricing plan membership on hold until they return. Pausing an order affects the end date of the order by adding the time the order is paused to the `endDate`. You can only pause orders with an `"ACTIVE`" status.
|
2186
|
-
*
|
2187
|
-
* Pausing an order causes the following changes:
|
2188
|
-
* - The order status changes to `"PAUSED"`.
|
2189
|
-
* - The `pausePeriods` array is updated.
|
2190
|
-
*
|
2191
|
-
* The `endDate` and the `earliestEndDate` for the order are adjusted to include the pause period when the order is resumed.
|
2192
|
-
*
|
2193
|
-
* Paused orders can be continued with the [`resumeOrder()`](#resumeorder) function.
|
2194
|
-
* @param _id - Order ID.
|
2195
|
-
* @public
|
2196
|
-
* @documentationMaturity preview
|
2197
|
-
* @requiredField _id
|
2198
|
-
* @permissionScope Manage Orders
|
2199
|
-
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
|
2200
|
-
* @applicableIdentity APP
|
2201
|
-
* @returns Fulfilled - When the order is paused.
|
2202
|
-
*/
|
2203
|
-
export declare function pauseOrder(_id: string): Promise<void>;
|
2204
|
-
/**
|
2205
|
-
* Resumes a paused pricing plan order.
|
2206
|
-
*
|
2207
|
-
* The `resumeOrder()` function returns a Promise that resolves when a paused order is successfully resumed.
|
2208
|
-
*
|
2209
|
-
* For orders with recurring payments, `resumeOrder()` also restarts the payment schedule.
|
2210
|
-
*
|
2211
|
-
* Resuming an order causes the following changes:
|
2212
|
-
* - The order status changes to `"ACTIVE"`.
|
2213
|
-
* - The `pausePeriods` array is updated.
|
2214
|
-
* - The `endDate` for the order is adjusted to include the pause period.
|
2215
|
-
* - The `earliestEndDate` is adjusted to include the pause period. (This property is reserved for future use).
|
2216
|
-
* @param _id - Order ID.
|
2217
|
-
* @public
|
2218
|
-
* @documentationMaturity preview
|
2219
|
-
* @requiredField _id
|
2220
|
-
* @permissionScope Manage Orders
|
2221
|
-
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
|
2222
|
-
* @applicableIdentity APP
|
2223
|
-
* @returns Fulfilled - When the order is resumed.
|
2224
|
-
*/
|
2225
|
-
export declare function resumeOrder(_id: string): Promise<void>;
|