@wix/auto_sdk_pricing-plans_orders 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/build/cjs/index.d.ts +1 -0
  2. package/build/cjs/index.js +18 -0
  3. package/build/cjs/index.js.map +1 -0
  4. package/build/cjs/index.typings.d.ts +1 -0
  5. package/build/cjs/index.typings.js +18 -0
  6. package/build/cjs/index.typings.js.map +1 -0
  7. package/build/cjs/meta.d.ts +1 -0
  8. package/build/cjs/meta.js +18 -0
  9. package/build/cjs/meta.js.map +1 -0
  10. package/build/cjs/src/pricing-plans-v2-order-orders.context.d.ts +111 -0
  11. package/build/cjs/src/pricing-plans-v2-order-orders.context.js +126 -0
  12. package/build/cjs/src/pricing-plans-v2-order-orders.context.js.map +1 -0
  13. package/build/cjs/src/pricing-plans-v2-order-orders.http.d.ts +149 -0
  14. package/build/cjs/src/pricing-plans-v2-order-orders.http.js +877 -0
  15. package/build/cjs/src/pricing-plans-v2-order-orders.http.js.map +1 -0
  16. package/build/cjs/src/pricing-plans-v2-order-orders.meta.d.ts +43 -0
  17. package/build/cjs/src/pricing-plans-v2-order-orders.meta.js +313 -0
  18. package/build/cjs/src/pricing-plans-v2-order-orders.meta.js.map +1 -0
  19. package/build/cjs/src/pricing-plans-v2-order-orders.public.d.ts +249 -0
  20. package/build/cjs/src/pricing-plans-v2-order-orders.public.js +373 -0
  21. package/build/cjs/src/pricing-plans-v2-order-orders.public.js.map +1 -0
  22. package/build/cjs/src/pricing-plans-v2-order-orders.types.d.ts +1331 -0
  23. package/build/cjs/src/pricing-plans-v2-order-orders.types.js +145 -0
  24. package/build/cjs/src/pricing-plans-v2-order-orders.types.js.map +1 -0
  25. package/build/cjs/src/pricing-plans-v2-order-orders.universal.d.ts +2015 -0
  26. package/build/cjs/src/pricing-plans-v2-order-orders.universal.js +889 -0
  27. package/build/cjs/src/pricing-plans-v2-order-orders.universal.js.map +1 -0
  28. package/build/es/index.d.ts +1 -0
  29. package/build/es/index.js +2 -0
  30. package/build/es/index.js.map +1 -0
  31. package/build/es/index.typings.d.ts +1 -0
  32. package/build/es/index.typings.js +2 -0
  33. package/build/es/index.typings.js.map +1 -0
  34. package/build/es/meta.d.ts +1 -0
  35. package/build/es/meta.js +2 -0
  36. package/build/es/meta.js.map +1 -0
  37. package/build/es/package.json +3 -0
  38. package/build/es/src/pricing-plans-v2-order-orders.context.d.ts +111 -0
  39. package/build/es/src/pricing-plans-v2-order-orders.context.js +111 -0
  40. package/build/es/src/pricing-plans-v2-order-orders.context.js.map +1 -0
  41. package/build/es/src/pricing-plans-v2-order-orders.http.d.ts +149 -0
  42. package/build/es/src/pricing-plans-v2-order-orders.http.js +859 -0
  43. package/build/es/src/pricing-plans-v2-order-orders.http.js.map +1 -0
  44. package/build/es/src/pricing-plans-v2-order-orders.meta.d.ts +43 -0
  45. package/build/es/src/pricing-plans-v2-order-orders.meta.js +272 -0
  46. package/build/es/src/pricing-plans-v2-order-orders.meta.js.map +1 -0
  47. package/build/es/src/pricing-plans-v2-order-orders.public.d.ts +249 -0
  48. package/build/es/src/pricing-plans-v2-order-orders.public.js +343 -0
  49. package/build/es/src/pricing-plans-v2-order-orders.public.js.map +1 -0
  50. package/build/es/src/pricing-plans-v2-order-orders.types.d.ts +1331 -0
  51. package/build/es/src/pricing-plans-v2-order-orders.types.js +142 -0
  52. package/build/es/src/pricing-plans-v2-order-orders.types.js.map +1 -0
  53. package/build/es/src/pricing-plans-v2-order-orders.universal.d.ts +2015 -0
  54. package/build/es/src/pricing-plans-v2-order-orders.universal.js +848 -0
  55. package/build/es/src/pricing-plans-v2-order-orders.universal.js.map +1 -0
  56. package/build/internal/cjs/index.d.ts +1 -0
  57. package/build/internal/cjs/index.js +18 -0
  58. package/build/internal/cjs/index.js.map +1 -0
  59. package/build/internal/cjs/index.typings.d.ts +1 -0
  60. package/build/internal/cjs/index.typings.js +18 -0
  61. package/build/internal/cjs/index.typings.js.map +1 -0
  62. package/build/internal/cjs/meta.d.ts +1 -0
  63. package/build/internal/cjs/meta.js +18 -0
  64. package/build/internal/cjs/meta.js.map +1 -0
  65. package/build/internal/cjs/src/pricing-plans-v2-order-orders.context.d.ts +111 -0
  66. package/build/internal/cjs/src/pricing-plans-v2-order-orders.context.js +126 -0
  67. package/build/internal/cjs/src/pricing-plans-v2-order-orders.context.js.map +1 -0
  68. package/build/internal/cjs/src/pricing-plans-v2-order-orders.http.d.ts +149 -0
  69. package/build/internal/cjs/src/pricing-plans-v2-order-orders.http.js +877 -0
  70. package/build/internal/cjs/src/pricing-plans-v2-order-orders.http.js.map +1 -0
  71. package/build/internal/cjs/src/pricing-plans-v2-order-orders.meta.d.ts +43 -0
  72. package/build/internal/cjs/src/pricing-plans-v2-order-orders.meta.js +313 -0
  73. package/build/internal/cjs/src/pricing-plans-v2-order-orders.meta.js.map +1 -0
  74. package/build/internal/cjs/src/pricing-plans-v2-order-orders.public.d.ts +249 -0
  75. package/build/internal/cjs/src/pricing-plans-v2-order-orders.public.js +373 -0
  76. package/build/internal/cjs/src/pricing-plans-v2-order-orders.public.js.map +1 -0
  77. package/build/internal/cjs/src/pricing-plans-v2-order-orders.types.d.ts +1333 -0
  78. package/build/internal/cjs/src/pricing-plans-v2-order-orders.types.js +145 -0
  79. package/build/internal/cjs/src/pricing-plans-v2-order-orders.types.js.map +1 -0
  80. package/build/internal/cjs/src/pricing-plans-v2-order-orders.universal.d.ts +2034 -0
  81. package/build/internal/cjs/src/pricing-plans-v2-order-orders.universal.js +889 -0
  82. package/build/internal/cjs/src/pricing-plans-v2-order-orders.universal.js.map +1 -0
  83. package/build/internal/es/index.d.ts +1 -0
  84. package/build/internal/es/index.js +2 -0
  85. package/build/internal/es/index.js.map +1 -0
  86. package/build/internal/es/index.typings.d.ts +1 -0
  87. package/build/internal/es/index.typings.js +2 -0
  88. package/build/internal/es/index.typings.js.map +1 -0
  89. package/build/internal/es/meta.d.ts +1 -0
  90. package/build/internal/es/meta.js +2 -0
  91. package/build/internal/es/meta.js.map +1 -0
  92. package/build/internal/es/src/pricing-plans-v2-order-orders.context.d.ts +111 -0
  93. package/build/internal/es/src/pricing-plans-v2-order-orders.context.js +111 -0
  94. package/build/internal/es/src/pricing-plans-v2-order-orders.context.js.map +1 -0
  95. package/build/internal/es/src/pricing-plans-v2-order-orders.http.d.ts +149 -0
  96. package/build/internal/es/src/pricing-plans-v2-order-orders.http.js +859 -0
  97. package/build/internal/es/src/pricing-plans-v2-order-orders.http.js.map +1 -0
  98. package/build/internal/es/src/pricing-plans-v2-order-orders.meta.d.ts +43 -0
  99. package/build/internal/es/src/pricing-plans-v2-order-orders.meta.js +272 -0
  100. package/build/internal/es/src/pricing-plans-v2-order-orders.meta.js.map +1 -0
  101. package/build/internal/es/src/pricing-plans-v2-order-orders.public.d.ts +249 -0
  102. package/build/internal/es/src/pricing-plans-v2-order-orders.public.js +343 -0
  103. package/build/internal/es/src/pricing-plans-v2-order-orders.public.js.map +1 -0
  104. package/build/internal/es/src/pricing-plans-v2-order-orders.types.d.ts +1333 -0
  105. package/build/internal/es/src/pricing-plans-v2-order-orders.types.js +142 -0
  106. package/build/internal/es/src/pricing-plans-v2-order-orders.types.js.map +1 -0
  107. package/build/internal/es/src/pricing-plans-v2-order-orders.universal.d.ts +2034 -0
  108. package/build/internal/es/src/pricing-plans-v2-order-orders.universal.js +848 -0
  109. package/build/internal/es/src/pricing-plans-v2-order-orders.universal.js.map +1 -0
  110. package/meta/package.json +3 -0
  111. package/package.json +52 -0
