@wix/auto_sdk_pricing-plans_orders 1.0.124 → 1.0.125

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.
@@ -1,15 +1,29 @@
1
1
  // src/pricing-plans-v2-order-orders.schemas.ts
2
2
  import * as z from "zod";
3
- var ManagementGetOrderRequest = /* @__PURE__ */ z.object({
4
- _id: /* @__PURE__ */ z.string().describe("Order ID.").regex(
3
+ var CreateOnlineOrderRequest = /* @__PURE__ */ z.object({
4
+ planId: /* @__PURE__ */ z.string().describe("Plan ID.").regex(
5
5
  /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
6
6
  "Must be a valid GUID"
7
7
  ),
8
8
  options: /* @__PURE__ */ z.object({
9
- fieldSet: /* @__PURE__ */ z.enum(["UNKNOWN_SET", "BASIC", "FULL"]).optional()
10
- }).describe("Options to use when getting an order. ").optional()
9
+ startDate: /* @__PURE__ */ z.date().describe(
10
+ "Start date and time for the plan of the online order in a `YYYY-MM-DDThh:mm[:ss][.sss]Z` format.\n\nDefault: Current date and time."
11
+ ).optional().nullable(),
12
+ couponCode: /* @__PURE__ */ z.string().describe("Coupon code to apply.").min(1).max(20).optional().nullable(),
13
+ onBehalf: /* @__PURE__ */ z.object({
14
+ memberId: /* @__PURE__ */ z.string().describe("Member ID.").regex(
15
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
16
+ "Must be a valid GUID"
17
+ ),
18
+ orderMethod: /* @__PURE__ */ z.enum(["UNKNOWN", "MOTO", "POS"]).optional()
19
+ }).describe("Provided if checkout is initiated on buyer's behalf.").optional(),
20
+ submissionId: /* @__PURE__ */ z.string().describe("Submission ID of the form submitted with this order.").regex(
21
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
22
+ "Must be a valid GUID"
23
+ ).optional().nullable()
24
+ }).optional()
11
25
  });
12
- var ManagementGetOrderResponse = /* @__PURE__ */ z.object({
26
+ var CreateOnlineOrderResponse = /* @__PURE__ */ z.object({
13
27
  order: /* @__PURE__ */ z.object({
14
28
  _id: /* @__PURE__ */ z.string().describe("Order ID.").regex(
15
29
  /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
@@ -330,474 +344,365 @@ var ManagementGetOrderResponse = /* @__PURE__ */ z.object({
330
344
  }).describe(
331
345
  "Information about the form submitted during the plan's checkout."
332
346
  ).optional()
333
- }).describe("Order.").optional()
347
+ }).describe("Created online order.").optional()
334
348
  });
335
- var ManagementListOrdersRequest = /* @__PURE__ */ z.object({
349
+ var CreateOfflineOrderRequest = /* @__PURE__ */ z.object({
350
+ planId: /* @__PURE__ */ z.string().describe("ID of the plan being ordered, from the Plans API.").regex(
351
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
352
+ "Must be a valid GUID"
353
+ ),
354
+ memberId: /* @__PURE__ */ z.string().describe("ID of the member ordering the plan, from the Members API.").regex(
355
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
356
+ "Must be a valid GUID"
357
+ ),
336
358
  options: /* @__PURE__ */ z.object({
337
- buyerIds: /* @__PURE__ */ z.array(/* @__PURE__ */ z.string()).optional(),
338
- planIds: /* @__PURE__ */ z.array(/* @__PURE__ */ z.string()).optional(),
339
- autoRenewCanceled: /* @__PURE__ */ z.boolean().describe(
340
- "Filter by whether or not the auto-renewal of recurring orders was canceled."
359
+ startDate: /* @__PURE__ */ z.date().describe(
360
+ "Start date and time for the ordered plan in a `YYYY-MM-DDThh:mm[:ss][.sss]Z` format.\n\nDefault: Current date and time."
341
361
  ).optional().nullable(),
342
- orderStatuses: /* @__PURE__ */ z.array(
343
- /* @__PURE__ */ z.enum([
344
- "UNDEFINED",
345
- "DRAFT",
346
- "PENDING",
347
- "ACTIVE",
348
- "PAUSED",
349
- "ENDED",
350
- "CANCELED"
351
- ])
362
+ paid: /* @__PURE__ */ z.boolean().describe("Whether the order is paid.\n\nDefault: `false`").optional().nullable(),
363
+ couponCode: /* @__PURE__ */ z.string().describe("Coupon code to apply, from the Coupons API.").min(1).max(20).optional().nullable(),
364
+ submissionId: /* @__PURE__ */ z.string().describe("Form submission ID that was submitted with the order.").regex(
365
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
366
+ "Must be a valid GUID"
367
+ ).optional().nullable()
368
+ }).describe("Options for creating an offline order. ").optional()
369
+ });
370
+ var CreateOfflineOrderResponse = /* @__PURE__ */ z.object({
371
+ order: /* @__PURE__ */ z.object({
372
+ _id: /* @__PURE__ */ z.string().describe("Order ID.").regex(
373
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
374
+ "Must be a valid GUID"
352
375
  ).optional(),
353
- paymentStatuses: /* @__PURE__ */ z.array(
354
- /* @__PURE__ */ z.enum([
355
- "UNDEFINED",
356
- "PAID",
357
- "REFUNDED",
358
- "FAILED",
359
- "UNPAID",
360
- "PENDING",
361
- "NOT_APPLICABLE"
362
- ])
376
+ planId: /* @__PURE__ */ z.string().describe(
377
+ "ID of the plan purchased with the order, from the Plans API."
378
+ ).regex(
379
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
380
+ "Must be a valid GUID"
363
381
  ).optional(),
364
- limit: /* @__PURE__ */ z.number().int().describe(
365
- "Number of orders to return. See Sorting and Paging for more information.\n\nMax: `50`"
366
- ).min(1).max(50).optional().nullable(),
367
- offset: /* @__PURE__ */ z.number().int().describe("Number of orders to skip in the current sort order.").min(0).optional().nullable(),
368
- sorting: /* @__PURE__ */ z.object({
369
- fieldName: /* @__PURE__ */ z.string().describe("Name of the field to sort by.").max(512).optional(),
370
- order: /* @__PURE__ */ z.enum(["ASC", "DESC"]).optional(),
371
- origin: /* @__PURE__ */ z.object({
372
- latitude: /* @__PURE__ */ z.number().describe("Address latitude.").optional().nullable(),
373
- longitude: /* @__PURE__ */ z.number().describe("Address longitude.").optional().nullable()
374
- }).describe(
375
- "Origin point for geo-distance sorting on a GEO field\nresults are ordered by distance from this point (ASC = nearest first, DESC = farthest first)."
376
- ).optional()
377
- }).describe(
378
- "Sort order.\n\nUse `ASC` for ascending order or `DESC` for descending order.\n\nDefault: `DESC`."
382
+ subscriptionId: /* @__PURE__ */ z.string().describe(
383
+ "ID of the related Wix subscription.\n\nEvery pricing plan order corresponds to a Wix subscription, including orders for single payment plans. Learn more in\na [Pricing Plans overview](https://support.wix.com/en/article/pricing-plans-an-overview#create-plans-to-suit-your-business)."
384
+ ).regex(
385
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
386
+ "Must be a valid GUID"
379
387
  ).optional(),
380
- fieldSet: /* @__PURE__ */ z.enum(["UNKNOWN_SET", "BASIC", "FULL"]).optional()
381
- }).describe("Filtering, sorting, and pagination options. ").optional()
382
- });
383
- var ManagementListOrdersResponse = /* @__PURE__ */ z.object({
384
- orders: /* @__PURE__ */ z.array(
385
- /* @__PURE__ */ z.object({
386
- _id: /* @__PURE__ */ z.string().describe("Order ID.").regex(
387
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
388
- "Must be a valid GUID"
389
- ).optional(),
390
- planId: /* @__PURE__ */ z.string().describe(
391
- "ID of the plan purchased with the order, from the Plans API."
392
- ).regex(
393
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
394
- "Must be a valid GUID"
395
- ).optional(),
396
- subscriptionId: /* @__PURE__ */ z.string().describe(
397
- "ID of the related Wix subscription.\n\nEvery pricing plan order corresponds to a Wix subscription, including orders for single payment plans. Learn more in\na [Pricing Plans overview](https://support.wix.com/en/article/pricing-plans-an-overview#create-plans-to-suit-your-business)."
398
- ).regex(
388
+ wixPayOrderId: /* @__PURE__ */ z.string().describe(
389
+ "Wix Pay order ID.\n\nProvided by Wix whether the order is created online or offline. The field is omitted when the order is free."
390
+ ).regex(
391
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
392
+ "Must be a valid GUID"
393
+ ).optional().nullable(),
394
+ buyer: /* @__PURE__ */ z.object({
395
+ memberId: /* @__PURE__ */ z.string().describe("Member ID for a Wix site member, from the Members API.").regex(
399
396
  /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
400
397
  "Must be a valid GUID"
401
398
  ).optional(),
402
- wixPayOrderId: /* @__PURE__ */ z.string().describe(
403
- "Wix Pay order ID.\n\nProvided by Wix whether the order is created online or offline. The field is omitted when the order is free."
399
+ contactId: /* @__PURE__ */ z.string().describe(
400
+ "Contact ID for a Wix site contact, from the Contacts API."
404
401
  ).regex(
405
402
  /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
406
403
  "Must be a valid GUID"
407
- ).optional().nullable(),
408
- buyer: /* @__PURE__ */ z.object({
409
- memberId: /* @__PURE__ */ z.string().describe(
410
- "Member ID for a Wix site member, from the Members API."
411
- ).regex(
412
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
413
- "Must be a valid GUID"
404
+ ).optional()
405
+ }).describe(
406
+ "The buyer's IDs. Includes `memberId` and `contactId`.\n\nCurrently, Pricing Plan purchases are limited to members only. `contactId` is returned,\nbut a buyer will not be able to purchase a plan without a `memberId`."
407
+ ).optional(),
408
+ priceDetails: /* @__PURE__ */ z.intersection(
409
+ /* @__PURE__ */ z.object({
410
+ subtotal: /* @__PURE__ */ z.string().describe(
411
+ 'Price of the order excluding tax, specified as a monetary amount. for example, `"9.99"`.'
414
412
  ).optional(),
415
- contactId: /* @__PURE__ */ z.string().describe(
416
- "Contact ID for a Wix site contact, from the Contacts API."
417
- ).regex(
418
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
419
- "Must be a valid GUID"
420
- ).optional()
421
- }).describe(
422
- "The buyer's IDs. Includes `memberId` and `contactId`.\n\nCurrently, Pricing Plan purchases are limited to members only. `contactId` is returned,\nbut a buyer will not be able to purchase a plan without a `memberId`."
423
- ).optional(),
424
- priceDetails: /* @__PURE__ */ z.intersection(
425
- /* @__PURE__ */ z.object({
426
- subtotal: /* @__PURE__ */ z.string().describe(
427
- 'Price of the order excluding tax, specified as a monetary amount. for example, `"9.99"`.'
428
- ).optional(),
429
- discount: /* @__PURE__ */ z.string().describe("Total discount applied.").optional(),
430
- tax: /* @__PURE__ */ z.object({
431
- name: /* @__PURE__ */ z.string().describe("Name of the tax. For example, VAT.").optional(),
432
- includedInPrice: /* @__PURE__ */ z.boolean().describe(
433
- "Whether tax is included in the original price. When `false`, tax is added at checkout."
434
- ).optional(),
435
- rate: /* @__PURE__ */ z.string().describe(
436
- 'Tax rate percentage, as a number between 0 and 100. For example, a 7% tax rate is `"7.00"`.'
437
- ).optional(),
438
- amount: /* @__PURE__ */ z.string().describe(
439
- 'Total tax, specified as a monetary amount. For example, `"3.99"`.'
440
- ).optional()
441
- }).describe("Tax applied.").optional(),
442
- total: /* @__PURE__ */ z.string().describe(
443
- 'Price after tax and discount is applied, specified as a monetary amount. For example, `"13.98"`.\n\nIf no tax is applied, the amount is the same as `subtotal`.'
413
+ discount: /* @__PURE__ */ z.string().describe("Total discount applied.").optional(),
414
+ tax: /* @__PURE__ */ z.object({
415
+ name: /* @__PURE__ */ z.string().describe("Name of the tax. For example, VAT.").optional(),
416
+ includedInPrice: /* @__PURE__ */ z.boolean().describe(
417
+ "Whether tax is included in the original price. When `false`, tax is added at checkout."
444
418
  ).optional(),
445
- planPrice: /* @__PURE__ */ z.string().describe(
446
- "Plan price as it was at the moment of order creation."
419
+ rate: /* @__PURE__ */ z.string().describe(
420
+ 'Tax rate percentage, as a number between 0 and 100. For example, a 7% tax rate is `"7.00"`.'
447
421
  ).optional(),
448
- currency: /* @__PURE__ */ z.string().describe(
449
- "Currency code. Must be valid ISO 4217 currency code (e.g., USD)."
422
+ amount: /* @__PURE__ */ z.string().describe(
423
+ 'Total tax, specified as a monetary amount. For example, `"3.99"`.'
424
+ ).optional()
425
+ }).describe("Tax applied.").optional(),
426
+ total: /* @__PURE__ */ z.string().describe(
427
+ 'Price after tax and discount is applied, specified as a monetary amount. For example, `"13.98"`.\n\nIf no tax is applied, the amount is the same as `subtotal`.'
428
+ ).optional(),
429
+ planPrice: /* @__PURE__ */ z.string().describe("Plan price as it was at the moment of order creation.").optional(),
430
+ currency: /* @__PURE__ */ z.string().describe(
431
+ "Currency code. Must be valid ISO 4217 currency code (e.g., USD)."
432
+ ).optional(),
433
+ freeTrialDays: /* @__PURE__ */ z.number().int().describe(
434
+ "Free trial period for the order in days. Only available for recurring plans."
435
+ ).min(1).max(999).optional().nullable(),
436
+ coupon: /* @__PURE__ */ z.object({
437
+ code: /* @__PURE__ */ z.string().describe("Code of the applied coupon.").min(1).max(20).optional(),
438
+ amount: /* @__PURE__ */ z.string().describe(
439
+ "Total discount of the coupon, as a monetary amount."
450
440
  ).optional(),
451
- freeTrialDays: /* @__PURE__ */ z.number().int().describe(
452
- "Free trial period for the order in days. Only available for recurring plans."
453
- ).min(1).max(999).optional().nullable(),
454
- coupon: /* @__PURE__ */ z.object({
455
- code: /* @__PURE__ */ z.string().describe("Code of the applied coupon.").min(1).max(20).optional(),
456
- amount: /* @__PURE__ */ z.string().describe(
457
- "Total discount of the coupon, as a monetary amount."
458
- ).optional(),
459
- _id: /* @__PURE__ */ z.string().describe("Coupon ID.").regex(
460
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
461
- "Must be a valid GUID"
462
- ).optional()
463
- }).describe(
464
- "Coupon applied to the order. Empty means no coupon was applied."
441
+ _id: /* @__PURE__ */ z.string().describe("Coupon ID.").regex(
442
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
443
+ "Must be a valid GUID"
465
444
  ).optional()
445
+ }).describe(
446
+ "Coupon applied to the order. Empty means no coupon was applied."
447
+ ).optional()
448
+ }),
449
+ /* @__PURE__ */ z.xor([
450
+ /* @__PURE__ */ z.object({
451
+ subscription: /* @__PURE__ */ z.never().optional(),
452
+ singlePaymentForDuration: /* @__PURE__ */ z.never().optional(),
453
+ singlePaymentUnlimited: /* @__PURE__ */ z.never().optional()
466
454
  }),
467
- /* @__PURE__ */ z.xor([
468
- /* @__PURE__ */ z.object({
469
- subscription: /* @__PURE__ */ z.never().optional(),
470
- singlePaymentForDuration: /* @__PURE__ */ z.never().optional(),
471
- singlePaymentUnlimited: /* @__PURE__ */ z.never().optional()
472
- }),
473
- /* @__PURE__ */ z.object({
474
- singlePaymentForDuration: /* @__PURE__ */ z.never().optional(),
475
- singlePaymentUnlimited: /* @__PURE__ */ z.never().optional(),
476
- subscription: /* @__PURE__ */ z.object({
477
- cycleDuration: /* @__PURE__ */ z.object({
478
- count: /* @__PURE__ */ z.number().int().describe(
479
- "Number of days, months, weeks, or years in a single payment cycle. Currently limited to support only `1`."
480
- ).min(1).optional().nullable(),
481
- unit: /* @__PURE__ */ z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).describe("Unit of time for the cycle duration.").optional()
482
- }).describe(
483
- "Number of payment cycles the subscription is valid for.\n`0` for unlimited plans or for plans that are valid until canceled."
484
- ).optional(),
485
- cycleCount: /* @__PURE__ */ z.number().int().describe(
486
- "Length of a payment cycle. For example, 1 month to have monthly payments.\nMultiply `cycleDuration`'s `count` by `cycleCount` to get the subscription duration.\nCurrently, only a value of `1` is supported."
487
- ).min(0).max(2e3).optional().nullable()
488
- }).describe("Order has recurring payments.")
489
- }),
490
- /* @__PURE__ */ z.object({
491
- subscription: /* @__PURE__ */ z.never().optional(),
492
- singlePaymentUnlimited: /* @__PURE__ */ z.never().optional(),
493
- singlePaymentForDuration: /* @__PURE__ */ z.object({
455
+ /* @__PURE__ */ z.object({
456
+ singlePaymentForDuration: /* @__PURE__ */ z.never().optional(),
457
+ singlePaymentUnlimited: /* @__PURE__ */ z.never().optional(),
458
+ subscription: /* @__PURE__ */ z.object({
459
+ cycleDuration: /* @__PURE__ */ z.object({
494
460
  count: /* @__PURE__ */ z.number().int().describe(
495
461
  "Number of days, months, weeks, or years in a single payment cycle. Currently limited to support only `1`."
496
462
  ).min(1).optional().nullable(),
497
463
  unit: /* @__PURE__ */ z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).describe("Unit of time for the cycle duration.").optional()
498
464
  }).describe(
499
- "One-time payment. Order is valid for a specified duration."
500
- )
501
- }),
502
- /* @__PURE__ */ z.object({
503
- subscription: /* @__PURE__ */ z.never().optional(),
504
- singlePaymentForDuration: /* @__PURE__ */ z.never().optional(),
505
- singlePaymentUnlimited: /* @__PURE__ */ z.boolean().describe(
506
- "One-time payment. Order is valid until it is canceled."
507
- )
508
- })
509
- ])
510
- ).describe(
511
- "__Deprecated.__ Use `pricing` instead. This property will be removed on September 30, 2022."
512
- ).optional(),
513
- pricing: /* @__PURE__ */ z.intersection(
465
+ "Number of payment cycles the subscription is valid for.\n`0` for unlimited plans or for plans that are valid until canceled."
466
+ ).optional(),
467
+ cycleCount: /* @__PURE__ */ z.number().int().describe(
468
+ "Length of a payment cycle. For example, 1 month to have monthly payments.\nMultiply `cycleDuration`'s `count` by `cycleCount` to get the subscription duration.\nCurrently, only a value of `1` is supported."
469
+ ).min(0).max(2e3).optional().nullable()
470
+ }).describe("Order has recurring payments.")
471
+ }),
514
472
  /* @__PURE__ */ z.object({
515
- prices: /* @__PURE__ */ z.array(
516
- /* @__PURE__ */ z.object({
517
- duration: /* @__PURE__ */ z.object({
518
- cycleFrom: /* @__PURE__ */ z.number().int().describe(
519
- "Price starts to apply with this cycle.\n\n`1` is the first payment cycle for all pricing models."
473
+ subscription: /* @__PURE__ */ z.never().optional(),
474
+ singlePaymentUnlimited: /* @__PURE__ */ z.never().optional(),
475
+ singlePaymentForDuration: /* @__PURE__ */ z.object({
476
+ count: /* @__PURE__ */ z.number().int().describe(
477
+ "Number of days, months, weeks, or years in a single payment cycle. Currently limited to support only `1`."
478
+ ).min(1).optional().nullable(),
479
+ unit: /* @__PURE__ */ z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).describe("Unit of time for the cycle duration.").optional()
480
+ }).describe(
481
+ "One-time payment. Order is valid for a specified duration."
482
+ )
483
+ }),
484
+ /* @__PURE__ */ z.object({
485
+ subscription: /* @__PURE__ */ z.never().optional(),
486
+ singlePaymentForDuration: /* @__PURE__ */ z.never().optional(),
487
+ singlePaymentUnlimited: /* @__PURE__ */ z.boolean().describe(
488
+ "One-time payment. Order is valid until it is canceled."
489
+ )
490
+ })
491
+ ])
492
+ ).describe(
493
+ "__Deprecated.__ Use `pricing` instead. This property will be removed on September 30, 2022."
494
+ ).optional(),
495
+ pricing: /* @__PURE__ */ z.intersection(
496
+ /* @__PURE__ */ z.object({
497
+ prices: /* @__PURE__ */ z.array(
498
+ /* @__PURE__ */ z.object({
499
+ duration: /* @__PURE__ */ z.object({
500
+ cycleFrom: /* @__PURE__ */ z.number().int().describe(
501
+ "Price starts to apply with this cycle.\n\n`1` is the first payment cycle for all pricing models."
502
+ ).optional(),
503
+ numberOfCycles: /* @__PURE__ */ z.number().int().describe(
504
+ "Amount of cycles to apply price for.\n\nFor `subscription` pricing models with a finite number of cycles, the `numberOfCycles` is the same as `pricing.subscription.cycleCount`.\n\nFor `subscription` pricing models that are unlimited or until-canceled, the `numberOfCycles` is not returned.\n\nFor `singlePaymentForDuration` and `singlePaymentUnlimited` pricing models, the `numberOfCycles` is `1`."
505
+ ).optional().nullable()
506
+ }).describe(
507
+ "Cycle duration to apply `price` for.\n\nUse with all pricing models.\nCan apply the same price to multiple payment cycles."
508
+ ).optional(),
509
+ price: /* @__PURE__ */ z.object({
510
+ subtotal: /* @__PURE__ */ z.string().describe(
511
+ 'Price of the order excluding tax, specified as a monetary amount. For example, `"9.99"`.'
512
+ ).optional(),
513
+ coupon: /* @__PURE__ */ z.object({
514
+ code: /* @__PURE__ */ z.string().describe("Code of the applied coupon.").min(1).max(20).optional(),
515
+ amount: /* @__PURE__ */ z.string().describe(
516
+ "Total discount of the coupon, as a monetary amount."
520
517
  ).optional(),
521
- numberOfCycles: /* @__PURE__ */ z.number().int().describe(
522
- "Amount of cycles to apply price for.\n\nFor `subscription` pricing models with a finite number of cycles, the `numberOfCycles` is the same as `pricing.subscription.cycleCount`.\n\nFor `subscription` pricing models that are unlimited or until-canceled, the `numberOfCycles` is not returned.\n\nFor `singlePaymentForDuration` and `singlePaymentUnlimited` pricing models, the `numberOfCycles` is `1`."
523
- ).optional().nullable()
518
+ _id: /* @__PURE__ */ z.string().describe("Coupon ID.").regex(
519
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
520
+ "Must be a valid GUID"
521
+ ).optional()
524
522
  }).describe(
525
- "Cycle duration to apply `price` for.\n\nUse with all pricing models.\nCan apply the same price to multiple payment cycles."
523
+ "Coupon applied to the order, from the Coupons API."
526
524
  ).optional(),
527
- price: /* @__PURE__ */ z.object({
528
- subtotal: /* @__PURE__ */ z.string().describe(
529
- 'Price of the order excluding tax, specified as a monetary amount. For example, `"9.99"`.'
530
- ).optional(),
531
- coupon: /* @__PURE__ */ z.object({
532
- code: /* @__PURE__ */ z.string().describe("Code of the applied coupon.").min(1).max(20).optional(),
533
- amount: /* @__PURE__ */ z.string().describe(
534
- "Total discount of the coupon, as a monetary amount."
535
- ).optional(),
536
- _id: /* @__PURE__ */ z.string().describe("Coupon ID.").regex(
537
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
538
- "Must be a valid GUID"
539
- ).optional()
540
- }).describe(
541
- "Coupon applied to the order, from the Coupons API."
542
- ).optional(),
543
- discount: /* @__PURE__ */ z.string().describe("Total discount applied to the order.").optional(),
544
- tax: /* @__PURE__ */ z.object({
545
- name: /* @__PURE__ */ z.string().describe("Name of the tax. For example, VAT.").optional(),
546
- includedInPrice: /* @__PURE__ */ z.boolean().describe(
547
- "Whether tax is included in the original price. When `false`, tax is added at checkout."
548
- ).optional(),
549
- rate: /* @__PURE__ */ z.string().describe(
550
- 'Tax rate percentage, as a number between 0 and 100. For example, a 7% tax rate is `"7.00"`.'
551
- ).optional(),
552
- amount: /* @__PURE__ */ z.string().describe(
553
- 'Total tax, specified as a monetary amount. For example, `"3.99"`.'
554
- ).optional()
555
- }).describe(
556
- "Tax applied to the order.\n\nTax is only applied if the site [has it configured](https://support.wix.com/en/article/pricing-plans-setting-up-tax-collection)."
557
- ).optional(),
558
- total: /* @__PURE__ */ z.string().describe(
559
- 'Price after tax and discount is applied. Specified as a monetary amount, for example, `"13.98"`.\n\nIf no tax is applied, the amount is the same as `subtotal`.'
525
+ discount: /* @__PURE__ */ z.string().describe("Total discount applied to the order.").optional(),
526
+ tax: /* @__PURE__ */ z.object({
527
+ name: /* @__PURE__ */ z.string().describe("Name of the tax. For example, VAT.").optional(),
528
+ includedInPrice: /* @__PURE__ */ z.boolean().describe(
529
+ "Whether tax is included in the original price. When `false`, tax is added at checkout."
560
530
  ).optional(),
561
- currency: /* @__PURE__ */ z.string().describe(
562
- "Three-letter currency code in\n[ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format."
531
+ rate: /* @__PURE__ */ z.string().describe(
532
+ 'Tax rate percentage, as a number between 0 and 100. For example, a 7% tax rate is `"7.00"`.'
563
533
  ).optional(),
564
- proration: /* @__PURE__ */ z.string().describe(
565
- "Price change after billing date was change and price was adjusted. Could be positive and negative values."
534
+ amount: /* @__PURE__ */ z.string().describe(
535
+ 'Total tax, specified as a monetary amount. For example, `"3.99"`.'
566
536
  ).optional()
567
- }).describe("Order price.").optional()
568
- })
569
- ).optional()
570
- }),
571
- /* @__PURE__ */ z.xor([
572
- /* @__PURE__ */ z.object({
573
- subscription: /* @__PURE__ */ z.never().optional(),
574
- singlePaymentForDuration: /* @__PURE__ */ z.never().optional(),
575
- singlePaymentUnlimited: /* @__PURE__ */ z.never().optional()
576
- }),
577
- /* @__PURE__ */ z.object({
578
- singlePaymentForDuration: /* @__PURE__ */ z.never().optional(),
579
- singlePaymentUnlimited: /* @__PURE__ */ z.never().optional(),
580
- subscription: /* @__PURE__ */ z.object({
581
- cycleDuration: /* @__PURE__ */ z.object({
582
- count: /* @__PURE__ */ z.number().int().describe(
583
- "Number of days, months, weeks, or years in a single payment cycle. Currently limited to support only `1`."
584
- ).min(1).optional().nullable(),
585
- unit: /* @__PURE__ */ z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).describe("Unit of time for the cycle duration.").optional()
586
537
  }).describe(
587
- "Number of payment cycles the subscription is valid for.\n`0` for unlimited plans or for plans that are valid until canceled."
538
+ "Tax applied to the order.\n\nTax is only applied if the site [has it configured](https://support.wix.com/en/article/pricing-plans-setting-up-tax-collection)."
588
539
  ).optional(),
589
- cycleCount: /* @__PURE__ */ z.number().int().describe(
590
- "Length of a payment cycle. For example, 1 month to have monthly payments.\nMultiply `cycleDuration`'s `count` by `cycleCount` to get the subscription duration.\nCurrently, only a value of `1` is supported."
591
- ).min(0).max(2e3).optional().nullable()
592
- }).describe(
593
- "Pricing model for an order with recurring payment cycles."
594
- )
595
- }),
596
- /* @__PURE__ */ z.object({
597
- subscription: /* @__PURE__ */ z.never().optional(),
598
- singlePaymentUnlimited: /* @__PURE__ */ z.never().optional(),
599
- singlePaymentForDuration: /* @__PURE__ */ z.object({
540
+ total: /* @__PURE__ */ z.string().describe(
541
+ 'Price after tax and discount is applied. Specified as a monetary amount, for example, `"13.98"`.\n\nIf no tax is applied, the amount is the same as `subtotal`.'
542
+ ).optional(),
543
+ currency: /* @__PURE__ */ z.string().describe(
544
+ "Three-letter currency code in\n[ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format."
545
+ ).optional(),
546
+ proration: /* @__PURE__ */ z.string().describe(
547
+ "Price change after billing date was change and price was adjusted. Could be positive and negative values."
548
+ ).optional()
549
+ }).describe("Order price.").optional()
550
+ })
551
+ ).optional()
552
+ }),
553
+ /* @__PURE__ */ z.xor([
554
+ /* @__PURE__ */ z.object({
555
+ subscription: /* @__PURE__ */ z.never().optional(),
556
+ singlePaymentForDuration: /* @__PURE__ */ z.never().optional(),
557
+ singlePaymentUnlimited: /* @__PURE__ */ z.never().optional()
558
+ }),
559
+ /* @__PURE__ */ z.object({
560
+ singlePaymentForDuration: /* @__PURE__ */ z.never().optional(),
561
+ singlePaymentUnlimited: /* @__PURE__ */ z.never().optional(),
562
+ subscription: /* @__PURE__ */ z.object({
563
+ cycleDuration: /* @__PURE__ */ z.object({
600
564
  count: /* @__PURE__ */ z.number().int().describe(
601
565
  "Number of days, months, weeks, or years in a single payment cycle. Currently limited to support only `1`."
602
566
  ).min(1).optional().nullable(),
603
567
  unit: /* @__PURE__ */ z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).describe("Unit of time for the cycle duration.").optional()
604
568
  }).describe(
605
- "Pricing model for an order with a one-time payment and the order is valid for a specific amount of time."
606
- )
607
- }),
608
- /* @__PURE__ */ z.object({
609
- subscription: /* @__PURE__ */ z.never().optional(),
610
- singlePaymentForDuration: /* @__PURE__ */ z.never().optional(),
611
- singlePaymentUnlimited: /* @__PURE__ */ z.boolean().describe(
612
- "Pricing model for an order with a one-time payment and the order is valid until canceled."
613
- )
614
- })
615
- ])
616
- ).describe(
617
- "Order pricing model, price, and payment schedule.\n\nLearn more about [pricing models](https://dev.wix.com/api/rest/wix-pricing-plans/pricing-plans/introduction#wix-pricing-plans_pricing-plans_introduction_pricing-models)."
618
- ).optional(),
619
- type: /* @__PURE__ */ z.enum(["UNDEFINED", "ONLINE", "OFFLINE", "EXTERNAL"]).describe("How the order was processed.").optional(),
620
- status: /* @__PURE__ */ z.enum([
621
- "UNDEFINED",
622
- "DRAFT",
623
- "PENDING",
624
- "ACTIVE",
625
- "PAUSED",
626
- "ENDED",
627
- "CANCELED"
628
- ]).describe("Status of the order.").optional(),
629
- autoRenewCanceled: /* @__PURE__ */ z.boolean().describe(
630
- "Whether the order will be canceled at the next payment date.\n\nIf `true`, the order status will be `CANCELED` and the next payment won't be charged. Omitted for single payment orders."
631
- ).optional().nullable(),
632
- cancellation: /* @__PURE__ */ z.object({
633
- requestedDate: /* @__PURE__ */ z.date().describe("Date and time the cancellation was requested.").optional().nullable(),
634
- cause: /* @__PURE__ */ z.enum([
635
- "UNDEFINED",
636
- "OWNER_ACTION",
637
- "MEMBER_ACTION",
638
- "PAYMENT_FAILURE",
639
- "PAYMENT_SETUP_FAILURE",
640
- "UNKNOWN"
641
- ]).describe("Reason for the cancellation.").optional(),
642
- effectiveAt: /* @__PURE__ */ z.enum(["UNDEFINED", "IMMEDIATELY", "NEXT_PAYMENT_DATE"]).describe(
643
- "When the cancellation takes effect. Set when cancelling the order."
644
- ).optional()
645
- }).describe(
646
- "Details about the cancellation of an order.\n\nOnly present if the status is `CANCELED`."
647
- ).optional(),
648
- lastPaymentStatus: /* @__PURE__ */ z.enum([
649
- "UNDEFINED",
650
- "PAID",
651
- "REFUNDED",
652
- "FAILED",
653
- "UNPAID",
654
- "PENDING",
655
- "NOT_APPLICABLE"
656
- ]).describe(
657
- "Status of the last payment for the order.\nUpdated automatically for online orders. Updated manually by the Wix user for offline orders."
658
- ).optional(),
659
- startDate: /* @__PURE__ */ z.date().describe("Start date and time for the ordered plan.").optional().nullable(),
660
- endDate: /* @__PURE__ */ z.date().describe(
661
- "Current end date and time for the ordered plan.\n\n`endDate` may be updated over the course of an order.\nIf the order is paused, it will have a later `endDate` once it is resumed.\n`endDate` may also be postponed.\n\nOmitted if the order is valid until canceled and still `ACTIVE`."
662
- ).optional().nullable(),
663
- pausePeriods: /* @__PURE__ */ z.array(
569
+ "Number of payment cycles the subscription is valid for.\n`0` for unlimited plans or for plans that are valid until canceled."
570
+ ).optional(),
571
+ cycleCount: /* @__PURE__ */ z.number().int().describe(
572
+ "Length of a payment cycle. For example, 1 month to have monthly payments.\nMultiply `cycleDuration`'s `count` by `cycleCount` to get the subscription duration.\nCurrently, only a value of `1` is supported."
573
+ ).min(0).max(2e3).optional().nullable()
574
+ }).describe(
575
+ "Pricing model for an order with recurring payment cycles."
576
+ )
577
+ }),
664
578
  /* @__PURE__ */ z.object({
665
- status: /* @__PURE__ */ z.enum(["UNDEFINED", "ACTIVE", "ENDED"]).describe("Status of the pause period.").optional(),
666
- pauseDate: /* @__PURE__ */ z.date().describe("Start date and time of the pause period.").optional().nullable(),
667
- resumeDate: /* @__PURE__ */ z.date().describe(
668
- "End date and time of the pause period.\n\nOmitted while the pause period remains `ACTIVE`."
669
- ).optional().nullable()
579
+ subscription: /* @__PURE__ */ z.never().optional(),
580
+ singlePaymentUnlimited: /* @__PURE__ */ z.never().optional(),
581
+ singlePaymentForDuration: /* @__PURE__ */ z.object({
582
+ count: /* @__PURE__ */ z.number().int().describe(
583
+ "Number of days, months, weeks, or years in a single payment cycle. Currently limited to support only `1`."
584
+ ).min(1).optional().nullable(),
585
+ unit: /* @__PURE__ */ z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).describe("Unit of time for the cycle duration.").optional()
586
+ }).describe(
587
+ "Pricing model for an order with a one-time payment and the order is valid for a specific amount of time."
588
+ )
589
+ }),
590
+ /* @__PURE__ */ z.object({
591
+ subscription: /* @__PURE__ */ z.never().optional(),
592
+ singlePaymentForDuration: /* @__PURE__ */ z.never().optional(),
593
+ singlePaymentUnlimited: /* @__PURE__ */ z.boolean().describe(
594
+ "Pricing model for an order with a one-time payment and the order is valid until canceled."
595
+ )
670
596
  })
671
- ).optional(),
672
- freeTrialDays: /* @__PURE__ */ z.number().int().describe(
673
- "Free trial period for the order, in days.\n\nOnly available for recurring plans."
674
- ).min(1).max(999).optional().nullable(),
675
- earliestEndDate: /* @__PURE__ */ z.date().describe(
676
- "Earliest end date and time that the plan for the order can expire.\n\nCalculated by using the original end date plus any pause periods. Omitted if the order is active until canceled. Reserved for future use."
677
- ).optional().nullable(),
678
- currentCycle: /* @__PURE__ */ z.object({
679
- index: /* @__PURE__ */ z.number().int().describe(
680
- "Index of the current payment cycle in the order.\n\n`0` when order is in a free trial period. In all other cases, the index starts with `1`."
681
- ).min(0).optional(),
682
- startedDate: /* @__PURE__ */ z.date().describe("Start date and time for the current payment cycle.").optional().nullable(),
683
- endedDate: /* @__PURE__ */ z.date().describe("End date and time for the current payment cycle.").optional().nullable()
684
- }).describe(
685
- "Current payment cycle for the order.\n\n`currentCycle` will be omitted if the order's status is `CANCELED` or `ENDED`, or if the `startDate` hasn't passed yet."
686
- ).optional(),
687
- planName: /* @__PURE__ */ z.string().describe("Plan name at the time of purchase.").optional(),
688
- planDescription: /* @__PURE__ */ z.string().describe("Plan description at the time of purchase").optional(),
689
- planPrice: /* @__PURE__ */ z.string().describe("Plan price as it was at the moment of order creation.").optional(),
690
- _createdDate: /* @__PURE__ */ z.date().describe("Date and time the order was created.").optional().nullable(),
691
- _updatedDate: /* @__PURE__ */ z.date().describe("Date and time the order was updated.").optional().nullable(),
692
- formData: /* @__PURE__ */ z.object({
693
- formId: /* @__PURE__ */ z.string().describe(
694
- "ID of the [order form](https://dev.wix.com/docs/rest/api-reference/wix-forms/form-submissions/introduction) associated with the plan at checkout."
695
- ).regex(
696
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
697
- "Must be a valid GUID"
698
- ).optional().nullable(),
699
- submissionId: /* @__PURE__ */ z.string().describe(
700
- "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."
701
- ).regex(
702
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
703
- "Must be a valid GUID"
704
- ).optional().nullable(),
705
- submissionData: /* @__PURE__ */ z.record(/* @__PURE__ */ z.string(), /* @__PURE__ */ z.any()).describe("Data submitted to the plan's order form at checkout.").optional()
706
- }).describe(
707
- "Information about the form submitted during the plan's checkout."
597
+ ])
598
+ ).describe(
599
+ "Order pricing model, price, and payment schedule.\n\nLearn more about [pricing models](https://dev.wix.com/api/rest/wix-pricing-plans/pricing-plans/introduction#wix-pricing-plans_pricing-plans_introduction_pricing-models)."
600
+ ).optional(),
601
+ type: /* @__PURE__ */ z.enum(["UNDEFINED", "ONLINE", "OFFLINE", "EXTERNAL"]).describe("How the order was processed.").optional(),
602
+ status: /* @__PURE__ */ z.enum([
603
+ "UNDEFINED",
604
+ "DRAFT",
605
+ "PENDING",
606
+ "ACTIVE",
607
+ "PAUSED",
608
+ "ENDED",
609
+ "CANCELED"
610
+ ]).describe("Status of the order.").optional(),
611
+ autoRenewCanceled: /* @__PURE__ */ z.boolean().describe(
612
+ "Whether the order will be canceled at the next payment date.\n\nIf `true`, the order status will be `CANCELED` and the next payment won't be charged. Omitted for single payment orders."
613
+ ).optional().nullable(),
614
+ cancellation: /* @__PURE__ */ z.object({
615
+ requestedDate: /* @__PURE__ */ z.date().describe("Date and time the cancellation was requested.").optional().nullable(),
616
+ cause: /* @__PURE__ */ z.enum([
617
+ "UNDEFINED",
618
+ "OWNER_ACTION",
619
+ "MEMBER_ACTION",
620
+ "PAYMENT_FAILURE",
621
+ "PAYMENT_SETUP_FAILURE",
622
+ "UNKNOWN"
623
+ ]).describe("Reason for the cancellation.").optional(),
624
+ effectiveAt: /* @__PURE__ */ z.enum(["UNDEFINED", "IMMEDIATELY", "NEXT_PAYMENT_DATE"]).describe(
625
+ "When the cancellation takes effect. Set when cancelling the order."
708
626
  ).optional()
709
- })
710
- ).optional(),
711
- pagingMetadata: /* @__PURE__ */ z.object({
712
- count: /* @__PURE__ */ z.number().int().describe("Number of items returned in the response.").optional().nullable(),
713
- offset: /* @__PURE__ */ z.number().int().describe("Offset that was requested.").optional().nullable(),
714
- total: /* @__PURE__ */ z.number().int().describe(
715
- "Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set."
627
+ }).describe(
628
+ "Details about the cancellation of an order.\n\nOnly present if the status is `CANCELED`."
629
+ ).optional(),
630
+ lastPaymentStatus: /* @__PURE__ */ z.enum([
631
+ "UNDEFINED",
632
+ "PAID",
633
+ "REFUNDED",
634
+ "FAILED",
635
+ "UNPAID",
636
+ "PENDING",
637
+ "NOT_APPLICABLE"
638
+ ]).describe(
639
+ "Status of the last payment for the order.\nUpdated automatically for online orders. Updated manually by the Wix user for offline orders."
640
+ ).optional(),
641
+ startDate: /* @__PURE__ */ z.date().describe("Start date and time for the ordered plan.").optional().nullable(),
642
+ endDate: /* @__PURE__ */ z.date().describe(
643
+ "Current end date and time for the ordered plan.\n\n`endDate` may be updated over the course of an order.\nIf the order is paused, it will have a later `endDate` once it is resumed.\n`endDate` may also be postponed.\n\nOmitted if the order is valid until canceled and still `ACTIVE`."
716
644
  ).optional().nullable(),
717
- tooManyToCount: /* @__PURE__ */ z.boolean().describe(
718
- "Flag that indicates the server failed to calculate the `total` field."
645
+ pausePeriods: /* @__PURE__ */ z.array(
646
+ /* @__PURE__ */ z.object({
647
+ status: /* @__PURE__ */ z.enum(["UNDEFINED", "ACTIVE", "ENDED"]).describe("Status of the pause period.").optional(),
648
+ pauseDate: /* @__PURE__ */ z.date().describe("Start date and time of the pause period.").optional().nullable(),
649
+ resumeDate: /* @__PURE__ */ z.date().describe(
650
+ "End date and time of the pause period.\n\nOmitted while the pause period remains `ACTIVE`."
651
+ ).optional().nullable()
652
+ })
653
+ ).optional(),
654
+ freeTrialDays: /* @__PURE__ */ z.number().int().describe(
655
+ "Free trial period for the order, in days.\n\nOnly available for recurring plans."
656
+ ).min(1).max(999).optional().nullable(),
657
+ earliestEndDate: /* @__PURE__ */ z.date().describe(
658
+ "Earliest end date and time that the plan for the order can expire.\n\nCalculated by using the original end date plus any pause periods. Omitted if the order is active until canceled. Reserved for future use."
719
659
  ).optional().nullable(),
720
- cursors: /* @__PURE__ */ z.object({
721
- next: /* @__PURE__ */ z.string().describe(
722
- "Cursor string pointing to the next page in the list of results."
723
- ).max(16e3).optional().nullable(),
724
- prev: /* @__PURE__ */ z.string().describe(
725
- "Cursor pointing to the previous page in the list of results."
726
- ).max(16e3).optional().nullable()
660
+ currentCycle: /* @__PURE__ */ z.object({
661
+ index: /* @__PURE__ */ z.number().int().describe(
662
+ "Index of the current payment cycle in the order.\n\n`0` when order is in a free trial period. In all other cases, the index starts with `1`."
663
+ ).min(0).optional(),
664
+ startedDate: /* @__PURE__ */ z.date().describe("Start date and time for the current payment cycle.").optional().nullable(),
665
+ endedDate: /* @__PURE__ */ z.date().describe("End date and time for the current payment cycle.").optional().nullable()
727
666
  }).describe(
728
- "Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used."
667
+ "Current payment cycle for the order.\n\n`currentCycle` will be omitted if the order's status is `CANCELED` or `ENDED`, or if the `startDate` hasn't passed yet."
668
+ ).optional(),
669
+ planName: /* @__PURE__ */ z.string().describe("Plan name at the time of purchase.").optional(),
670
+ planDescription: /* @__PURE__ */ z.string().describe("Plan description at the time of purchase").optional(),
671
+ planPrice: /* @__PURE__ */ z.string().describe("Plan price as it was at the moment of order creation.").optional(),
672
+ _createdDate: /* @__PURE__ */ z.date().describe("Date and time the order was created.").optional().nullable(),
673
+ _updatedDate: /* @__PURE__ */ z.date().describe("Date and time the order was updated.").optional().nullable(),
674
+ formData: /* @__PURE__ */ z.object({
675
+ formId: /* @__PURE__ */ z.string().describe(
676
+ "ID of the [order form](https://dev.wix.com/docs/rest/api-reference/wix-forms/form-submissions/introduction) associated with the plan at checkout."
677
+ ).regex(
678
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
679
+ "Must be a valid GUID"
680
+ ).optional().nullable(),
681
+ submissionId: /* @__PURE__ */ z.string().describe(
682
+ "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."
683
+ ).regex(
684
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
685
+ "Must be a valid GUID"
686
+ ).optional().nullable(),
687
+ submissionData: /* @__PURE__ */ z.record(/* @__PURE__ */ z.string(), /* @__PURE__ */ z.any()).describe("Data submitted to the plan's order form at checkout.").optional()
688
+ }).describe(
689
+ "Information about the form submitted during the plan's checkout."
729
690
  ).optional()
730
- }).describe(
731
- "Object containing paging-related data (number of orders returned, offset)."
732
- ).optional()
733
- });
734
- var PostponeEndDateRequest = /* @__PURE__ */ z.object({
735
- _id: /* @__PURE__ */ z.string().describe("Order ID.").regex(
736
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
737
- "Must be a valid GUID"
738
- ),
739
- endDate: /* @__PURE__ */ z.date().describe(
740
- "New end date and time.\n\nMust be later than the current end date and time."
741
- )
742
- });
743
- var PostponeEndDateResponse = /* @__PURE__ */ z.object({});
744
- var CancelOrderRequest = /* @__PURE__ */ z.object({
745
- _id: /* @__PURE__ */ z.string().describe("Order ID.").regex(
746
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
747
- "Must be a valid GUID"
748
- ),
749
- effectiveAt: /* @__PURE__ */ z.enum([
750
- "UNDEFINED",
751
- "IMMEDIATELY",
752
- "NEXT_PAYMENT_DATE"
753
- ])
754
- });
755
- var CancelOrderResponse = /* @__PURE__ */ z.object({});
756
- var MarkAsPaidRequest = /* @__PURE__ */ z.object({
757
- _id: /* @__PURE__ */ z.string().describe("Order ID.").regex(
758
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
759
- "Must be a valid GUID"
760
- )
761
- });
762
- var MarkAsPaidResponse = /* @__PURE__ */ z.object({});
763
- var PauseOrderRequest = /* @__PURE__ */ z.object({
764
- _id: /* @__PURE__ */ z.string().describe("Order ID.").regex(
765
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
766
- "Must be a valid GUID"
767
- )
768
- });
769
- var PauseOrderResponse = /* @__PURE__ */ z.object({});
770
- var ResumeOrderRequest = /* @__PURE__ */ z.object({
771
- _id: /* @__PURE__ */ z.string().describe("Order ID.").regex(
772
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
773
- "Must be a valid GUID"
774
- )
691
+ }).describe("Order.").optional()
775
692
  });
776
- var ResumeOrderResponse = /* @__PURE__ */ z.object({});
777
- var CreateOnlineOrderRequest = /* @__PURE__ */ z.object({
693
+ var GetOnlineOrderPreviewRequest = /* @__PURE__ */ z.object({
778
694
  planId: /* @__PURE__ */ z.string().describe("Plan ID.").regex(
779
695
  /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
780
696
  "Must be a valid GUID"
781
697
  ),
782
698
  options: /* @__PURE__ */ z.object({
783
699
  startDate: /* @__PURE__ */ z.date().describe(
784
- "Start date and time for the plan of the online order in a `YYYY-MM-DDThh:mm[:ss][.sss]Z` format.\n\nDefault: Current date and time."
700
+ "Start date and time for the plan of the order preview in a `YYYY-MM-DDThh:mm[:ss][.sss]Z` format.\n\nDefault: Current date and time."
785
701
  ).optional().nullable(),
786
- couponCode: /* @__PURE__ */ z.string().describe("Coupon code to apply.").min(1).max(20).optional().nullable(),
787
- onBehalf: /* @__PURE__ */ z.object({
788
- memberId: /* @__PURE__ */ z.string().describe("Member ID.").regex(
789
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
790
- "Must be a valid GUID"
791
- ),
792
- orderMethod: /* @__PURE__ */ z.enum(["UNKNOWN", "MOTO", "POS"]).optional()
793
- }).describe("Provided if checkout is initiated on buyer's behalf.").optional(),
794
- submissionId: /* @__PURE__ */ z.string().describe("Submission ID of the form submitted with this order.").regex(
795
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
796
- "Must be a valid GUID"
797
- ).optional().nullable()
702
+ couponCode: /* @__PURE__ */ z.string().describe("Coupon code to apply.").min(1).max(20).optional().nullable()
798
703
  }).optional()
799
704
  });
800
- var CreateOnlineOrderResponse = /* @__PURE__ */ z.object({
705
+ var GetOnlineOrderPreviewResponse = /* @__PURE__ */ z.object({
801
706
  order: /* @__PURE__ */ z.object({
802
707
  _id: /* @__PURE__ */ z.string().describe("Order ID.").regex(
803
708
  /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
@@ -1118,30 +1023,32 @@ var CreateOnlineOrderResponse = /* @__PURE__ */ z.object({
1118
1023
  }).describe(
1119
1024
  "Information about the form submitted during the plan's checkout."
1120
1025
  ).optional()
1121
- }).describe("Created online order.").optional()
1026
+ }).describe(
1027
+ "Order preview. This field is undefined if the member has already reached the purchase limit for the order's plan."
1028
+ ).optional(),
1029
+ purchaseLimitExceeded: /* @__PURE__ */ z.boolean().describe(
1030
+ "Whether the member has already reached purchase limit for the order's plan."
1031
+ ).optional()
1122
1032
  });
1123
- var CreateOfflineOrderRequest = /* @__PURE__ */ z.object({
1124
- planId: /* @__PURE__ */ z.string().describe("ID of the plan being ordered, from the Plans API.").regex(
1033
+ var GetOfflineOrderPreviewRequest = /* @__PURE__ */ z.object({
1034
+ planId: /* @__PURE__ */ z.string().describe("ID of the plan of the previewed order.").regex(
1125
1035
  /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1126
1036
  "Must be a valid GUID"
1127
1037
  ),
1128
- memberId: /* @__PURE__ */ z.string().describe("ID of the member ordering the plan, from the Members API.").regex(
1038
+ memberId: /* @__PURE__ */ z.string().describe(
1039
+ "Member ID of the buyer the previewed order is for, from the Members API."
1040
+ ).regex(
1129
1041
  /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1130
1042
  "Must be a valid GUID"
1131
1043
  ),
1132
1044
  options: /* @__PURE__ */ z.object({
1133
1045
  startDate: /* @__PURE__ */ z.date().describe(
1134
- "Start date and time for the ordered plan in a `YYYY-MM-DDThh:mm[:ss][.sss]Z` format.\n\nDefault: Current date and time."
1046
+ "Start date and time for plan of the previewed order in a `YYYY-MM-DDThh:mm[:ss][.sss]Z` format.\n\nDefault: Current date and time."
1135
1047
  ).optional().nullable(),
1136
- paid: /* @__PURE__ */ z.boolean().describe("Whether the order is paid.\n\nDefault: `false`").optional().nullable(),
1137
- couponCode: /* @__PURE__ */ z.string().describe("Coupon code to apply, from the Coupons API.").min(1).max(20).optional().nullable(),
1138
- submissionId: /* @__PURE__ */ z.string().describe("Form submission ID that was submitted with the order.").regex(
1139
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1140
- "Must be a valid GUID"
1141
- ).optional().nullable()
1142
- }).describe("Options for creating an offline order. ").optional()
1143
- });
1144
- var CreateOfflineOrderResponse = /* @__PURE__ */ z.object({
1048
+ couponCode: /* @__PURE__ */ z.string().describe("Coupon code to apply, from the Coupons API.").min(1).max(20).optional().nullable()
1049
+ }).describe("Options for previewing the offline order. ").optional()
1050
+ });
1051
+ var GetOfflineOrderPreviewResponse = /* @__PURE__ */ z.object({
1145
1052
  order: /* @__PURE__ */ z.object({
1146
1053
  _id: /* @__PURE__ */ z.string().describe("Order ID.").regex(
1147
1054
  /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
@@ -1462,21 +1369,168 @@ var CreateOfflineOrderResponse = /* @__PURE__ */ z.object({
1462
1369
  }).describe(
1463
1370
  "Information about the form submitted during the plan's checkout."
1464
1371
  ).optional()
1465
- }).describe("Order.").optional()
1372
+ }).describe("The previewed order, as if the plan had been ordered.").optional(),
1373
+ purchaseLimitExceeded: /* @__PURE__ */ z.boolean().describe(
1374
+ "Whether this previewed order would exceed the permitted amount of purchases available\nfor this plan for this buyer.\n\nAlways `false` for plans that do not have purchase limits."
1375
+ ).optional()
1466
1376
  });
1467
- var GetOnlineOrderPreviewRequest = /* @__PURE__ */ z.object({
1468
- planId: /* @__PURE__ */ z.string().describe("Plan ID.").regex(
1377
+ var GetPricePreviewRequest = /* @__PURE__ */ z.object({
1378
+ planId: /* @__PURE__ */ z.string().describe("ID of plan to preview.").regex(
1469
1379
  /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1470
1380
  "Must be a valid GUID"
1471
1381
  ),
1472
1382
  options: /* @__PURE__ */ z.object({
1473
- startDate: /* @__PURE__ */ z.date().describe(
1474
- "Start date and time for the plan of the order preview in a `YYYY-MM-DDThh:mm[:ss][.sss]Z` format.\n\nDefault: Current date and time."
1475
- ).optional().nullable(),
1476
- couponCode: /* @__PURE__ */ z.string().describe("Coupon code to apply.").min(1).max(20).optional().nullable()
1477
- }).optional()
1383
+ couponCode: /* @__PURE__ */ z.string().describe("Coupon code to apply, from the Coupons API.").min(1).max(20).optional().nullable()
1384
+ }).describe("Options for getting a price preview. ").optional()
1478
1385
  });
1479
- var GetOnlineOrderPreviewResponse = /* @__PURE__ */ z.object({
1386
+ var GetPricePreviewResponse = /* @__PURE__ */ z.object({
1387
+ price: /* @__PURE__ */ z.intersection(
1388
+ /* @__PURE__ */ z.object({
1389
+ subtotal: /* @__PURE__ */ z.string().describe(
1390
+ 'Price of the order excluding tax, specified as a monetary amount. for example, `"9.99"`.'
1391
+ ).optional(),
1392
+ discount: /* @__PURE__ */ z.string().describe("Total discount applied.").optional(),
1393
+ tax: /* @__PURE__ */ z.object({
1394
+ name: /* @__PURE__ */ z.string().describe("Name of the tax. For example, VAT.").optional(),
1395
+ includedInPrice: /* @__PURE__ */ z.boolean().describe(
1396
+ "Whether tax is included in the original price. When `false`, tax is added at checkout."
1397
+ ).optional(),
1398
+ rate: /* @__PURE__ */ z.string().describe(
1399
+ 'Tax rate percentage, as a number between 0 and 100. For example, a 7% tax rate is `"7.00"`.'
1400
+ ).optional(),
1401
+ amount: /* @__PURE__ */ z.string().describe(
1402
+ 'Total tax, specified as a monetary amount. For example, `"3.99"`.'
1403
+ ).optional()
1404
+ }).describe("Tax applied.").optional(),
1405
+ total: /* @__PURE__ */ z.string().describe(
1406
+ 'Price after tax and discount is applied, specified as a monetary amount. For example, `"13.98"`.\n\nIf no tax is applied, the amount is the same as `subtotal`.'
1407
+ ).optional(),
1408
+ planPrice: /* @__PURE__ */ z.string().describe("Plan price as it was at the moment of order creation.").optional(),
1409
+ currency: /* @__PURE__ */ z.string().describe(
1410
+ "Currency code. Must be valid ISO 4217 currency code (e.g., USD)."
1411
+ ).optional(),
1412
+ freeTrialDays: /* @__PURE__ */ z.number().int().describe(
1413
+ "Free trial period for the order in days. Only available for recurring plans."
1414
+ ).min(1).max(999).optional().nullable(),
1415
+ coupon: /* @__PURE__ */ z.object({
1416
+ code: /* @__PURE__ */ z.string().describe("Code of the applied coupon.").min(1).max(20).optional(),
1417
+ amount: /* @__PURE__ */ z.string().describe("Total discount of the coupon, as a monetary amount.").optional(),
1418
+ _id: /* @__PURE__ */ z.string().describe("Coupon ID.").regex(
1419
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1420
+ "Must be a valid GUID"
1421
+ ).optional()
1422
+ }).describe(
1423
+ "Coupon applied to the order. Empty means no coupon was applied."
1424
+ ).optional()
1425
+ }),
1426
+ /* @__PURE__ */ z.xor([
1427
+ /* @__PURE__ */ z.object({
1428
+ subscription: /* @__PURE__ */ z.never().optional(),
1429
+ singlePaymentForDuration: /* @__PURE__ */ z.never().optional(),
1430
+ singlePaymentUnlimited: /* @__PURE__ */ z.never().optional()
1431
+ }),
1432
+ /* @__PURE__ */ z.object({
1433
+ singlePaymentForDuration: /* @__PURE__ */ z.never().optional(),
1434
+ singlePaymentUnlimited: /* @__PURE__ */ z.never().optional(),
1435
+ subscription: /* @__PURE__ */ z.object({
1436
+ cycleDuration: /* @__PURE__ */ z.object({
1437
+ count: /* @__PURE__ */ z.number().int().describe(
1438
+ "Number of days, months, weeks, or years in a single payment cycle. Currently limited to support only `1`."
1439
+ ).min(1).optional().nullable(),
1440
+ unit: /* @__PURE__ */ z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).describe("Unit of time for the cycle duration.").optional()
1441
+ }).describe(
1442
+ "Number of payment cycles the subscription is valid for.\n`0` for unlimited plans or for plans that are valid until canceled."
1443
+ ).optional(),
1444
+ cycleCount: /* @__PURE__ */ z.number().int().describe(
1445
+ "Length of a payment cycle. For example, 1 month to have monthly payments.\nMultiply `cycleDuration`'s `count` by `cycleCount` to get the subscription duration.\nCurrently, only a value of `1` is supported."
1446
+ ).min(0).max(2e3).optional().nullable()
1447
+ }).describe("Order has recurring payments.")
1448
+ }),
1449
+ /* @__PURE__ */ z.object({
1450
+ subscription: /* @__PURE__ */ z.never().optional(),
1451
+ singlePaymentUnlimited: /* @__PURE__ */ z.never().optional(),
1452
+ singlePaymentForDuration: /* @__PURE__ */ z.object({
1453
+ count: /* @__PURE__ */ z.number().int().describe(
1454
+ "Number of days, months, weeks, or years in a single payment cycle. Currently limited to support only `1`."
1455
+ ).min(1).optional().nullable(),
1456
+ unit: /* @__PURE__ */ z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).describe("Unit of time for the cycle duration.").optional()
1457
+ }).describe(
1458
+ "One-time payment. Order is valid for a specified duration."
1459
+ )
1460
+ }),
1461
+ /* @__PURE__ */ z.object({
1462
+ subscription: /* @__PURE__ */ z.never().optional(),
1463
+ singlePaymentForDuration: /* @__PURE__ */ z.never().optional(),
1464
+ singlePaymentUnlimited: /* @__PURE__ */ z.boolean().describe("One-time payment. Order is valid until it is canceled.")
1465
+ })
1466
+ ])
1467
+ ).describe(
1468
+ "__Deprecated.__ Use `prices` instead. This property will be removed on September 30, 2022."
1469
+ ).optional(),
1470
+ prices: /* @__PURE__ */ z.array(
1471
+ /* @__PURE__ */ z.object({
1472
+ duration: /* @__PURE__ */ z.object({
1473
+ cycleFrom: /* @__PURE__ */ z.number().int().describe(
1474
+ "Price starts to apply with this cycle.\n\n`1` is the first payment cycle for all pricing models."
1475
+ ).optional(),
1476
+ numberOfCycles: /* @__PURE__ */ z.number().int().describe(
1477
+ "Amount of cycles to apply price for.\n\nFor `subscription` pricing models with a finite number of cycles, the `numberOfCycles` is the same as `pricing.subscription.cycleCount`.\n\nFor `subscription` pricing models that are unlimited or until-canceled, the `numberOfCycles` is not returned.\n\nFor `singlePaymentForDuration` and `singlePaymentUnlimited` pricing models, the `numberOfCycles` is `1`."
1478
+ ).optional().nullable()
1479
+ }).describe(
1480
+ "Cycle duration to apply `price` for.\n\nUse with all pricing models.\nCan apply the same price to multiple payment cycles."
1481
+ ).optional(),
1482
+ price: /* @__PURE__ */ z.object({
1483
+ subtotal: /* @__PURE__ */ z.string().describe(
1484
+ 'Price of the order excluding tax, specified as a monetary amount. For example, `"9.99"`.'
1485
+ ).optional(),
1486
+ coupon: /* @__PURE__ */ z.object({
1487
+ code: /* @__PURE__ */ z.string().describe("Code of the applied coupon.").min(1).max(20).optional(),
1488
+ amount: /* @__PURE__ */ z.string().describe(
1489
+ "Total discount of the coupon, as a monetary amount."
1490
+ ).optional(),
1491
+ _id: /* @__PURE__ */ z.string().describe("Coupon ID.").regex(
1492
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1493
+ "Must be a valid GUID"
1494
+ ).optional()
1495
+ }).describe("Coupon applied to the order, from the Coupons API.").optional(),
1496
+ discount: /* @__PURE__ */ z.string().describe("Total discount applied to the order.").optional(),
1497
+ tax: /* @__PURE__ */ z.object({
1498
+ name: /* @__PURE__ */ z.string().describe("Name of the tax. For example, VAT.").optional(),
1499
+ includedInPrice: /* @__PURE__ */ z.boolean().describe(
1500
+ "Whether tax is included in the original price. When `false`, tax is added at checkout."
1501
+ ).optional(),
1502
+ rate: /* @__PURE__ */ z.string().describe(
1503
+ 'Tax rate percentage, as a number between 0 and 100. For example, a 7% tax rate is `"7.00"`.'
1504
+ ).optional(),
1505
+ amount: /* @__PURE__ */ z.string().describe(
1506
+ 'Total tax, specified as a monetary amount. For example, `"3.99"`.'
1507
+ ).optional()
1508
+ }).describe(
1509
+ "Tax applied to the order.\n\nTax is only applied if the site [has it configured](https://support.wix.com/en/article/pricing-plans-setting-up-tax-collection)."
1510
+ ).optional(),
1511
+ total: /* @__PURE__ */ z.string().describe(
1512
+ 'Price after tax and discount is applied. Specified as a monetary amount, for example, `"13.98"`.\n\nIf no tax is applied, the amount is the same as `subtotal`.'
1513
+ ).optional(),
1514
+ currency: /* @__PURE__ */ z.string().describe(
1515
+ "Three-letter currency code in\n[ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format."
1516
+ ).optional(),
1517
+ proration: /* @__PURE__ */ z.string().describe(
1518
+ "Price change after billing date was change and price was adjusted. Could be positive and negative values."
1519
+ ).optional()
1520
+ }).describe("Order price.").optional()
1521
+ })
1522
+ ).optional()
1523
+ });
1524
+ var ManagementGetOrderRequest = /* @__PURE__ */ z.object({
1525
+ _id: /* @__PURE__ */ z.string().describe("Order ID.").regex(
1526
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1527
+ "Must be a valid GUID"
1528
+ ),
1529
+ options: /* @__PURE__ */ z.object({
1530
+ fieldSet: /* @__PURE__ */ z.enum(["UNKNOWN_SET", "BASIC", "FULL"]).optional()
1531
+ }).describe("Options to use when getting an order. ").optional()
1532
+ });
1533
+ var ManagementGetOrderResponse = /* @__PURE__ */ z.object({
1480
1534
  order: /* @__PURE__ */ z.object({
1481
1535
  _id: /* @__PURE__ */ z.string().describe("Order ID.").regex(
1482
1536
  /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
@@ -1797,504 +1851,450 @@ var GetOnlineOrderPreviewResponse = /* @__PURE__ */ z.object({
1797
1851
  }).describe(
1798
1852
  "Information about the form submitted during the plan's checkout."
1799
1853
  ).optional()
1800
- }).describe(
1801
- "Order preview. This field is undefined if the member has already reached the purchase limit for the order's plan."
1802
- ).optional(),
1803
- purchaseLimitExceeded: /* @__PURE__ */ z.boolean().describe(
1804
- "Whether the member has already reached purchase limit for the order's plan."
1805
- ).optional()
1854
+ }).describe("Order.").optional()
1806
1855
  });
1807
- var GetOfflineOrderPreviewRequest = /* @__PURE__ */ z.object({
1808
- planId: /* @__PURE__ */ z.string().describe("ID of the plan of the previewed order.").regex(
1809
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1810
- "Must be a valid GUID"
1811
- ),
1812
- memberId: /* @__PURE__ */ z.string().describe(
1813
- "Member ID of the buyer the previewed order is for, from the Members API."
1814
- ).regex(
1815
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1816
- "Must be a valid GUID"
1817
- ),
1856
+ var ManagementListOrdersRequest = /* @__PURE__ */ z.object({
1818
1857
  options: /* @__PURE__ */ z.object({
1819
- startDate: /* @__PURE__ */ z.date().describe(
1820
- "Start date and time for plan of the previewed order in a `YYYY-MM-DDThh:mm[:ss][.sss]Z` format.\n\nDefault: Current date and time."
1858
+ buyerIds: /* @__PURE__ */ z.array(/* @__PURE__ */ z.string()).optional(),
1859
+ planIds: /* @__PURE__ */ z.array(/* @__PURE__ */ z.string()).optional(),
1860
+ autoRenewCanceled: /* @__PURE__ */ z.boolean().describe(
1861
+ "Filter by whether or not the auto-renewal of recurring orders was canceled."
1821
1862
  ).optional().nullable(),
1822
- couponCode: /* @__PURE__ */ z.string().describe("Coupon code to apply, from the Coupons API.").min(1).max(20).optional().nullable()
1823
- }).describe("Options for previewing the offline order. ").optional()
1824
- });
1825
- var GetOfflineOrderPreviewResponse = /* @__PURE__ */ z.object({
1826
- order: /* @__PURE__ */ z.object({
1827
- _id: /* @__PURE__ */ z.string().describe("Order ID.").regex(
1828
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1829
- "Must be a valid GUID"
1863
+ orderStatuses: /* @__PURE__ */ z.array(
1864
+ /* @__PURE__ */ z.enum([
1865
+ "UNDEFINED",
1866
+ "DRAFT",
1867
+ "PENDING",
1868
+ "ACTIVE",
1869
+ "PAUSED",
1870
+ "ENDED",
1871
+ "CANCELED"
1872
+ ])
1830
1873
  ).optional(),
1831
- planId: /* @__PURE__ */ z.string().describe(
1832
- "ID of the plan purchased with the order, from the Plans API."
1833
- ).regex(
1834
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1835
- "Must be a valid GUID"
1874
+ paymentStatuses: /* @__PURE__ */ z.array(
1875
+ /* @__PURE__ */ z.enum([
1876
+ "UNDEFINED",
1877
+ "PAID",
1878
+ "REFUNDED",
1879
+ "FAILED",
1880
+ "UNPAID",
1881
+ "PENDING",
1882
+ "NOT_APPLICABLE"
1883
+ ])
1836
1884
  ).optional(),
1837
- subscriptionId: /* @__PURE__ */ z.string().describe(
1838
- "ID of the related Wix subscription.\n\nEvery pricing plan order corresponds to a Wix subscription, including orders for single payment plans. Learn more in\na [Pricing Plans overview](https://support.wix.com/en/article/pricing-plans-an-overview#create-plans-to-suit-your-business)."
1839
- ).regex(
1840
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1841
- "Must be a valid GUID"
1885
+ limit: /* @__PURE__ */ z.number().int().describe(
1886
+ "Number of orders to return. See Sorting and Paging for more information.\n\nMax: `50`"
1887
+ ).min(1).max(50).optional().nullable(),
1888
+ offset: /* @__PURE__ */ z.number().int().describe("Number of orders to skip in the current sort order.").min(0).optional().nullable(),
1889
+ sorting: /* @__PURE__ */ z.object({
1890
+ fieldName: /* @__PURE__ */ z.string().describe("Name of the field to sort by.").max(512).optional(),
1891
+ order: /* @__PURE__ */ z.enum(["ASC", "DESC"]).optional(),
1892
+ origin: /* @__PURE__ */ z.object({
1893
+ latitude: /* @__PURE__ */ z.number().describe("Address latitude.").optional().nullable(),
1894
+ longitude: /* @__PURE__ */ z.number().describe("Address longitude.").optional().nullable()
1895
+ }).describe(
1896
+ "Origin point for geo-distance sorting on a GEO field\nresults are ordered by distance from this point (ASC = nearest first, DESC = farthest first)."
1897
+ ).optional()
1898
+ }).describe(
1899
+ "Sort order.\n\nUse `ASC` for ascending order or `DESC` for descending order.\n\nDefault: `DESC`."
1842
1900
  ).optional(),
1843
- wixPayOrderId: /* @__PURE__ */ z.string().describe(
1844
- "Wix Pay order ID.\n\nProvided by Wix whether the order is created online or offline. The field is omitted when the order is free."
1845
- ).regex(
1846
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1847
- "Must be a valid GUID"
1848
- ).optional().nullable(),
1849
- buyer: /* @__PURE__ */ z.object({
1850
- memberId: /* @__PURE__ */ z.string().describe("Member ID for a Wix site member, from the Members API.").regex(
1901
+ fieldSet: /* @__PURE__ */ z.enum(["UNKNOWN_SET", "BASIC", "FULL"]).optional()
1902
+ }).describe("Filtering, sorting, and pagination options. ").optional()
1903
+ });
1904
+ var ManagementListOrdersResponse = /* @__PURE__ */ z.object({
1905
+ orders: /* @__PURE__ */ z.array(
1906
+ /* @__PURE__ */ z.object({
1907
+ _id: /* @__PURE__ */ z.string().describe("Order ID.").regex(
1851
1908
  /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1852
1909
  "Must be a valid GUID"
1853
1910
  ).optional(),
1854
- contactId: /* @__PURE__ */ z.string().describe(
1855
- "Contact ID for a Wix site contact, from the Contacts API."
1911
+ planId: /* @__PURE__ */ z.string().describe(
1912
+ "ID of the plan purchased with the order, from the Plans API."
1856
1913
  ).regex(
1857
1914
  /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1858
1915
  "Must be a valid GUID"
1859
- ).optional()
1860
- }).describe(
1861
- "The buyer's IDs. Includes `memberId` and `contactId`.\n\nCurrently, Pricing Plan purchases are limited to members only. `contactId` is returned,\nbut a buyer will not be able to purchase a plan without a `memberId`."
1862
- ).optional(),
1863
- priceDetails: /* @__PURE__ */ z.intersection(
1864
- /* @__PURE__ */ z.object({
1865
- subtotal: /* @__PURE__ */ z.string().describe(
1866
- 'Price of the order excluding tax, specified as a monetary amount. for example, `"9.99"`.'
1916
+ ).optional(),
1917
+ subscriptionId: /* @__PURE__ */ z.string().describe(
1918
+ "ID of the related Wix subscription.\n\nEvery pricing plan order corresponds to a Wix subscription, including orders for single payment plans. Learn more in\na [Pricing Plans overview](https://support.wix.com/en/article/pricing-plans-an-overview#create-plans-to-suit-your-business)."
1919
+ ).regex(
1920
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1921
+ "Must be a valid GUID"
1922
+ ).optional(),
1923
+ wixPayOrderId: /* @__PURE__ */ z.string().describe(
1924
+ "Wix Pay order ID.\n\nProvided by Wix whether the order is created online or offline. The field is omitted when the order is free."
1925
+ ).regex(
1926
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1927
+ "Must be a valid GUID"
1928
+ ).optional().nullable(),
1929
+ buyer: /* @__PURE__ */ z.object({
1930
+ memberId: /* @__PURE__ */ z.string().describe(
1931
+ "Member ID for a Wix site member, from the Members API."
1932
+ ).regex(
1933
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1934
+ "Must be a valid GUID"
1867
1935
  ).optional(),
1868
- discount: /* @__PURE__ */ z.string().describe("Total discount applied.").optional(),
1869
- tax: /* @__PURE__ */ z.object({
1870
- name: /* @__PURE__ */ z.string().describe("Name of the tax. For example, VAT.").optional(),
1871
- includedInPrice: /* @__PURE__ */ z.boolean().describe(
1872
- "Whether tax is included in the original price. When `false`, tax is added at checkout."
1936
+ contactId: /* @__PURE__ */ z.string().describe(
1937
+ "Contact ID for a Wix site contact, from the Contacts API."
1938
+ ).regex(
1939
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1940
+ "Must be a valid GUID"
1941
+ ).optional()
1942
+ }).describe(
1943
+ "The buyer's IDs. Includes `memberId` and `contactId`.\n\nCurrently, Pricing Plan purchases are limited to members only. `contactId` is returned,\nbut a buyer will not be able to purchase a plan without a `memberId`."
1944
+ ).optional(),
1945
+ priceDetails: /* @__PURE__ */ z.intersection(
1946
+ /* @__PURE__ */ z.object({
1947
+ subtotal: /* @__PURE__ */ z.string().describe(
1948
+ 'Price of the order excluding tax, specified as a monetary amount. for example, `"9.99"`.'
1873
1949
  ).optional(),
1874
- rate: /* @__PURE__ */ z.string().describe(
1875
- 'Tax rate percentage, as a number between 0 and 100. For example, a 7% tax rate is `"7.00"`.'
1950
+ discount: /* @__PURE__ */ z.string().describe("Total discount applied.").optional(),
1951
+ tax: /* @__PURE__ */ z.object({
1952
+ name: /* @__PURE__ */ z.string().describe("Name of the tax. For example, VAT.").optional(),
1953
+ includedInPrice: /* @__PURE__ */ z.boolean().describe(
1954
+ "Whether tax is included in the original price. When `false`, tax is added at checkout."
1955
+ ).optional(),
1956
+ rate: /* @__PURE__ */ z.string().describe(
1957
+ 'Tax rate percentage, as a number between 0 and 100. For example, a 7% tax rate is `"7.00"`.'
1958
+ ).optional(),
1959
+ amount: /* @__PURE__ */ z.string().describe(
1960
+ 'Total tax, specified as a monetary amount. For example, `"3.99"`.'
1961
+ ).optional()
1962
+ }).describe("Tax applied.").optional(),
1963
+ total: /* @__PURE__ */ z.string().describe(
1964
+ 'Price after tax and discount is applied, specified as a monetary amount. For example, `"13.98"`.\n\nIf no tax is applied, the amount is the same as `subtotal`.'
1876
1965
  ).optional(),
1877
- amount: /* @__PURE__ */ z.string().describe(
1878
- 'Total tax, specified as a monetary amount. For example, `"3.99"`.'
1879
- ).optional()
1880
- }).describe("Tax applied.").optional(),
1881
- total: /* @__PURE__ */ z.string().describe(
1882
- 'Price after tax and discount is applied, specified as a monetary amount. For example, `"13.98"`.\n\nIf no tax is applied, the amount is the same as `subtotal`.'
1883
- ).optional(),
1884
- planPrice: /* @__PURE__ */ z.string().describe("Plan price as it was at the moment of order creation.").optional(),
1885
- currency: /* @__PURE__ */ z.string().describe(
1886
- "Currency code. Must be valid ISO 4217 currency code (e.g., USD)."
1887
- ).optional(),
1888
- freeTrialDays: /* @__PURE__ */ z.number().int().describe(
1889
- "Free trial period for the order in days. Only available for recurring plans."
1890
- ).min(1).max(999).optional().nullable(),
1891
- coupon: /* @__PURE__ */ z.object({
1892
- code: /* @__PURE__ */ z.string().describe("Code of the applied coupon.").min(1).max(20).optional(),
1893
- amount: /* @__PURE__ */ z.string().describe(
1894
- "Total discount of the coupon, as a monetary amount."
1966
+ planPrice: /* @__PURE__ */ z.string().describe(
1967
+ "Plan price as it was at the moment of order creation."
1895
1968
  ).optional(),
1896
- _id: /* @__PURE__ */ z.string().describe("Coupon ID.").regex(
1897
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1898
- "Must be a valid GUID"
1969
+ currency: /* @__PURE__ */ z.string().describe(
1970
+ "Currency code. Must be valid ISO 4217 currency code (e.g., USD)."
1971
+ ).optional(),
1972
+ freeTrialDays: /* @__PURE__ */ z.number().int().describe(
1973
+ "Free trial period for the order in days. Only available for recurring plans."
1974
+ ).min(1).max(999).optional().nullable(),
1975
+ coupon: /* @__PURE__ */ z.object({
1976
+ code: /* @__PURE__ */ z.string().describe("Code of the applied coupon.").min(1).max(20).optional(),
1977
+ amount: /* @__PURE__ */ z.string().describe(
1978
+ "Total discount of the coupon, as a monetary amount."
1979
+ ).optional(),
1980
+ _id: /* @__PURE__ */ z.string().describe("Coupon ID.").regex(
1981
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1982
+ "Must be a valid GUID"
1983
+ ).optional()
1984
+ }).describe(
1985
+ "Coupon applied to the order. Empty means no coupon was applied."
1899
1986
  ).optional()
1900
- }).describe(
1901
- "Coupon applied to the order. Empty means no coupon was applied."
1902
- ).optional()
1903
- }),
1904
- /* @__PURE__ */ z.xor([
1905
- /* @__PURE__ */ z.object({
1906
- subscription: /* @__PURE__ */ z.never().optional(),
1907
- singlePaymentForDuration: /* @__PURE__ */ z.never().optional(),
1908
- singlePaymentUnlimited: /* @__PURE__ */ z.never().optional()
1909
1987
  }),
1910
- /* @__PURE__ */ z.object({
1911
- singlePaymentForDuration: /* @__PURE__ */ z.never().optional(),
1912
- singlePaymentUnlimited: /* @__PURE__ */ z.never().optional(),
1913
- subscription: /* @__PURE__ */ z.object({
1914
- cycleDuration: /* @__PURE__ */ z.object({
1988
+ /* @__PURE__ */ z.xor([
1989
+ /* @__PURE__ */ z.object({
1990
+ subscription: /* @__PURE__ */ z.never().optional(),
1991
+ singlePaymentForDuration: /* @__PURE__ */ z.never().optional(),
1992
+ singlePaymentUnlimited: /* @__PURE__ */ z.never().optional()
1993
+ }),
1994
+ /* @__PURE__ */ z.object({
1995
+ singlePaymentForDuration: /* @__PURE__ */ z.never().optional(),
1996
+ singlePaymentUnlimited: /* @__PURE__ */ z.never().optional(),
1997
+ subscription: /* @__PURE__ */ z.object({
1998
+ cycleDuration: /* @__PURE__ */ z.object({
1999
+ count: /* @__PURE__ */ z.number().int().describe(
2000
+ "Number of days, months, weeks, or years in a single payment cycle. Currently limited to support only `1`."
2001
+ ).min(1).optional().nullable(),
2002
+ unit: /* @__PURE__ */ z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).describe("Unit of time for the cycle duration.").optional()
2003
+ }).describe(
2004
+ "Number of payment cycles the subscription is valid for.\n`0` for unlimited plans or for plans that are valid until canceled."
2005
+ ).optional(),
2006
+ cycleCount: /* @__PURE__ */ z.number().int().describe(
2007
+ "Length of a payment cycle. For example, 1 month to have monthly payments.\nMultiply `cycleDuration`'s `count` by `cycleCount` to get the subscription duration.\nCurrently, only a value of `1` is supported."
2008
+ ).min(0).max(2e3).optional().nullable()
2009
+ }).describe("Order has recurring payments.")
2010
+ }),
2011
+ /* @__PURE__ */ z.object({
2012
+ subscription: /* @__PURE__ */ z.never().optional(),
2013
+ singlePaymentUnlimited: /* @__PURE__ */ z.never().optional(),
2014
+ singlePaymentForDuration: /* @__PURE__ */ z.object({
1915
2015
  count: /* @__PURE__ */ z.number().int().describe(
1916
2016
  "Number of days, months, weeks, or years in a single payment cycle. Currently limited to support only `1`."
1917
2017
  ).min(1).optional().nullable(),
1918
2018
  unit: /* @__PURE__ */ z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).describe("Unit of time for the cycle duration.").optional()
1919
2019
  }).describe(
1920
- "Number of payment cycles the subscription is valid for.\n`0` for unlimited plans or for plans that are valid until canceled."
1921
- ).optional(),
1922
- cycleCount: /* @__PURE__ */ z.number().int().describe(
1923
- "Length of a payment cycle. For example, 1 month to have monthly payments.\nMultiply `cycleDuration`'s `count` by `cycleCount` to get the subscription duration.\nCurrently, only a value of `1` is supported."
1924
- ).min(0).max(2e3).optional().nullable()
1925
- }).describe("Order has recurring payments.")
1926
- }),
1927
- /* @__PURE__ */ z.object({
1928
- subscription: /* @__PURE__ */ z.never().optional(),
1929
- singlePaymentUnlimited: /* @__PURE__ */ z.never().optional(),
1930
- singlePaymentForDuration: /* @__PURE__ */ z.object({
1931
- count: /* @__PURE__ */ z.number().int().describe(
1932
- "Number of days, months, weeks, or years in a single payment cycle. Currently limited to support only `1`."
1933
- ).min(1).optional().nullable(),
1934
- unit: /* @__PURE__ */ z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).describe("Unit of time for the cycle duration.").optional()
1935
- }).describe(
1936
- "One-time payment. Order is valid for a specified duration."
1937
- )
1938
- }),
1939
- /* @__PURE__ */ z.object({
1940
- subscription: /* @__PURE__ */ z.never().optional(),
1941
- singlePaymentForDuration: /* @__PURE__ */ z.never().optional(),
1942
- singlePaymentUnlimited: /* @__PURE__ */ z.boolean().describe(
1943
- "One-time payment. Order is valid until it is canceled."
1944
- )
1945
- })
1946
- ])
1947
- ).describe(
1948
- "__Deprecated.__ Use `pricing` instead. This property will be removed on September 30, 2022."
1949
- ).optional(),
1950
- pricing: /* @__PURE__ */ z.intersection(
1951
- /* @__PURE__ */ z.object({
1952
- prices: /* @__PURE__ */ z.array(
2020
+ "One-time payment. Order is valid for a specified duration."
2021
+ )
2022
+ }),
1953
2023
  /* @__PURE__ */ z.object({
1954
- duration: /* @__PURE__ */ z.object({
1955
- cycleFrom: /* @__PURE__ */ z.number().int().describe(
1956
- "Price starts to apply with this cycle.\n\n`1` is the first payment cycle for all pricing models."
1957
- ).optional(),
1958
- numberOfCycles: /* @__PURE__ */ z.number().int().describe(
1959
- "Amount of cycles to apply price for.\n\nFor `subscription` pricing models with a finite number of cycles, the `numberOfCycles` is the same as `pricing.subscription.cycleCount`.\n\nFor `subscription` pricing models that are unlimited or until-canceled, the `numberOfCycles` is not returned.\n\nFor `singlePaymentForDuration` and `singlePaymentUnlimited` pricing models, the `numberOfCycles` is `1`."
1960
- ).optional().nullable()
1961
- }).describe(
1962
- "Cycle duration to apply `price` for.\n\nUse with all pricing models.\nCan apply the same price to multiple payment cycles."
1963
- ).optional(),
1964
- price: /* @__PURE__ */ z.object({
1965
- subtotal: /* @__PURE__ */ z.string().describe(
1966
- 'Price of the order excluding tax, specified as a monetary amount. For example, `"9.99"`.'
1967
- ).optional(),
1968
- coupon: /* @__PURE__ */ z.object({
1969
- code: /* @__PURE__ */ z.string().describe("Code of the applied coupon.").min(1).max(20).optional(),
1970
- amount: /* @__PURE__ */ z.string().describe(
1971
- "Total discount of the coupon, as a monetary amount."
2024
+ subscription: /* @__PURE__ */ z.never().optional(),
2025
+ singlePaymentForDuration: /* @__PURE__ */ z.never().optional(),
2026
+ singlePaymentUnlimited: /* @__PURE__ */ z.boolean().describe(
2027
+ "One-time payment. Order is valid until it is canceled."
2028
+ )
2029
+ })
2030
+ ])
2031
+ ).describe(
2032
+ "__Deprecated.__ Use `pricing` instead. This property will be removed on September 30, 2022."
2033
+ ).optional(),
2034
+ pricing: /* @__PURE__ */ z.intersection(
2035
+ /* @__PURE__ */ z.object({
2036
+ prices: /* @__PURE__ */ z.array(
2037
+ /* @__PURE__ */ z.object({
2038
+ duration: /* @__PURE__ */ z.object({
2039
+ cycleFrom: /* @__PURE__ */ z.number().int().describe(
2040
+ "Price starts to apply with this cycle.\n\n`1` is the first payment cycle for all pricing models."
1972
2041
  ).optional(),
1973
- _id: /* @__PURE__ */ z.string().describe("Coupon ID.").regex(
1974
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1975
- "Must be a valid GUID"
1976
- ).optional()
2042
+ numberOfCycles: /* @__PURE__ */ z.number().int().describe(
2043
+ "Amount of cycles to apply price for.\n\nFor `subscription` pricing models with a finite number of cycles, the `numberOfCycles` is the same as `pricing.subscription.cycleCount`.\n\nFor `subscription` pricing models that are unlimited or until-canceled, the `numberOfCycles` is not returned.\n\nFor `singlePaymentForDuration` and `singlePaymentUnlimited` pricing models, the `numberOfCycles` is `1`."
2044
+ ).optional().nullable()
1977
2045
  }).describe(
1978
- "Coupon applied to the order, from the Coupons API."
2046
+ "Cycle duration to apply `price` for.\n\nUse with all pricing models.\nCan apply the same price to multiple payment cycles."
1979
2047
  ).optional(),
1980
- discount: /* @__PURE__ */ z.string().describe("Total discount applied to the order.").optional(),
1981
- tax: /* @__PURE__ */ z.object({
1982
- name: /* @__PURE__ */ z.string().describe("Name of the tax. For example, VAT.").optional(),
1983
- includedInPrice: /* @__PURE__ */ z.boolean().describe(
1984
- "Whether tax is included in the original price. When `false`, tax is added at checkout."
2048
+ price: /* @__PURE__ */ z.object({
2049
+ subtotal: /* @__PURE__ */ z.string().describe(
2050
+ 'Price of the order excluding tax, specified as a monetary amount. For example, `"9.99"`.'
1985
2051
  ).optional(),
1986
- rate: /* @__PURE__ */ z.string().describe(
1987
- 'Tax rate percentage, as a number between 0 and 100. For example, a 7% tax rate is `"7.00"`.'
2052
+ coupon: /* @__PURE__ */ z.object({
2053
+ code: /* @__PURE__ */ z.string().describe("Code of the applied coupon.").min(1).max(20).optional(),
2054
+ amount: /* @__PURE__ */ z.string().describe(
2055
+ "Total discount of the coupon, as a monetary amount."
2056
+ ).optional(),
2057
+ _id: /* @__PURE__ */ z.string().describe("Coupon ID.").regex(
2058
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
2059
+ "Must be a valid GUID"
2060
+ ).optional()
2061
+ }).describe(
2062
+ "Coupon applied to the order, from the Coupons API."
1988
2063
  ).optional(),
1989
- amount: /* @__PURE__ */ z.string().describe(
1990
- 'Total tax, specified as a monetary amount. For example, `"3.99"`.'
2064
+ discount: /* @__PURE__ */ z.string().describe("Total discount applied to the order.").optional(),
2065
+ tax: /* @__PURE__ */ z.object({
2066
+ name: /* @__PURE__ */ z.string().describe("Name of the tax. For example, VAT.").optional(),
2067
+ includedInPrice: /* @__PURE__ */ z.boolean().describe(
2068
+ "Whether tax is included in the original price. When `false`, tax is added at checkout."
2069
+ ).optional(),
2070
+ rate: /* @__PURE__ */ z.string().describe(
2071
+ 'Tax rate percentage, as a number between 0 and 100. For example, a 7% tax rate is `"7.00"`.'
2072
+ ).optional(),
2073
+ amount: /* @__PURE__ */ z.string().describe(
2074
+ 'Total tax, specified as a monetary amount. For example, `"3.99"`.'
2075
+ ).optional()
2076
+ }).describe(
2077
+ "Tax applied to the order.\n\nTax is only applied if the site [has it configured](https://support.wix.com/en/article/pricing-plans-setting-up-tax-collection)."
2078
+ ).optional(),
2079
+ total: /* @__PURE__ */ z.string().describe(
2080
+ 'Price after tax and discount is applied. Specified as a monetary amount, for example, `"13.98"`.\n\nIf no tax is applied, the amount is the same as `subtotal`.'
2081
+ ).optional(),
2082
+ currency: /* @__PURE__ */ z.string().describe(
2083
+ "Three-letter currency code in\n[ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format."
2084
+ ).optional(),
2085
+ proration: /* @__PURE__ */ z.string().describe(
2086
+ "Price change after billing date was change and price was adjusted. Could be positive and negative values."
1991
2087
  ).optional()
2088
+ }).describe("Order price.").optional()
2089
+ })
2090
+ ).optional()
2091
+ }),
2092
+ /* @__PURE__ */ z.xor([
2093
+ /* @__PURE__ */ z.object({
2094
+ subscription: /* @__PURE__ */ z.never().optional(),
2095
+ singlePaymentForDuration: /* @__PURE__ */ z.never().optional(),
2096
+ singlePaymentUnlimited: /* @__PURE__ */ z.never().optional()
2097
+ }),
2098
+ /* @__PURE__ */ z.object({
2099
+ singlePaymentForDuration: /* @__PURE__ */ z.never().optional(),
2100
+ singlePaymentUnlimited: /* @__PURE__ */ z.never().optional(),
2101
+ subscription: /* @__PURE__ */ z.object({
2102
+ cycleDuration: /* @__PURE__ */ z.object({
2103
+ count: /* @__PURE__ */ z.number().int().describe(
2104
+ "Number of days, months, weeks, or years in a single payment cycle. Currently limited to support only `1`."
2105
+ ).min(1).optional().nullable(),
2106
+ unit: /* @__PURE__ */ z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).describe("Unit of time for the cycle duration.").optional()
1992
2107
  }).describe(
1993
- "Tax applied to the order.\n\nTax is only applied if the site [has it configured](https://support.wix.com/en/article/pricing-plans-setting-up-tax-collection)."
1994
- ).optional(),
1995
- total: /* @__PURE__ */ z.string().describe(
1996
- 'Price after tax and discount is applied. Specified as a monetary amount, for example, `"13.98"`.\n\nIf no tax is applied, the amount is the same as `subtotal`.'
1997
- ).optional(),
1998
- currency: /* @__PURE__ */ z.string().describe(
1999
- "Three-letter currency code in\n[ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format."
2108
+ "Number of payment cycles the subscription is valid for.\n`0` for unlimited plans or for plans that are valid until canceled."
2000
2109
  ).optional(),
2001
- proration: /* @__PURE__ */ z.string().describe(
2002
- "Price change after billing date was change and price was adjusted. Could be positive and negative values."
2003
- ).optional()
2004
- }).describe("Order price.").optional()
2005
- })
2006
- ).optional()
2007
- }),
2008
- /* @__PURE__ */ z.xor([
2009
- /* @__PURE__ */ z.object({
2010
- subscription: /* @__PURE__ */ z.never().optional(),
2011
- singlePaymentForDuration: /* @__PURE__ */ z.never().optional(),
2012
- singlePaymentUnlimited: /* @__PURE__ */ z.never().optional()
2013
- }),
2014
- /* @__PURE__ */ z.object({
2015
- singlePaymentForDuration: /* @__PURE__ */ z.never().optional(),
2016
- singlePaymentUnlimited: /* @__PURE__ */ z.never().optional(),
2017
- subscription: /* @__PURE__ */ z.object({
2018
- cycleDuration: /* @__PURE__ */ z.object({
2110
+ cycleCount: /* @__PURE__ */ z.number().int().describe(
2111
+ "Length of a payment cycle. For example, 1 month to have monthly payments.\nMultiply `cycleDuration`'s `count` by `cycleCount` to get the subscription duration.\nCurrently, only a value of `1` is supported."
2112
+ ).min(0).max(2e3).optional().nullable()
2113
+ }).describe(
2114
+ "Pricing model for an order with recurring payment cycles."
2115
+ )
2116
+ }),
2117
+ /* @__PURE__ */ z.object({
2118
+ subscription: /* @__PURE__ */ z.never().optional(),
2119
+ singlePaymentUnlimited: /* @__PURE__ */ z.never().optional(),
2120
+ singlePaymentForDuration: /* @__PURE__ */ z.object({
2019
2121
  count: /* @__PURE__ */ z.number().int().describe(
2020
2122
  "Number of days, months, weeks, or years in a single payment cycle. Currently limited to support only `1`."
2021
2123
  ).min(1).optional().nullable(),
2022
2124
  unit: /* @__PURE__ */ z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).describe("Unit of time for the cycle duration.").optional()
2023
2125
  }).describe(
2024
- "Number of payment cycles the subscription is valid for.\n`0` for unlimited plans or for plans that are valid until canceled."
2025
- ).optional(),
2026
- cycleCount: /* @__PURE__ */ z.number().int().describe(
2027
- "Length of a payment cycle. For example, 1 month to have monthly payments.\nMultiply `cycleDuration`'s `count` by `cycleCount` to get the subscription duration.\nCurrently, only a value of `1` is supported."
2028
- ).min(0).max(2e3).optional().nullable()
2029
- }).describe(
2030
- "Pricing model for an order with recurring payment cycles."
2031
- )
2032
- }),
2033
- /* @__PURE__ */ z.object({
2034
- subscription: /* @__PURE__ */ z.never().optional(),
2035
- singlePaymentUnlimited: /* @__PURE__ */ z.never().optional(),
2036
- singlePaymentForDuration: /* @__PURE__ */ z.object({
2037
- count: /* @__PURE__ */ z.number().int().describe(
2038
- "Number of days, months, weeks, or years in a single payment cycle. Currently limited to support only `1`."
2039
- ).min(1).optional().nullable(),
2040
- unit: /* @__PURE__ */ z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).describe("Unit of time for the cycle duration.").optional()
2041
- }).describe(
2042
- "Pricing model for an order with a one-time payment and the order is valid for a specific amount of time."
2043
- )
2044
- }),
2045
- /* @__PURE__ */ z.object({
2046
- subscription: /* @__PURE__ */ z.never().optional(),
2047
- singlePaymentForDuration: /* @__PURE__ */ z.never().optional(),
2048
- singlePaymentUnlimited: /* @__PURE__ */ z.boolean().describe(
2049
- "Pricing model for an order with a one-time payment and the order is valid until canceled."
2050
- )
2051
- })
2052
- ])
2053
- ).describe(
2054
- "Order pricing model, price, and payment schedule.\n\nLearn more about [pricing models](https://dev.wix.com/api/rest/wix-pricing-plans/pricing-plans/introduction#wix-pricing-plans_pricing-plans_introduction_pricing-models)."
2055
- ).optional(),
2056
- type: /* @__PURE__ */ z.enum(["UNDEFINED", "ONLINE", "OFFLINE", "EXTERNAL"]).describe("How the order was processed.").optional(),
2057
- status: /* @__PURE__ */ z.enum([
2058
- "UNDEFINED",
2059
- "DRAFT",
2060
- "PENDING",
2061
- "ACTIVE",
2062
- "PAUSED",
2063
- "ENDED",
2064
- "CANCELED"
2065
- ]).describe("Status of the order.").optional(),
2066
- autoRenewCanceled: /* @__PURE__ */ z.boolean().describe(
2067
- "Whether the order will be canceled at the next payment date.\n\nIf `true`, the order status will be `CANCELED` and the next payment won't be charged. Omitted for single payment orders."
2068
- ).optional().nullable(),
2069
- cancellation: /* @__PURE__ */ z.object({
2070
- requestedDate: /* @__PURE__ */ z.date().describe("Date and time the cancellation was requested.").optional().nullable(),
2071
- cause: /* @__PURE__ */ z.enum([
2126
+ "Pricing model for an order with a one-time payment and the order is valid for a specific amount of time."
2127
+ )
2128
+ }),
2129
+ /* @__PURE__ */ z.object({
2130
+ subscription: /* @__PURE__ */ z.never().optional(),
2131
+ singlePaymentForDuration: /* @__PURE__ */ z.never().optional(),
2132
+ singlePaymentUnlimited: /* @__PURE__ */ z.boolean().describe(
2133
+ "Pricing model for an order with a one-time payment and the order is valid until canceled."
2134
+ )
2135
+ })
2136
+ ])
2137
+ ).describe(
2138
+ "Order pricing model, price, and payment schedule.\n\nLearn more about [pricing models](https://dev.wix.com/api/rest/wix-pricing-plans/pricing-plans/introduction#wix-pricing-plans_pricing-plans_introduction_pricing-models)."
2139
+ ).optional(),
2140
+ type: /* @__PURE__ */ z.enum(["UNDEFINED", "ONLINE", "OFFLINE", "EXTERNAL"]).describe("How the order was processed.").optional(),
2141
+ status: /* @__PURE__ */ z.enum([
2072
2142
  "UNDEFINED",
2073
- "OWNER_ACTION",
2074
- "MEMBER_ACTION",
2075
- "PAYMENT_FAILURE",
2076
- "PAYMENT_SETUP_FAILURE",
2077
- "UNKNOWN"
2078
- ]).describe("Reason for the cancellation.").optional(),
2079
- effectiveAt: /* @__PURE__ */ z.enum(["UNDEFINED", "IMMEDIATELY", "NEXT_PAYMENT_DATE"]).describe(
2080
- "When the cancellation takes effect. Set when cancelling the order."
2081
- ).optional()
2082
- }).describe(
2083
- "Details about the cancellation of an order.\n\nOnly present if the status is `CANCELED`."
2084
- ).optional(),
2085
- lastPaymentStatus: /* @__PURE__ */ z.enum([
2086
- "UNDEFINED",
2087
- "PAID",
2088
- "REFUNDED",
2089
- "FAILED",
2090
- "UNPAID",
2091
- "PENDING",
2092
- "NOT_APPLICABLE"
2093
- ]).describe(
2094
- "Status of the last payment for the order.\nUpdated automatically for online orders. Updated manually by the Wix user for offline orders."
2095
- ).optional(),
2096
- startDate: /* @__PURE__ */ z.date().describe("Start date and time for the ordered plan.").optional().nullable(),
2097
- endDate: /* @__PURE__ */ z.date().describe(
2098
- "Current end date and time for the ordered plan.\n\n`endDate` may be updated over the course of an order.\nIf the order is paused, it will have a later `endDate` once it is resumed.\n`endDate` may also be postponed.\n\nOmitted if the order is valid until canceled and still `ACTIVE`."
2099
- ).optional().nullable(),
2100
- pausePeriods: /* @__PURE__ */ z.array(
2101
- /* @__PURE__ */ z.object({
2102
- status: /* @__PURE__ */ z.enum(["UNDEFINED", "ACTIVE", "ENDED"]).describe("Status of the pause period.").optional(),
2103
- pauseDate: /* @__PURE__ */ z.date().describe("Start date and time of the pause period.").optional().nullable(),
2104
- resumeDate: /* @__PURE__ */ z.date().describe(
2105
- "End date and time of the pause period.\n\nOmitted while the pause period remains `ACTIVE`."
2106
- ).optional().nullable()
2107
- })
2108
- ).optional(),
2109
- freeTrialDays: /* @__PURE__ */ z.number().int().describe(
2110
- "Free trial period for the order, in days.\n\nOnly available for recurring plans."
2111
- ).min(1).max(999).optional().nullable(),
2112
- earliestEndDate: /* @__PURE__ */ z.date().describe(
2113
- "Earliest end date and time that the plan for the order can expire.\n\nCalculated by using the original end date plus any pause periods. Omitted if the order is active until canceled. Reserved for future use."
2114
- ).optional().nullable(),
2115
- currentCycle: /* @__PURE__ */ z.object({
2116
- index: /* @__PURE__ */ z.number().int().describe(
2117
- "Index of the current payment cycle in the order.\n\n`0` when order is in a free trial period. In all other cases, the index starts with `1`."
2118
- ).min(0).optional(),
2119
- startedDate: /* @__PURE__ */ z.date().describe("Start date and time for the current payment cycle.").optional().nullable(),
2120
- endedDate: /* @__PURE__ */ z.date().describe("End date and time for the current payment cycle.").optional().nullable()
2121
- }).describe(
2122
- "Current payment cycle for the order.\n\n`currentCycle` will be omitted if the order's status is `CANCELED` or `ENDED`, or if the `startDate` hasn't passed yet."
2123
- ).optional(),
2124
- planName: /* @__PURE__ */ z.string().describe("Plan name at the time of purchase.").optional(),
2125
- planDescription: /* @__PURE__ */ z.string().describe("Plan description at the time of purchase").optional(),
2126
- planPrice: /* @__PURE__ */ z.string().describe("Plan price as it was at the moment of order creation.").optional(),
2127
- _createdDate: /* @__PURE__ */ z.date().describe("Date and time the order was created.").optional().nullable(),
2128
- _updatedDate: /* @__PURE__ */ z.date().describe("Date and time the order was updated.").optional().nullable(),
2129
- formData: /* @__PURE__ */ z.object({
2130
- formId: /* @__PURE__ */ z.string().describe(
2131
- "ID of the [order form](https://dev.wix.com/docs/rest/api-reference/wix-forms/form-submissions/introduction) associated with the plan at checkout."
2132
- ).regex(
2133
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
2134
- "Must be a valid GUID"
2135
- ).optional().nullable(),
2136
- submissionId: /* @__PURE__ */ z.string().describe(
2137
- "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."
2138
- ).regex(
2139
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
2140
- "Must be a valid GUID"
2143
+ "DRAFT",
2144
+ "PENDING",
2145
+ "ACTIVE",
2146
+ "PAUSED",
2147
+ "ENDED",
2148
+ "CANCELED"
2149
+ ]).describe("Status of the order.").optional(),
2150
+ autoRenewCanceled: /* @__PURE__ */ z.boolean().describe(
2151
+ "Whether the order will be canceled at the next payment date.\n\nIf `true`, the order status will be `CANCELED` and the next payment won't be charged. Omitted for single payment orders."
2141
2152
  ).optional().nullable(),
2142
- submissionData: /* @__PURE__ */ z.record(/* @__PURE__ */ z.string(), /* @__PURE__ */ z.any()).describe("Data submitted to the plan's order form at checkout.").optional()
2143
- }).describe(
2144
- "Information about the form submitted during the plan's checkout."
2145
- ).optional()
2146
- }).describe("The previewed order, as if the plan had been ordered.").optional(),
2147
- purchaseLimitExceeded: /* @__PURE__ */ z.boolean().describe(
2148
- "Whether this previewed order would exceed the permitted amount of purchases available\nfor this plan for this buyer.\n\nAlways `false` for plans that do not have purchase limits."
2149
- ).optional()
2150
- });
2151
- var GetPricePreviewRequest = /* @__PURE__ */ z.object({
2152
- planId: /* @__PURE__ */ z.string().describe("ID of plan to preview.").regex(
2153
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
2154
- "Must be a valid GUID"
2155
- ),
2156
- options: /* @__PURE__ */ z.object({
2157
- couponCode: /* @__PURE__ */ z.string().describe("Coupon code to apply, from the Coupons API.").min(1).max(20).optional().nullable()
2158
- }).describe("Options for getting a price preview. ").optional()
2159
- });
2160
- var GetPricePreviewResponse = /* @__PURE__ */ z.object({
2161
- price: /* @__PURE__ */ z.intersection(
2162
- /* @__PURE__ */ z.object({
2163
- subtotal: /* @__PURE__ */ z.string().describe(
2164
- 'Price of the order excluding tax, specified as a monetary amount. for example, `"9.99"`.'
2165
- ).optional(),
2166
- discount: /* @__PURE__ */ z.string().describe("Total discount applied.").optional(),
2167
- tax: /* @__PURE__ */ z.object({
2168
- name: /* @__PURE__ */ z.string().describe("Name of the tax. For example, VAT.").optional(),
2169
- includedInPrice: /* @__PURE__ */ z.boolean().describe(
2170
- "Whether tax is included in the original price. When `false`, tax is added at checkout."
2171
- ).optional(),
2172
- rate: /* @__PURE__ */ z.string().describe(
2173
- 'Tax rate percentage, as a number between 0 and 100. For example, a 7% tax rate is `"7.00"`.'
2174
- ).optional(),
2175
- amount: /* @__PURE__ */ z.string().describe(
2176
- 'Total tax, specified as a monetary amount. For example, `"3.99"`.'
2153
+ cancellation: /* @__PURE__ */ z.object({
2154
+ requestedDate: /* @__PURE__ */ z.date().describe("Date and time the cancellation was requested.").optional().nullable(),
2155
+ cause: /* @__PURE__ */ z.enum([
2156
+ "UNDEFINED",
2157
+ "OWNER_ACTION",
2158
+ "MEMBER_ACTION",
2159
+ "PAYMENT_FAILURE",
2160
+ "PAYMENT_SETUP_FAILURE",
2161
+ "UNKNOWN"
2162
+ ]).describe("Reason for the cancellation.").optional(),
2163
+ effectiveAt: /* @__PURE__ */ z.enum(["UNDEFINED", "IMMEDIATELY", "NEXT_PAYMENT_DATE"]).describe(
2164
+ "When the cancellation takes effect. Set when cancelling the order."
2177
2165
  ).optional()
2178
- }).describe("Tax applied.").optional(),
2179
- total: /* @__PURE__ */ z.string().describe(
2180
- 'Price after tax and discount is applied, specified as a monetary amount. For example, `"13.98"`.\n\nIf no tax is applied, the amount is the same as `subtotal`.'
2166
+ }).describe(
2167
+ "Details about the cancellation of an order.\n\nOnly present if the status is `CANCELED`."
2181
2168
  ).optional(),
2182
- planPrice: /* @__PURE__ */ z.string().describe("Plan price as it was at the moment of order creation.").optional(),
2183
- currency: /* @__PURE__ */ z.string().describe(
2184
- "Currency code. Must be valid ISO 4217 currency code (e.g., USD)."
2169
+ lastPaymentStatus: /* @__PURE__ */ z.enum([
2170
+ "UNDEFINED",
2171
+ "PAID",
2172
+ "REFUNDED",
2173
+ "FAILED",
2174
+ "UNPAID",
2175
+ "PENDING",
2176
+ "NOT_APPLICABLE"
2177
+ ]).describe(
2178
+ "Status of the last payment for the order.\nUpdated automatically for online orders. Updated manually by the Wix user for offline orders."
2179
+ ).optional(),
2180
+ startDate: /* @__PURE__ */ z.date().describe("Start date and time for the ordered plan.").optional().nullable(),
2181
+ endDate: /* @__PURE__ */ z.date().describe(
2182
+ "Current end date and time for the ordered plan.\n\n`endDate` may be updated over the course of an order.\nIf the order is paused, it will have a later `endDate` once it is resumed.\n`endDate` may also be postponed.\n\nOmitted if the order is valid until canceled and still `ACTIVE`."
2183
+ ).optional().nullable(),
2184
+ pausePeriods: /* @__PURE__ */ z.array(
2185
+ /* @__PURE__ */ z.object({
2186
+ status: /* @__PURE__ */ z.enum(["UNDEFINED", "ACTIVE", "ENDED"]).describe("Status of the pause period.").optional(),
2187
+ pauseDate: /* @__PURE__ */ z.date().describe("Start date and time of the pause period.").optional().nullable(),
2188
+ resumeDate: /* @__PURE__ */ z.date().describe(
2189
+ "End date and time of the pause period.\n\nOmitted while the pause period remains `ACTIVE`."
2190
+ ).optional().nullable()
2191
+ })
2185
2192
  ).optional(),
2186
2193
  freeTrialDays: /* @__PURE__ */ z.number().int().describe(
2187
- "Free trial period for the order in days. Only available for recurring plans."
2194
+ "Free trial period for the order, in days.\n\nOnly available for recurring plans."
2188
2195
  ).min(1).max(999).optional().nullable(),
2189
- coupon: /* @__PURE__ */ z.object({
2190
- code: /* @__PURE__ */ z.string().describe("Code of the applied coupon.").min(1).max(20).optional(),
2191
- amount: /* @__PURE__ */ z.string().describe("Total discount of the coupon, as a monetary amount.").optional(),
2192
- _id: /* @__PURE__ */ z.string().describe("Coupon ID.").regex(
2196
+ earliestEndDate: /* @__PURE__ */ z.date().describe(
2197
+ "Earliest end date and time that the plan for the order can expire.\n\nCalculated by using the original end date plus any pause periods. Omitted if the order is active until canceled. Reserved for future use."
2198
+ ).optional().nullable(),
2199
+ currentCycle: /* @__PURE__ */ z.object({
2200
+ index: /* @__PURE__ */ z.number().int().describe(
2201
+ "Index of the current payment cycle in the order.\n\n`0` when order is in a free trial period. In all other cases, the index starts with `1`."
2202
+ ).min(0).optional(),
2203
+ startedDate: /* @__PURE__ */ z.date().describe("Start date and time for the current payment cycle.").optional().nullable(),
2204
+ endedDate: /* @__PURE__ */ z.date().describe("End date and time for the current payment cycle.").optional().nullable()
2205
+ }).describe(
2206
+ "Current payment cycle for the order.\n\n`currentCycle` will be omitted if the order's status is `CANCELED` or `ENDED`, or if the `startDate` hasn't passed yet."
2207
+ ).optional(),
2208
+ planName: /* @__PURE__ */ z.string().describe("Plan name at the time of purchase.").optional(),
2209
+ planDescription: /* @__PURE__ */ z.string().describe("Plan description at the time of purchase").optional(),
2210
+ planPrice: /* @__PURE__ */ z.string().describe("Plan price as it was at the moment of order creation.").optional(),
2211
+ _createdDate: /* @__PURE__ */ z.date().describe("Date and time the order was created.").optional().nullable(),
2212
+ _updatedDate: /* @__PURE__ */ z.date().describe("Date and time the order was updated.").optional().nullable(),
2213
+ formData: /* @__PURE__ */ z.object({
2214
+ formId: /* @__PURE__ */ z.string().describe(
2215
+ "ID of the [order form](https://dev.wix.com/docs/rest/api-reference/wix-forms/form-submissions/introduction) associated with the plan at checkout."
2216
+ ).regex(
2193
2217
  /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
2194
2218
  "Must be a valid GUID"
2195
- ).optional()
2219
+ ).optional().nullable(),
2220
+ submissionId: /* @__PURE__ */ z.string().describe(
2221
+ "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."
2222
+ ).regex(
2223
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
2224
+ "Must be a valid GUID"
2225
+ ).optional().nullable(),
2226
+ submissionData: /* @__PURE__ */ z.record(/* @__PURE__ */ z.string(), /* @__PURE__ */ z.any()).describe("Data submitted to the plan's order form at checkout.").optional()
2196
2227
  }).describe(
2197
- "Coupon applied to the order. Empty means no coupon was applied."
2228
+ "Information about the form submitted during the plan's checkout."
2198
2229
  ).optional()
2199
- }),
2200
- /* @__PURE__ */ z.xor([
2201
- /* @__PURE__ */ z.object({
2202
- subscription: /* @__PURE__ */ z.never().optional(),
2203
- singlePaymentForDuration: /* @__PURE__ */ z.never().optional(),
2204
- singlePaymentUnlimited: /* @__PURE__ */ z.never().optional()
2205
- }),
2206
- /* @__PURE__ */ z.object({
2207
- singlePaymentForDuration: /* @__PURE__ */ z.never().optional(),
2208
- singlePaymentUnlimited: /* @__PURE__ */ z.never().optional(),
2209
- subscription: /* @__PURE__ */ z.object({
2210
- cycleDuration: /* @__PURE__ */ z.object({
2211
- count: /* @__PURE__ */ z.number().int().describe(
2212
- "Number of days, months, weeks, or years in a single payment cycle. Currently limited to support only `1`."
2213
- ).min(1).optional().nullable(),
2214
- unit: /* @__PURE__ */ z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).describe("Unit of time for the cycle duration.").optional()
2215
- }).describe(
2216
- "Number of payment cycles the subscription is valid for.\n`0` for unlimited plans or for plans that are valid until canceled."
2217
- ).optional(),
2218
- cycleCount: /* @__PURE__ */ z.number().int().describe(
2219
- "Length of a payment cycle. For example, 1 month to have monthly payments.\nMultiply `cycleDuration`'s `count` by `cycleCount` to get the subscription duration.\nCurrently, only a value of `1` is supported."
2220
- ).min(0).max(2e3).optional().nullable()
2221
- }).describe("Order has recurring payments.")
2222
- }),
2223
- /* @__PURE__ */ z.object({
2224
- subscription: /* @__PURE__ */ z.never().optional(),
2225
- singlePaymentUnlimited: /* @__PURE__ */ z.never().optional(),
2226
- singlePaymentForDuration: /* @__PURE__ */ z.object({
2227
- count: /* @__PURE__ */ z.number().int().describe(
2228
- "Number of days, months, weeks, or years in a single payment cycle. Currently limited to support only `1`."
2229
- ).min(1).optional().nullable(),
2230
- unit: /* @__PURE__ */ z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).describe("Unit of time for the cycle duration.").optional()
2231
- }).describe(
2232
- "One-time payment. Order is valid for a specified duration."
2233
- )
2234
- }),
2235
- /* @__PURE__ */ z.object({
2236
- subscription: /* @__PURE__ */ z.never().optional(),
2237
- singlePaymentForDuration: /* @__PURE__ */ z.never().optional(),
2238
- singlePaymentUnlimited: /* @__PURE__ */ z.boolean().describe("One-time payment. Order is valid until it is canceled.")
2239
- })
2240
- ])
2241
- ).describe(
2242
- "__Deprecated.__ Use `prices` instead. This property will be removed on September 30, 2022."
2243
- ).optional(),
2244
- prices: /* @__PURE__ */ z.array(
2245
- /* @__PURE__ */ z.object({
2246
- duration: /* @__PURE__ */ z.object({
2247
- cycleFrom: /* @__PURE__ */ z.number().int().describe(
2248
- "Price starts to apply with this cycle.\n\n`1` is the first payment cycle for all pricing models."
2249
- ).optional(),
2250
- numberOfCycles: /* @__PURE__ */ z.number().int().describe(
2251
- "Amount of cycles to apply price for.\n\nFor `subscription` pricing models with a finite number of cycles, the `numberOfCycles` is the same as `pricing.subscription.cycleCount`.\n\nFor `subscription` pricing models that are unlimited or until-canceled, the `numberOfCycles` is not returned.\n\nFor `singlePaymentForDuration` and `singlePaymentUnlimited` pricing models, the `numberOfCycles` is `1`."
2252
- ).optional().nullable()
2253
- }).describe(
2254
- "Cycle duration to apply `price` for.\n\nUse with all pricing models.\nCan apply the same price to multiple payment cycles."
2255
- ).optional(),
2256
- price: /* @__PURE__ */ z.object({
2257
- subtotal: /* @__PURE__ */ z.string().describe(
2258
- 'Price of the order excluding tax, specified as a monetary amount. For example, `"9.99"`.'
2259
- ).optional(),
2260
- coupon: /* @__PURE__ */ z.object({
2261
- code: /* @__PURE__ */ z.string().describe("Code of the applied coupon.").min(1).max(20).optional(),
2262
- amount: /* @__PURE__ */ z.string().describe(
2263
- "Total discount of the coupon, as a monetary amount."
2264
- ).optional(),
2265
- _id: /* @__PURE__ */ z.string().describe("Coupon ID.").regex(
2266
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
2267
- "Must be a valid GUID"
2268
- ).optional()
2269
- }).describe("Coupon applied to the order, from the Coupons API.").optional(),
2270
- discount: /* @__PURE__ */ z.string().describe("Total discount applied to the order.").optional(),
2271
- tax: /* @__PURE__ */ z.object({
2272
- name: /* @__PURE__ */ z.string().describe("Name of the tax. For example, VAT.").optional(),
2273
- includedInPrice: /* @__PURE__ */ z.boolean().describe(
2274
- "Whether tax is included in the original price. When `false`, tax is added at checkout."
2275
- ).optional(),
2276
- rate: /* @__PURE__ */ z.string().describe(
2277
- 'Tax rate percentage, as a number between 0 and 100. For example, a 7% tax rate is `"7.00"`.'
2278
- ).optional(),
2279
- amount: /* @__PURE__ */ z.string().describe(
2280
- 'Total tax, specified as a monetary amount. For example, `"3.99"`.'
2281
- ).optional()
2282
- }).describe(
2283
- "Tax applied to the order.\n\nTax is only applied if the site [has it configured](https://support.wix.com/en/article/pricing-plans-setting-up-tax-collection)."
2284
- ).optional(),
2285
- total: /* @__PURE__ */ z.string().describe(
2286
- 'Price after tax and discount is applied. Specified as a monetary amount, for example, `"13.98"`.\n\nIf no tax is applied, the amount is the same as `subtotal`.'
2287
- ).optional(),
2288
- currency: /* @__PURE__ */ z.string().describe(
2289
- "Three-letter currency code in\n[ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format."
2290
- ).optional(),
2291
- proration: /* @__PURE__ */ z.string().describe(
2292
- "Price change after billing date was change and price was adjusted. Could be positive and negative values."
2293
- ).optional()
2294
- }).describe("Order price.").optional()
2295
2230
  })
2231
+ ).optional(),
2232
+ pagingMetadata: /* @__PURE__ */ z.object({
2233
+ count: /* @__PURE__ */ z.number().int().describe("Number of items returned in the response.").optional().nullable(),
2234
+ offset: /* @__PURE__ */ z.number().int().describe("Offset that was requested.").optional().nullable(),
2235
+ total: /* @__PURE__ */ z.number().int().describe(
2236
+ "Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set."
2237
+ ).optional().nullable(),
2238
+ tooManyToCount: /* @__PURE__ */ z.boolean().describe(
2239
+ "Flag that indicates the server failed to calculate the `total` field."
2240
+ ).optional().nullable(),
2241
+ cursors: /* @__PURE__ */ z.object({
2242
+ next: /* @__PURE__ */ z.string().describe(
2243
+ "Cursor string pointing to the next page in the list of results."
2244
+ ).max(16e3).optional().nullable(),
2245
+ prev: /* @__PURE__ */ z.string().describe(
2246
+ "Cursor pointing to the previous page in the list of results."
2247
+ ).max(16e3).optional().nullable()
2248
+ }).describe(
2249
+ "Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used."
2250
+ ).optional()
2251
+ }).describe(
2252
+ "Object containing paging-related data (number of orders returned, offset)."
2296
2253
  ).optional()
2297
2254
  });
2255
+ var PostponeEndDateRequest = /* @__PURE__ */ z.object({
2256
+ _id: /* @__PURE__ */ z.string().describe("Order ID.").regex(
2257
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
2258
+ "Must be a valid GUID"
2259
+ ),
2260
+ endDate: /* @__PURE__ */ z.date().describe(
2261
+ "New end date and time.\n\nMust be later than the current end date and time."
2262
+ )
2263
+ });
2264
+ var PostponeEndDateResponse = /* @__PURE__ */ z.object({});
2265
+ var CancelOrderRequest = /* @__PURE__ */ z.object({
2266
+ _id: /* @__PURE__ */ z.string().describe("Order ID.").regex(
2267
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
2268
+ "Must be a valid GUID"
2269
+ ),
2270
+ effectiveAt: /* @__PURE__ */ z.enum([
2271
+ "UNDEFINED",
2272
+ "IMMEDIATELY",
2273
+ "NEXT_PAYMENT_DATE"
2274
+ ])
2275
+ });
2276
+ var CancelOrderResponse = /* @__PURE__ */ z.object({});
2277
+ var MarkAsPaidRequest = /* @__PURE__ */ z.object({
2278
+ _id: /* @__PURE__ */ z.string().describe("Order ID.").regex(
2279
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
2280
+ "Must be a valid GUID"
2281
+ )
2282
+ });
2283
+ var MarkAsPaidResponse = /* @__PURE__ */ z.object({});
2284
+ var PauseOrderRequest = /* @__PURE__ */ z.object({
2285
+ _id: /* @__PURE__ */ z.string().describe("Order ID.").regex(
2286
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
2287
+ "Must be a valid GUID"
2288
+ )
2289
+ });
2290
+ var PauseOrderResponse = /* @__PURE__ */ z.object({});
2291
+ var ResumeOrderRequest = /* @__PURE__ */ z.object({
2292
+ _id: /* @__PURE__ */ z.string().describe("Order ID.").regex(
2293
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
2294
+ "Must be a valid GUID"
2295
+ )
2296
+ });
2297
+ var ResumeOrderResponse = /* @__PURE__ */ z.object({});
2298
2298
  var MemberGetOrderRequest = /* @__PURE__ */ z.object({
2299
2299
  _id: /* @__PURE__ */ z.string().describe("Order ID.").regex(
2300
2300
  /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,