@@ -0,0 +1,1331 @@
1
+ /**
2
+ * An order object includes all of the details related to the purchase of a Pricing Plan.
3
+ * You can manage existing orders, create offline orders, and preview orders not yet purchased.
4
+ *
5
+ * Orders are based on pricing models based on the payment and duration cycles for each plan.
6
+ * Learn more about pricing models ([REST](https://dev.wix.com/api/rest/wix-pricing-plans/pricing-plans/introduction#wix-pricing-plans_pricing-plans_introduction_pricing-models)|[SDK](https://dev.wix.com/docs/sdk/backend-modules/pricing-plans/introduction#pricing-models)).
7
+ */
8
+ export interface Order {
9
+ /**
10
+ * Order ID.
11
+ * @readonly
12
+ */
13
+ id?: string;
14
+ /**
15
+ * ID of the plan purchased with the order, from the Plans API.
16
+ * @readonly
17
+ */
18
+ planId?: string;
19
+ /**
20
+ * ID of the related Wix subscription.
21
+ *
22
+ * Every pricing plan order corresponds to a Wix subscription, including orders for single payment plans. Learn more in
23
+ * 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
+ * __Deprecated.__ Use `pricing` instead. This property will be removed on September 30, 2022.
44
+ * @readonly
45
+ * @deprecated __Deprecated.__ Use `pricing` instead. This property will be removed on September 30, 2022.
46
+ * @replacedBy pricing
47
+ * @targetRemovalDate 2022-10-01
48
+ */
49
+ priceDetails?: PriceDetails;
50
+ /**
51
+ * Order pricing model, price, and payment schedule.
52
+ *
53
+ * Learn more about pricing models ([REST](https://dev.wix.com/api/rest/wix-pricing-plans/pricing-plans/introduction#wix-pricing-plans_pricing-plans_introduction_pricing-models) | [SDK](https://dev.wix.com/docs/sdk/backend-modules/pricing-plans/introduction#pricing-models)).
54
+ * @readonly
55
+ */
56
+ pricing?: PricingDetails;
57
+ /**
58
+ * How the order was processed.
59
+ * @readonly
60
+ */
61
+ type?: OrderType;
62
+ /**
63
+ * Status of the order.
64
+ * @readonly
65
+ */
66
+ status?: OrderStatus;
67
+ /**
68
+ * Whether the order will be canceled at the next payment date.
69
+ *
70
+ * If `true`, the order status will be `CANCELED` and the next payment won't be charged. Omitted for single payment orders.
71
+ * @readonly
72
+ */
73
+ autoRenewCanceled?: boolean | null;
74
+ /**
75
+ * Details about the cancellation of an order.
76
+ *
77
+ * Only present if the status is `CANCELED`.
78
+ * @readonly
79
+ */
80
+ cancellation?: Cancellation;
81
+ /**
82
+ * Status of the last payment for the order.
83
+ * Updated automatically for online orders. Updated manually by the Wix user for offline orders.
84
+ * @readonly
85
+ */
86
+ lastPaymentStatus?: PaymentStatus;
87
+ /**
88
+ * Start date and time for the ordered plan.
89
+ * @readonly
90
+ */
91
+ startDate?: Date | null;
92
+ /**
93
+ * Current end date and time for the ordered plan.
94
+ *
95
+ * `endDate` may be updated over the course of an order.
96
+ * If the order is paused, it will have a later `endDate` once it is resumed.
97
+ * `endDate` may also be postponed.
98
+ *
99
+ * Omitted if the order is valid until canceled and still `ACTIVE`.
100
+ * @readonly
101
+ */
102
+ endDate?: Date | null;
103
+ /**
104
+ * List of periods during which the order is paused.
105
+ * @readonly
106
+ */
107
+ pausePeriods?: PausePeriod[];
108
+ /**
109
+ * Free trial period for the order, in days.
110
+ *
111
+ * Only available for recurring plans.
112
+ * @readonly
113
+ */
114
+ freeTrialDays?: number | null;
115
+ /**
116
+ * Earliest end date and time that the plan for the order can expire.
117
+ *
118
+ * Calculated by using the original end date plus any pause periods. Omitted if the order is active until canceled. Reserved for future use.
119
+ * @readonly
120
+ */
121
+ earliestEndDate?: Date | null;
122
+ /**
123
+ * Current payment cycle for the order.
124
+ *
125
+ * `currentCycle` will be omitted if the order's status is `CANCELED` or `ENDED`, or if the `startDate` hasn't passed yet.
126
+ * @readonly
127
+ */
128
+ currentCycle?: CurrentCycle;
129
+ /**
130
+ * Plan name at the time of purchase.
131
+ * @readonly
132
+ */
133
+ planName?: string;
134
+ /**
135
+ * Plan description at the time of purchase
136
+ * @readonly
137
+ */
138
+ planDescription?: string;
139
+ /**
140
+ * Plan price as it was at the moment of order creation.
141
+ * @readonly
142
+ */
143
+ planPrice?: string;
144
+ /**
145
+ * Date and time the order was created.
146
+ * @readonly
147
+ */
148
+ createdDate?: Date | null;
149
+ /**
150
+ * Date and time the order was updated.
151
+ * @readonly
152
+ */
153
+ updatedDate?: Date | null;
154
+ /**
155
+ * Information about the form submitted during the plan's checkout.
156
+ * @readonly
157
+ */
158
+ formData?: FormData;
159
+ }
160
+ export interface Buyer {
161
+ /**
162
+ * Member ID for a Wix site member, from the Members API.
163
+ * @readonly
164
+ */
165
+ memberId?: string;
166
+ /**
167
+ * Contact ID for a Wix site contact, from the Contacts API.
168
+ * @readonly
169
+ */
170
+ contactId?: string;
171
+ }
172
+ export interface PriceDetails extends PriceDetailsPricingModelOneOf {
173
+ /** Order has recurring payments. */
174
+ subscription?: Recurrence;
175
+ /** One-time payment. Order is valid for a specified duration. */
176
+ singlePaymentForDuration?: Duration;
177
+ /** One-time payment. Order is valid until it is canceled. */
178
+ singlePaymentUnlimited?: boolean | null;
179
+ /** Price of the order excluding tax, specified as a monetary amount. for example, `"9.99"`. */
180
+ subtotal?: string;
181
+ /** Total discount applied. */
182
+ discount?: string;
183
+ /** Tax applied. */
184
+ tax?: Tax;
185
+ /**
186
+ * Price after tax and discount is applied, specified as a monetary amount. For example, `"13.98"`.
187
+ *
188
+ * If no tax is applied, the amount is the same as `subtotal`.
189
+ */
190
+ total?: string;
191
+ /** Plan price as it was at the moment of order creation. */
192
+ planPrice?: string;
193
+ /** Currency code. Must be valid ISO 4217 currency code (e.g., USD). */
194
+ currency?: string;
195
+ /** Free trial period for the order in days. Only available for recurring plans. */
196
+ freeTrialDays?: number | null;
197
+ /** Coupon applied to the order. Empty means no coupon was applied. */
198
+ coupon?: Coupon;
199
+ }
200
+ /** @oneof */
201
+ export interface PriceDetailsPricingModelOneOf {
202
+ /** Order has recurring payments. */
203
+ subscription?: Recurrence;
204
+ /** One-time payment. Order is valid for a specified duration. */
205
+ singlePaymentForDuration?: Duration;
206
+ /** One-time payment. Order is valid until it is canceled. */
207
+ singlePaymentUnlimited?: boolean | null;
208
+ }
209
+ export interface Tax {
210
+ /** Name of the tax. For example, VAT. */
211
+ name?: string;
212
+ /** Whether tax is included in the original price. When `false`, tax is added at checkout. */
213
+ includedInPrice?: boolean;
214
+ /** Tax rate percentage, as a number between 0 and 100. For example, a 7% tax rate is `"7.00"`. */
215
+ rate?: string;
216
+ /** Total tax, specified as a monetary amount. For example, `"3.99"`. */
217
+ amount?: string;
218
+ }
219
+ /** An object specifying how often and for how long payments recur (may be forever). */
220
+ export interface Recurrence {
221
+ /**
222
+ * Number of payment cycles the subscription is valid for.
223
+ * `0` for unlimited plans or for plans that are valid until canceled.
224
+ */
225
+ cycleDuration?: Duration;
226
+ /**
227
+ * Length of a payment cycle. For example, 1 month to have monthly payments.
228
+ * Multiply `cycleDuration`'s `count` by `cycleCount` to get the subscription duration.
229
+ * Currently, only a value of `1` is supported.
230
+ */
231
+ cycleCount?: number | null;
232
+ }
233
+ /** A duration expressed in number of time units. */
234
+ export interface Duration {
235
+ /** Number of days, months, weeks, or years in a single payment cycle. Currently limited to support only `1`. */
236
+ count?: number | null;
237
+ /** Unit of time for the cycle duration. */
238
+ unit?: PeriodUnit;
239
+ }
240
+ export declare enum PeriodUnit {
241
+ /** Not defined. */
242
+ UNDEFINED = "UNDEFINED",
243
+ /** Time unit is a day. */
244
+ DAY = "DAY",
245
+ /** Time unit is a week. */
246
+ WEEK = "WEEK",
247
+ /** Time unit is a month. */
248
+ MONTH = "MONTH",
249
+ /** Time unit is a year. */
250
+ YEAR = "YEAR"
251
+ }
252
+ export interface Coupon {
253
+ /** Code of the applied coupon. */
254
+ code?: string;
255
+ /** Total discount of the coupon, as a monetary amount. */
256
+ amount?: string;
257
+ /**
258
+ * Coupon ID.
259
+ * @readonly
260
+ */
261
+ id?: string;
262
+ }
263
+ export interface PricingDetails extends PricingDetailsPricingModelOneOf {
264
+ /** Pricing model for an order with recurring payment cycles. */
265
+ subscription?: Recurrence;
266
+ /** Pricing model for an order with a one-time payment and the order is valid for a specific amount of time. */
267
+ singlePaymentForDuration?: Duration;
268
+ /** Pricing model for an order with a one-time payment and the order is valid until canceled. */
269
+ singlePaymentUnlimited?: boolean | null;
270
+ /**
271
+ * Pricing details for all pricing models.
272
+ * @readonly
273
+ */
274
+ prices?: SpannedPrice[];
275
+ }
276
+ /** @oneof */
277
+ export interface PricingDetailsPricingModelOneOf {
278
+ /** Pricing model for an order with recurring payment cycles. */
279
+ subscription?: Recurrence;
280
+ /** Pricing model for an order with a one-time payment and the order is valid for a specific amount of time. */
281
+ singlePaymentForDuration?: Duration;
282
+ /** Pricing model for an order with a one-time payment and the order is valid until canceled. */
283
+ singlePaymentUnlimited?: boolean | null;
284
+ }
285
+ export interface SpannedPrice {
286
+ /**
287
+ * Cycle duration to apply `price` for.
288
+ *
289
+ * Use with all pricing models.
290
+ * Can apply the same price to multiple payment cycles.
291
+ */
292
+ duration?: PriceDuration;
293
+ /** Order price. */
294
+ price?: Price;
295
+ }
296
+ export interface PriceDuration {
297
+ /**
298
+ * Price starts to apply with this cycle.
299
+ *
300
+ * `1` is the first payment cycle for all pricing models.
301
+ */
302
+ cycleFrom?: number;
303
+ /**
304
+ * Amount of cycles to apply price for.
305
+ *
306
+ * For `subscription` pricing models with a finite number of cycles, the `numberOfCycles` is the same as `pricing.subscription.cycleCount`.
307
+ *
308
+ * For `subscription` pricing models that are unlimited or until-canceled, the `numberOfCycles` is not returned.
309
+ *
310
+ * For `singlePaymentForDuration` and `singlePaymentUnlimited` pricing models, the `numberOfCycles` is `1`.
311
+ */
312
+ numberOfCycles?: number | null;
313
+ }
314
+ export interface Price {
315
+ /** Price of the order excluding tax, specified as a monetary amount. For example, `"9.99"`. */
316
+ subtotal?: string;
317
+ /** Coupon applied to the order, from the Coupons API. */
318
+ coupon?: Coupon;
319
+ /** Total discount applied to the order. */
320
+ discount?: string;
321
+ /**
322
+ * Tax applied to the order.
323
+ *
324
+ * Tax is only applied if the site [has it configured](https://support.wix.com/en/article/pricing-plans-setting-up-tax-collection).
325
+ */
326
+ tax?: Tax;
327
+ /**
328
+ * Price after tax and discount is applied. Specified as a monetary amount, for example, `"13.98"`.
329
+ *
330
+ * If no tax is applied, the amount is the same as `subtotal`.
331
+ */
332
+ total?: string;
333
+ /**
334
+ * Three-letter currency code in
335
+ * [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format.
336
+ */
337
+ currency?: string;
338
+ /** Price change after billing date was change and price was adjusted. Could be positive and negative values. */
339
+ proration?: string;
340
+ }
341
+ export interface Fee {
342
+ /** Fee name */
343
+ name?: string;
344
+ /** Amount of fee to be charged */
345
+ amount?: string;
346
+ }
347
+ export declare enum OrderType {
348
+ /** Undefined order type. */
349
+ UNDEFINED = "UNDEFINED",
350
+ /** The buyer purchased the plan using the site. */
351
+ ONLINE = "ONLINE",
352
+ /** The buyer made a manual, offline purchase without using the site. */
353
+ OFFLINE = "OFFLINE",
354
+ /** The buyer made a purchase through an external payment provider. */
355
+ EXTERNAL = "EXTERNAL"
356
+ }
357
+ export declare enum OrderMethod {
358
+ /** Unknown order method. */
359
+ UNKNOWN = "UNKNOWN",
360
+ /** Mail Order / Telephone Order transaction. */
361
+ MOTO = "MOTO",
362
+ /** Point of Sale transaction. */
363
+ POS = "POS"
364
+ }
365
+ export declare enum OrderStatus {
366
+ /** Undefined order status. */
367
+ UNDEFINED = "UNDEFINED",
368
+ /** Order has been initiated but payment hasn't been processed yet. The plan isn't yet available for use to the buyer. */
369
+ DRAFT = "DRAFT",
370
+ /** Order has been purchased and its start date is set in the future. */
371
+ PENDING = "PENDING",
372
+ /** Order has been processed. The plan is available for use. */
373
+ ACTIVE = "ACTIVE",
374
+ /** Order, and use of the plan, is paused. The order, and use of the plan, can be resumed. */
375
+ PAUSED = "PAUSED",
376
+ /** Order has completed its duration and is no longer available for use. */
377
+ ENDED = "ENDED",
378
+ /** Order has been canceled. */
379
+ CANCELED = "CANCELED"
380
+ }
381
+ export interface Cancellation {
382
+ /** Date and time the cancellation was requested. */
383
+ requestedDate?: Date | null;
384
+ /** Reason for the cancellation. */
385
+ cause?: CancellationCause;
386
+ /** When the cancellation takes effect. Set when cancelling the order. */
387
+ effectiveAt?: CancellationEffectiveAt;
388
+ }
389
+ export declare enum CancellationCause {
390
+ /** Undefined cancellation cause. */
391
+ UNDEFINED = "UNDEFINED",
392
+ /** Wix user canceled the order. */
393
+ OWNER_ACTION = "OWNER_ACTION",
394
+ /** Buyer initiated the cancellation. */
395
+ MEMBER_ACTION = "MEMBER_ACTION",
396
+ /** Payment transaction failed. */
397
+ PAYMENT_FAILURE = "PAYMENT_FAILURE",
398
+ /** Buyer's payment details weren't set up correctly. */
399
+ PAYMENT_SETUP_FAILURE = "PAYMENT_SETUP_FAILURE",
400
+ /** Reason for the cancellation is unknown. */
401
+ UNKNOWN = "UNKNOWN"
402
+ }
403
+ export declare enum CancellationEffectiveAt {
404
+ /** Undefined cancellation time. */
405
+ UNDEFINED = "UNDEFINED",
406
+ /** Cancellation occurs immediately and the buyer can no longer use the plan. */
407
+ IMMEDIATELY = "IMMEDIATELY",
408
+ /** Cancellation occurs at the next payment date and time. Buyer can continue to use the plan until that date and time. */
409
+ NEXT_PAYMENT_DATE = "NEXT_PAYMENT_DATE"
410
+ }
411
+ export declare enum PaymentStatus {
412
+ /** Undefined payment status. */
413
+ UNDEFINED = "UNDEFINED",
414
+ /** Payment has been paid. */
415
+ PAID = "PAID",
416
+ /** Payment has been refunded. */
417
+ REFUNDED = "REFUNDED",
418
+ /** Payment transaction didn't complete. */
419
+ FAILED = "FAILED",
420
+ /** Payment has not been paid. */
421
+ UNPAID = "UNPAID",
422
+ /** Billing has been initialized, but actual charge is yet to be made. This can happen for free trials and payments made with PayPal. */
423
+ PENDING = "PENDING",
424
+ /** No payment was necessary. For example, for free plans or free trials. */
425
+ NOT_APPLICABLE = "NOT_APPLICABLE"
426
+ }
427
+ export interface PausePeriod {
428
+ /** Status of the pause period. */
429
+ status?: Status;
430
+ /** Start date and time of the pause period. */
431
+ pauseDate?: Date | null;
432
+ /**
433
+ * End date and time of the pause period.
434
+ *
435
+ * Omitted while the pause period remains `ACTIVE`.
436
+ */
437
+ resumeDate?: Date | null;
438
+ }
439
+ export declare enum Status {
440
+ /** Undefined status. */
441
+ UNDEFINED = "UNDEFINED",
442
+ /** Status while the order is paused. */
443
+ ACTIVE = "ACTIVE",
444
+ /** Status when the order is resumed. */
445
+ ENDED = "ENDED"
446
+ }
447
+ /**
448
+ * Current cycle will be empty when order is cancelled, expired or order start date is in the future
449
+ * Current cycle start and end dates take into account free trial days and suspensions
450
+ */
451
+ export interface CurrentCycle {
452
+ /**
453
+ * Index of the current payment cycle in the order.
454
+ *
455
+ * `0` when order is in a free trial period. In all other cases, the index starts with `1`.
456
+ */
457
+ index?: number;
458
+ /** Start date and time for the current payment cycle. */
459
+ startedDate?: Date | null;
460
+ /** End date and time for the current payment cycle. */
461
+ endedDate?: Date | null;
462
+ }
463
+ /** Order cycle start and end dates take into account free trial days and suspensions */
464
+ export interface OrderCycle {
465
+ /**
466
+ * Index of this cycle in the order.
467
+ *
468
+ * `0` when order is in a free trial period. In all other cases, the index starts with `1`.
469
+ */
470
+ index?: number;
471
+ /** Start date and time for this order cycle. */
472
+ startedDate?: Date | null;
473
+ /** End date and time for this order cycle. */
474
+ endedDate?: Date | null;
475
+ }
476
+ export interface FormData {
477
+ /** ID of the order form ([REST](https://dev.wix.com/docs/rest/api-reference/wix-forms/form-submissions/introduction)|[SDK](https://dev.wix.com/docs/sdk/backend-modules/forms/submissions/introduction)) associated with the plan at checkout. */
478
+ formId?: string | null;
479
+ /** 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. */
480
+ submissionId?: string | null;
481
+ /**
482
+ * Data submitted to the plan's order form at checkout.
483
+ * @readonly
484
+ */
485
+ submissionData?: Record<string, any>;
486
+ }
487
+ export interface DomainEvent extends DomainEventBodyOneOf {
488
+ createdEvent?: EntityCreatedEvent;
489
+ updatedEvent?: EntityUpdatedEvent;
490
+ deletedEvent?: EntityDeletedEvent;
491
+ actionEvent?: ActionEvent;
492
+ /**
493
+ * Unique event ID.
494
+ * Allows clients to ignore duplicate webhooks.
495
+ */
496
+ id?: string;
497
+ /**
498
+ * Assumes actions are also always typed to an entity_type
499
+ * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
500
+ */
501
+ entityFqdn?: string;
502
+ /**
503
+ * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
504
+ * This is although the created/updated/deleted notion is duplication of the oneof types
505
+ * Example: created/updated/deleted/started/completed/email_opened
506
+ */
507
+ slug?: string;
508
+ /** ID of the entity associated with the event. */
509
+ entityId?: string;
510
+ /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
511
+ eventTime?: Date | null;
512
+ /**
513
+ * Whether the event was triggered as a result of a privacy regulation application
514
+ * (for example, GDPR).
515
+ */
516
+ triggeredByAnonymizeRequest?: boolean | null;
517
+ /** If present, indicates the action that triggered the event. */
518
+ originatedFrom?: string | null;
519
+ /**
520
+ * A sequence number defining the order of updates to the underlying entity.
521
+ * For example, given that some entity was updated at 16:00 and than again at 16:01,
522
+ * it is guaranteed that the sequence number of the second update is strictly higher than the first.
523
+ * As the consumer, you can use this value to ensure that you handle messages in the correct order.
524
+ * To do so, you will need to persist this number on your end, and compare the sequence number from the
525
+ * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
526
+ */
527
+ entityEventSequence?: string | null;
528
+ }
529
+ /** @oneof */
530
+ export interface DomainEventBodyOneOf {
531
+ createdEvent?: EntityCreatedEvent;
532
+ updatedEvent?: EntityUpdatedEvent;
533
+ deletedEvent?: EntityDeletedEvent;
534
+ actionEvent?: ActionEvent;
535
+ }
536
+ export interface EntityCreatedEvent {
537
+ entityAsJson?: string;
538
+ /** Indicates the event was triggered by a restore-from-trashbin operation for a previously deleted entity */
539
+ restoreInfo?: RestoreInfo;
540
+ }
541
+ export interface RestoreInfo {
542
+ deletedDate?: Date | null;
543
+ }
544
+ export interface EntityUpdatedEvent {
545
+ /**
546
+ * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
547
+ * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
548
+ * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
549
+ */
550
+ currentEntityAsJson?: string;
551
+ }
552
+ export interface EntityDeletedEvent {
553
+ /** Entity that was deleted */
554
+ deletedEntityAsJson?: string | null;
555
+ }
556
+ export interface ActionEvent {
557
+ bodyAsJson?: string;
558
+ }
559
+ export interface Empty {
560
+ }
561
+ export interface MemberGetOrderRequest {
562
+ /** Order ID. */
563
+ id: string;
564
+ /**
565
+ * Predefined set of fields to return.
566
+ *
567
+ * Default: If `fieldSet` is omitted, no order form submission data is returned.
568
+ */
569
+ fieldSet?: Set;
570
+ }
571
+ export declare enum Set {
572
+ /** Same behavior as `BASIC`.` */
573
+ UNKNOWN_SET = "UNKNOWN_SET",
574
+ /** Doesn't return any order form submission data. */
575
+ BASIC = "BASIC",
576
+ /** Returns all order form submission data. */
577
+ FULL = "FULL"
578
+ }
579
+ export interface MemberGetOrderResponse {
580
+ /** Requested order. */
581
+ order?: Order;
582
+ }
583
+ export interface MemberListOrdersRequest {
584
+ /** Filter by plan IDs. */
585
+ planIds?: string[];
586
+ /** Filter for orders where auto renewal was canceled. */
587
+ autoRenewCanceled?: boolean | null;
588
+ /** Filter by order status. */
589
+ orderStatuses?: OrderStatus[];
590
+ /** Filter by payment status. */
591
+ paymentStatuses?: PaymentStatus[];
592
+ /** Limit the number of pricing plans returned. Default limit is 50. */
593
+ limit?: number | null;
594
+ /** Number of entries to offset. */
595
+ offset?: number | null;
596
+ /** Sorting direction (defaults to ASC) and field to sort by. */
597
+ sorting?: Sorting;
598
+ /**
599
+ * Predefined set of fields to return.
600
+ *
601
+ * Default: If `fieldSet` is omitted, no order form submission data is returned.
602
+ */
603
+ fieldSet?: Set;
604
+ }
605
+ export interface Sorting {
606
+ /** Name of the field to sort by. */
607
+ fieldName?: string;
608
+ /** Sort order. */
609
+ order?: SortOrder;
610
+ }
611
+ export declare enum SortOrder {
612
+ ASC = "ASC",
613
+ DESC = "DESC"
614
+ }
615
+ export interface MemberListOrdersResponse {
616
+ /** Requested orders. */
617
+ orders?: Order[];
618
+ /** Object containing paging-related data (number of orders returned, offset). */
619
+ pagingMetadata?: PagingMetadataV2;
620
+ }
621
+ export interface PagingMetadataV2 {
622
+ /** Number of items returned in the response. */
623
+ count?: number | null;
624
+ /** Offset that was requested. */
625
+ offset?: number | null;
626
+ /** Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. */
627
+ total?: number | null;
628
+ /** Flag that indicates the server failed to calculate the `total` field. */
629
+ tooManyToCount?: boolean | null;
630
+ /** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */
631
+ cursors?: Cursors;
632
+ }
633
+ export interface Cursors {
634
+ /** Cursor string pointing to the next page in the list of results. */
635
+ next?: string | null;
636
+ /** Cursor pointing to the previous page in the list of results. */
637
+ prev?: string | null;
638
+ }
639
+ /**
640
+ * TODO: Write orders filter and sort docs page
641
+ * Retrieves a list of up to 1,000 orders, based on the provided paging, sorting, and filtering.
642
+ */
643
+ export interface QueryOrdersRequest {
644
+ /** Query filter. */
645
+ query?: QueryV2;
646
+ }
647
+ export interface QueryV2 extends QueryV2PagingMethodOneOf {
648
+ /** Paging options to limit and skip the number of items. */
649
+ paging?: Paging;
650
+ /** 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`. */
651
+ cursorPaging?: CursorPaging;
652
+ /**
653
+ * Filter object.
654
+ *
655
+ * Learn more about the [filter section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-filter-section).
656
+ */
657
+ filter?: Record<string, any> | null;
658
+ /**
659
+ * Sort object.
660
+ *
661
+ * Learn more about the [sort section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-sort-section).
662
+ */
663
+ sort?: Sorting[];
664
+ /** 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. */
665
+ fields?: string[];
666
+ /** 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. */
667
+ fieldsets?: string[];
668
+ }
669
+ /** @oneof */
670
+ export interface QueryV2PagingMethodOneOf {
671
+ /** Paging options to limit and skip the number of items. */
672
+ paging?: Paging;
673
+ /** 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`. */
674
+ cursorPaging?: CursorPaging;
675
+ }
676
+ export interface Paging {
677
+ /** Number of items to load. */
678
+ limit?: number | null;
679
+ /** Number of items to skip in the current sort order. */
680
+ offset?: number | null;
681
+ }
682
+ export interface CursorPaging {
683
+ /** Maximum number of items to return in the results. */
684
+ limit?: number | null;
685
+ /**
686
+ * Pointer to the next or previous page in the list of results.
687
+ *
688
+ * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.
689
+ * Not relevant for the first request.
690
+ */
691
+ cursor?: string | null;
692
+ }
693
+ export interface QueryOrdersResponse {
694
+ /** Order data. */
695
+ plans?: Order[];
696
+ /** Paging-related data (number of orders returned, offset). */
697
+ pagingMetadata?: PagingMetadataV2;
698
+ }
699
+ export interface RequestCancellationRequest {
700
+ /** Order ID. */
701
+ id: string;
702
+ /** Required. Whether to cancel the order effective immediately or at the next payment date. One-time orders can only be canceled immediately. */
703
+ effectiveAt: CancellationEffectiveAt;
704
+ }
705
+ export interface RequestCancellationResponse {
706
+ }
707
+ /**
708
+ * Emitted when an order is canceled immediately or when cycle ends for an order with canceled auto renewal
709
+ *
710
+ * To determine the specific reason of the cancellation check `order.cancellation.cause` field.
711
+ */
712
+ export interface OrderCanceled {
713
+ /** Canceled order. */
714
+ order?: Order;
715
+ }
716
+ export interface MessageEnvelope {
717
+ /** App instance ID. */
718
+ instanceId?: string | null;
719
+ /** Event type. */
720
+ eventType?: string;
721
+ /** The identification type and identity data. */
722
+ identity?: IdentificationData;
723
+ /** Stringify payload. */
724
+ data?: string;
725
+ }
726
+ export interface IdentificationData extends IdentificationDataIdOneOf {
727
+ /** ID of a site visitor that has not logged in to the site. */
728
+ anonymousVisitorId?: string;
729
+ /** ID of a site visitor that has logged in to the site. */
730
+ memberId?: string;
731
+ /** ID of a Wix user (site owner, contributor, etc.). */
732
+ wixUserId?: string;
733
+ /** ID of an app. */
734
+ appId?: string;
735
+ /** @readonly */
736
+ identityType?: WebhookIdentityType;
737
+ }
738
+ /** @oneof */
739
+ export interface IdentificationDataIdOneOf {
740
+ /** ID of a site visitor that has not logged in to the site. */
741
+ anonymousVisitorId?: string;
742
+ /** ID of a site visitor that has logged in to the site. */
743
+ memberId?: string;
744
+ /** ID of a Wix user (site owner, contributor, etc.). */
745
+ wixUserId?: string;
746
+ /** ID of an app. */
747
+ appId?: string;
748
+ }
749
+ export declare enum WebhookIdentityType {
750
+ UNKNOWN = "UNKNOWN",
751
+ ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
752
+ MEMBER = "MEMBER",
753
+ WIX_USER = "WIX_USER",
754
+ APP = "APP"
755
+ }
756
+ export interface CreateOnlineOrderRequest {
757
+ /** Plan ID. */
758
+ planId: string;
759
+ /**
760
+ * Start date and time for the plan of the online order in a `YYYY-MM-DDThh:mm[:ss][.sss]Z` format.
761
+ *
762
+ * Default: Current date and time.
763
+ */
764
+ startDate?: Date | null;
765
+ /** Coupon code to apply. */
766
+ couponCode?: string | null;
767
+ /** Provided if checkout is initiated on buyer's behalf. */
768
+ onBehalf?: OnBehalf;
769
+ /** Submission ID of the form submitted with this order. */
770
+ submissionId?: string | null;
771
+ }
772
+ export interface OnBehalf {
773
+ /** Member ID. */
774
+ memberId?: string;
775
+ /** Method by which checkout is initiated. */
776
+ orderMethod?: OrderMethod;
777
+ }
778
+ export interface CreateOnlineOrderResponse {
779
+ /** Created online order. */
780
+ order?: Order;
781
+ }
782
+ export interface CouponsError {
783
+ /** Coupon code. */
784
+ couponCode?: string;
785
+ /** Plan ID. */
786
+ planId?: string;
787
+ }
788
+ export interface CreateGuestOnlineOrderRequest {
789
+ /** Plan ID. */
790
+ planId?: string;
791
+ /**
792
+ * Start date for the ordered plan.
793
+ *
794
+ * Default: Current date
795
+ */
796
+ startDate?: Date | null;
797
+ /** Coupon code to apply. */
798
+ couponCode?: string | null;
799
+ /** Captcha data to prove you are not a robot */
800
+ captcha?: Captcha;
801
+ /** Visitor info */
802
+ guest?: Guest;
803
+ /** Form submission id that was submitted together with the order */
804
+ submissionId?: string | null;
805
+ }
806
+ export interface Captcha {
807
+ /** Token from captcha */
808
+ token?: string;
809
+ }
810
+ export interface Guest {
811
+ /** Email for checkout */
812
+ email?: string;
813
+ }
814
+ export interface CreateGuestOnlineOrderResponse {
815
+ /** Order. */
816
+ order?: Order;
817
+ }
818
+ export interface CreateOfflineOrderRequest {
819
+ /** ID of the plan being ordered, from the Plans API. */
820
+ planId: string;
821
+ /** ID of the member ordering the plan, from the Members API. */
822
+ memberId: string;
823
+ /**
824
+ * Start date and time for the ordered plan in a `YYYY-MM-DDThh:mm[:ss][.sss]Z` format.
825
+ *
826
+ * Default: Current date and time.
827
+ */
828
+ startDate?: Date | null;
829
+ /**
830
+ * Whether the order is paid.
831
+ *
832
+ * Default: `false`
833
+ */
834
+ paid?: boolean | null;
835
+ /** Coupon code to apply, from the Coupons API. */
836
+ couponCode?: string | null;
837
+ /** Form submission ID that was submitted with the order. */
838
+ submissionId?: string | null;
839
+ }
840
+ export interface CreateOfflineOrderResponse {
841
+ /** Order. */
842
+ order?: Order;
843
+ }
844
+ export interface CreateExternalOrderRequest {
845
+ /** Plan ID. */
846
+ planId?: string;
847
+ /** Form submission id that was submitted together with the order */
848
+ submissionId?: string | null;
849
+ }
850
+ export interface CreateExternalOrderResponse {
851
+ /** Created order */
852
+ order?: Order;
853
+ }
854
+ export interface GetOnlineOrderPreviewRequest {
855
+ /** Plan ID. */
856
+ planId: string;
857
+ /**
858
+ * Start date and time for the plan of the order preview in a `YYYY-MM-DDThh:mm[:ss][.sss]Z` format.
859
+ *
860
+ * Default: Current date and time.
861
+ */
862
+ startDate?: Date | null;
863
+ /** Coupon code to apply. */
864
+ couponCode?: string | null;
865
+ }
866
+ export interface GetOnlineOrderPreviewResponse {
867
+ /** Order preview. This field is undefined if the member has already reached the purchase limit for the order's plan. */
868
+ order?: Order;
869
+ /** Whether the member has already reached purchase limit for the order's plan. */
870
+ purchaseLimitExceeded?: boolean;
871
+ }
872
+ export interface GetGuestOnlineOrderPreviewRequest {
873
+ /** Plan ID. */
874
+ planId?: string;
875
+ /**
876
+ * Start date for the ordered plan.
877
+ *
878
+ * Default: Current date
879
+ */
880
+ startDate?: Date | null;
881
+ /** Coupon code to apply. */
882
+ couponCode?: string | null;
883
+ /** Email for checkout */
884
+ email?: string;
885
+ }
886
+ export interface GetGuestOnlineOrderPreviewResponse {
887
+ /** Will be missing if limit is exceeded */
888
+ order?: Order;
889
+ /**
890
+ * Whether the purchase limit has already been reached for this plan by this email.
891
+ * Always false for plans without purchase limits.
892
+ */
893
+ purchaseLimitExceeded?: boolean;
894
+ }
895
+ export interface GetOfflineOrderPreviewRequest {
896
+ /** ID of the plan of the previewed order, from the Plans API. */
897
+ planId: string;
898
+ /** Member ID of the buyer the previewed order is for, from the Members API. */
899
+ memberId: string;
900
+ /**
901
+ * Start date and time for plan of the previewed order in a `YYYY-MM-DDThh:mm[:ss][.sss]Z` format.
902
+ *
903
+ * Default: Current date and time.
904
+ */
905
+ startDate?: Date | null;
906
+ /** Coupon code to apply, from the Coupons API. */
907
+ couponCode?: string | null;
908
+ }
909
+ export interface GetOfflineOrderPreviewResponse {
910
+ /** The previewed order, as if the plan had been ordered. */
911
+ order?: Order;
912
+ /**
913
+ * Whether this previewed order would exceed the permitted amount of purchases available
914
+ * for this plan for this buyer.
915
+ *
916
+ * Always `false` for plans that do not have purchase limits.
917
+ */
918
+ purchaseLimitExceeded?: boolean;
919
+ }
920
+ export interface GetPricePreviewRequest {
921
+ /** ID of plan to preview. */
922
+ planId: string;
923
+ /** Coupon code to apply, from the Coupons API. */
924
+ couponCode?: string | null;
925
+ }
926
+ export interface GetPricePreviewResponse {
927
+ /**
928
+ * __Deprecated.__ Use `prices` instead. This property will be removed on September 30, 2022.
929
+ * @deprecated __Deprecated.__ Use `prices` instead. This property will be removed on September 30, 2022.
930
+ * @replacedBy prices
931
+ * @targetRemovalDate 2022-10-01
932
+ */
933
+ price?: PriceDetails;
934
+ /** Pricing details. */
935
+ prices?: SpannedPrice[];
936
+ }
937
+ export interface ChangeStartDateRequest {
938
+ /** Draft order ID. */
939
+ orderId?: string;
940
+ /** New valid from date (timestamp). */
941
+ startDate?: Date | null;
942
+ }
943
+ export interface ChangeStartDateResponse {
944
+ /** Updated draft order. */
945
+ order?: Order;
946
+ }
947
+ export interface OrderStartDateChanged {
948
+ /** Order whose `startDate` changed. */
949
+ order?: Order;
950
+ }
951
+ export interface ApplyCouponRequest {
952
+ /** Draft order ID. */
953
+ orderId?: string;
954
+ /** Coupon code to apply. */
955
+ couponCode?: string;
956
+ }
957
+ export interface ApplyCouponResponse {
958
+ /** Order with applied coupon and recalculated tax. */
959
+ order?: Order;
960
+ }
961
+ export interface SetSubmissionRequest {
962
+ /** Order ID. */
963
+ orderId?: string;
964
+ /** Submission ID. */
965
+ submissionId?: string;
966
+ }
967
+ export interface SetSubmissionResponse {
968
+ /** Order with submission id */
969
+ order?: Order;
970
+ }
971
+ export interface OrderPurchased {
972
+ /** Order that was paid for. If a free or an offline order, the order that was created. */
973
+ order?: Order;
974
+ }
975
+ export interface OrderStarted {
976
+ /** Order that reached its `startDate`. */
977
+ order?: Order;
978
+ }
979
+ /**
980
+ * Triggered at the start of a new payment cycle for an existing order.
981
+ *
982
+ * This webhook does not trigger at the initial start of an offline order.
983
+ */
984
+ export interface OrderCycleStarted {
985
+ /** Order whose new cycle started. */
986
+ order?: Order;
987
+ /** 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. */
988
+ cycleNumber?: number;
989
+ }
990
+ /** Emitted when a recurring order is canceled for the next payment cycle */
991
+ export interface OrderAutoRenewCanceled {
992
+ /** Order that is canceled, effective at the end of the current payment cycle. */
993
+ order?: Order;
994
+ }
995
+ export interface OrderEnded {
996
+ /** Order that ended. */
997
+ order?: Order;
998
+ }
999
+ export interface GetOrderRequest {
1000
+ /** Order ID. */
1001
+ id: string;
1002
+ /**
1003
+ * Predefined set of fields to return.
1004
+ *
1005
+ * Default: If `fieldSet` is omitted, no order form submission data is returned.
1006
+ */
1007
+ fieldSet?: Set;
1008
+ }
1009
+ export interface GetOrderResponse {
1010
+ /** Order. */
1011
+ order?: Order;
1012
+ }
1013
+ export interface ListOrdersRequest {
1014
+ /** Filter by a buyer's member ID, from the Members API. */
1015
+ buyerIds?: string[];
1016
+ /** Filter by plan IDs, from the Plans API. */
1017
+ planIds?: string[];
1018
+ /** Filter by whether or not the auto-renewal of recurring orders was canceled. */
1019
+ autoRenewCanceled?: boolean | null;
1020
+ /** Filter by order status. */
1021
+ orderStatuses?: OrderStatus[];
1022
+ /** Filter by payment status. */
1023
+ paymentStatuses?: PaymentStatus[];
1024
+ /**
1025
+ * Number of orders to return. See Sorting and Paging for more information.
1026
+ *
1027
+ * Max: `50`
1028
+ */
1029
+ limit?: number | null;
1030
+ /** Number of orders to skip in the current sort order. */
1031
+ offset?: number | null;
1032
+ /**
1033
+ * Sort order.
1034
+ *
1035
+ * Use `ASC` for ascending order or `DESC` for descending order.
1036
+ *
1037
+ * Default: `DESC`.
1038
+ */
1039
+ sorting?: Sorting;
1040
+ /**
1041
+ * Predefined set of fields to return.
1042
+ *
1043
+ * Default: If `fieldSet` is omitted, no order form submission data is returned.
1044
+ */
1045
+ fieldSet?: Set;
1046
+ }
1047
+ export interface ListOrdersResponse {
1048
+ /** List of orders. */
1049
+ orders?: Order[];
1050
+ /** Object containing paging-related data (number of orders returned, offset). */
1051
+ pagingMetadata?: PagingMetadataV2;
1052
+ }
1053
+ export interface OrdersQueryOrdersRequest {
1054
+ /** Query filter. */
1055
+ query?: QueryV2;
1056
+ }
1057
+ export interface OrdersQueryOrdersResponse {
1058
+ /** Retrieved orders. */
1059
+ plans?: Order[];
1060
+ /** Paging-related data (number of orders returned, offset). */
1061
+ pagingMetadata?: PagingMetadataV2;
1062
+ }
1063
+ export interface GetOrdersStatsRequest {
1064
+ }
1065
+ export interface GetOrdersStatsResponse {
1066
+ /** Total number of orders. */
1067
+ totalOrderCount?: number;
1068
+ /** Number of active orders. */
1069
+ activeOrderCount?: number;
1070
+ }
1071
+ export interface GetAvailableOrderActionsRequest {
1072
+ /** Order ID. */
1073
+ id?: string;
1074
+ }
1075
+ export interface GetAvailableOrderActionsResponse {
1076
+ /** Whether the order can be suspended. */
1077
+ suspendable?: boolean;
1078
+ /** If the order cannot be suspended, a reason is returned here. */
1079
+ notSuspendableReason?: ReasonNotSuspendable;
1080
+ /** Whether the order can be canceled by the buyer. */
1081
+ cancelableByBuyer?: boolean;
1082
+ }
1083
+ export declare enum ReasonNotSuspendable {
1084
+ /** Undefined reason. */
1085
+ UNDEFINED = "UNDEFINED",
1086
+ /** Saved in the database but is awaiting payment. Non-active orders can't be suspended. */
1087
+ PENDING = "PENDING",
1088
+ /** Trial orders can't be suspended. */
1089
+ TRIAL = "TRIAL",
1090
+ /** Canceled orders can't be suspended. */
1091
+ CANCELED = "CANCELED",
1092
+ /** Ended orders can't be suspended. */
1093
+ ENDED = "ENDED",
1094
+ /** Paid for orders with future start dates can't be suspended. */
1095
+ NOT_STARTED = "NOT_STARTED",
1096
+ /** Order is already suspended. */
1097
+ ALREADY_SUSPENDED = "ALREADY_SUSPENDED",
1098
+ /** Orders based on recurring payments using older stripe versions can't be suspended. */
1099
+ OLD_STRIPE = "OLD_STRIPE"
1100
+ }
1101
+ export interface PostponeEndDateRequest {
1102
+ /** Order ID. */
1103
+ id: string;
1104
+ /**
1105
+ * New end date and time.
1106
+ *
1107
+ * Must be later than the current end date and time.
1108
+ */
1109
+ endDate: Date | null;
1110
+ }
1111
+ export interface PostponeEndDateResponse {
1112
+ }
1113
+ export interface OrderEndDatePostponed {
1114
+ /** Order whose `endDate` was postponed. */
1115
+ order?: Order;
1116
+ }
1117
+ export interface CancelOrderRequest {
1118
+ /** Order ID. */
1119
+ id: string;
1120
+ /** __Required.__ When the order will be canceled. One-time orders can only be canceled `IMMEDIATELY`. */
1121
+ effectiveAt: CancellationEffectiveAt;
1122
+ }
1123
+ export interface CancelOrderResponse {
1124
+ }
1125
+ export interface MarkAsPaidRequest {
1126
+ /** Order ID. */
1127
+ id: string;
1128
+ }
1129
+ export interface MarkAsPaidResponse {
1130
+ }
1131
+ export interface OrderMarkedAsPaid {
1132
+ /** Order that was marked as paid. */
1133
+ order?: Order;
1134
+ }
1135
+ export interface PauseOrderRequest {
1136
+ /** Order ID. */
1137
+ id: string;
1138
+ }
1139
+ export interface PauseOrderResponse {
1140
+ }
1141
+ export interface OrderPaused {
1142
+ /** Paused order. */
1143
+ order?: Order;
1144
+ }
1145
+ export interface BulkPauseOrderRequest {
1146
+ /** List of Order IDs. */
1147
+ ids?: string[];
1148
+ /** Set to true to return Order entity in response. */
1149
+ returnFullEntity?: boolean;
1150
+ }
1151
+ export interface BulkPauseOrderResponse {
1152
+ /** Orders that were paused. */
1153
+ results?: BulkOrderResult[];
1154
+ /** Bulk action metadata. */
1155
+ bulkActionMetadata?: BulkActionMetadata;
1156
+ }
1157
+ export interface BulkOrderResult {
1158
+ /** Item metadata */
1159
+ itemMetadata?: ItemMetadata;
1160
+ /** The order. */
1161
+ order?: Order;
1162
+ }
1163
+ export interface ItemMetadata {
1164
+ /** Item ID. Should always be available, unless it's impossible (for example, when failing to create an item). */
1165
+ id?: string | null;
1166
+ /** Index of the item within the request array. Allows for correlation between request and response items. */
1167
+ originalIndex?: number;
1168
+ /** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */
1169
+ success?: boolean;
1170
+ /** Details about the error in case of failure. */
1171
+ error?: ApplicationError;
1172
+ }
1173
+ export interface ApplicationError {
1174
+ /** Error code. */
1175
+ code?: string;
1176
+ /** Description of the error. */
1177
+ description?: string;
1178
+ /** Data related to the error. */
1179
+ data?: Record<string, any> | null;
1180
+ }
1181
+ export interface BulkActionMetadata {
1182
+ /** Number of items that were successfully processed. */
1183
+ totalSuccesses?: number;
1184
+ /** Number of items that couldn't be processed. */
1185
+ totalFailures?: number;
1186
+ /** Number of failures without details because detailed failure threshold was exceeded. */
1187
+ undetailedFailures?: number;
1188
+ }
1189
+ export interface ResumeOrderRequest {
1190
+ /** Order ID. */
1191
+ id: string;
1192
+ }
1193
+ export interface ResumeOrderResponse {
1194
+ }
1195
+ export interface OrderResumed {
1196
+ /** Resumed order. */
1197
+ order?: Order;
1198
+ }
1199
+ export interface BulkResumeOrderRequest {
1200
+ /** List of Order IDs. */
1201
+ ids?: string[];
1202
+ /** Set to true to return Order entity in response. */
1203
+ returnFullEntity?: boolean;
1204
+ }
1205
+ export interface BulkResumeOrderResponse {
1206
+ /** Orders that were resumed. */
1207
+ results?: BulkOrderResult[];
1208
+ /** Bulk action metadata. */
1209
+ bulkActionMetadata?: BulkActionMetadata;
1210
+ }
1211
+ interface BuyerNonNullableFields {
1212
+ memberId: string;
1213
+ contactId: string;
1214
+ }
1215
+ interface DurationNonNullableFields {
1216
+ unit: PeriodUnit;
1217
+ }
1218
+ interface RecurrenceNonNullableFields {
1219
+ cycleDuration?: DurationNonNullableFields;
1220
+ }
1221
+ interface TaxNonNullableFields {
1222
+ name: string;
1223
+ includedInPrice: boolean;
1224
+ rate: string;
1225
+ amount: string;
1226
+ }
1227
+ interface CouponNonNullableFields {
1228
+ code: string;
1229
+ amount: string;
1230
+ id: string;
1231
+ }
1232
+ interface PriceDetailsNonNullableFields {
1233
+ subscription?: RecurrenceNonNullableFields;
1234
+ singlePaymentForDuration?: DurationNonNullableFields;
1235
+ subtotal: string;
1236
+ discount: string;
1237
+ tax?: TaxNonNullableFields;
1238
+ total: string;
1239
+ planPrice: string;
1240
+ currency: string;
1241
+ coupon?: CouponNonNullableFields;
1242
+ }
1243
+ interface PriceDurationNonNullableFields {
1244
+ cycleFrom: number;
1245
+ }
1246
+ interface FeeNonNullableFields {
1247
+ name: string;
1248
+ amount: string;
1249
+ }
1250
+ interface PriceNonNullableFields {
1251
+ subtotal: string;
1252
+ coupon?: CouponNonNullableFields;
1253
+ discount: string;
1254
+ tax?: TaxNonNullableFields;
1255
+ total: string;
1256
+ currency: string;
1257
+ fees: FeeNonNullableFields[];
1258
+ proration: string;
1259
+ }
1260
+ interface SpannedPriceNonNullableFields {
1261
+ duration?: PriceDurationNonNullableFields;
1262
+ price?: PriceNonNullableFields;
1263
+ }
1264
+ interface PricingDetailsNonNullableFields {
1265
+ subscription?: RecurrenceNonNullableFields;
1266
+ singlePaymentForDuration?: DurationNonNullableFields;
1267
+ prices: SpannedPriceNonNullableFields[];
1268
+ }
1269
+ interface CancellationNonNullableFields {
1270
+ cause: CancellationCause;
1271
+ effectiveAt: CancellationEffectiveAt;
1272
+ }
1273
+ interface PausePeriodNonNullableFields {
1274
+ status: Status;
1275
+ }
1276
+ interface CurrentCycleNonNullableFields {
1277
+ index: number;
1278
+ }
1279
+ interface OrderCycleNonNullableFields {
1280
+ index: number;
1281
+ }
1282
+ interface OrderNonNullableFields {
1283
+ id: string;
1284
+ planId: string;
1285
+ subscriptionId: string;
1286
+ buyer?: BuyerNonNullableFields;
1287
+ priceDetails?: PriceDetailsNonNullableFields;
1288
+ pricing?: PricingDetailsNonNullableFields;
1289
+ type: OrderType;
1290
+ orderMethod: OrderMethod;
1291
+ status: OrderStatus;
1292
+ cancellation?: CancellationNonNullableFields;
1293
+ lastPaymentStatus: PaymentStatus;
1294
+ pausePeriods: PausePeriodNonNullableFields[];
1295
+ currentCycle?: CurrentCycleNonNullableFields;
1296
+ cycles: OrderCycleNonNullableFields[];
1297
+ planName: string;
1298
+ planDescription: string;
1299
+ planPrice: string;
1300
+ }
1301
+ export interface MemberGetOrderResponseNonNullableFields {
1302
+ order?: OrderNonNullableFields;
1303
+ }
1304
+ export interface MemberListOrdersResponseNonNullableFields {
1305
+ orders: OrderNonNullableFields[];
1306
+ }
1307
+ export interface CreateOnlineOrderResponseNonNullableFields {
1308
+ order?: OrderNonNullableFields;
1309
+ }
1310
+ export interface CreateOfflineOrderResponseNonNullableFields {
1311
+ order?: OrderNonNullableFields;
1312
+ }
1313
+ export interface GetOnlineOrderPreviewResponseNonNullableFields {
1314
+ order?: OrderNonNullableFields;
1315
+ purchaseLimitExceeded: boolean;
1316
+ }
1317
+ export interface GetOfflineOrderPreviewResponseNonNullableFields {
1318
+ order?: OrderNonNullableFields;
1319
+ purchaseLimitExceeded: boolean;
1320
+ }
1321
+ export interface GetPricePreviewResponseNonNullableFields {
1322
+ price?: PriceDetailsNonNullableFields;
1323
+ prices: SpannedPriceNonNullableFields[];
1324
+ }
1325
+ export interface GetOrderResponseNonNullableFields {
1326
+ order?: OrderNonNullableFields;
1327
+ }
1328
+ export interface ListOrdersResponseNonNullableFields {
1329
+ orders: OrderNonNullableFields[];
1330
+ }
1331
+ export {};