@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.
@@ -65,16 +65,30 @@ module.exports = __toCommonJS(schemas_exports);
65
65
 
66
66
  // src/pricing-plans-v2-order-orders.schemas.ts
67
67
  var z = __toESM(require("zod"));
68
- var ManagementGetOrderRequest = /* @__PURE__ */ z.object({
69
- _id: /* @__PURE__ */ z.string().describe("Order ID.").regex(
68
+ var CreateOnlineOrderRequest = /* @__PURE__ */ z.object({
69
+ planId: /* @__PURE__ */ z.string().describe("Plan ID.").regex(
70
70
  /^[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}$/,
71
71
  "Must be a valid GUID"
72
72
  ),
73
73
  options: /* @__PURE__ */ z.object({
74
- fieldSet: /* @__PURE__ */ z.enum(["UNKNOWN_SET", "BASIC", "FULL"]).optional()
75
- }).describe("Options to use when getting an order. ").optional()
74
+ startDate: /* @__PURE__ */ z.date().describe(
75
+ "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."
76
+ ).optional().nullable(),
77
+ couponCode: /* @__PURE__ */ z.string().describe("Coupon code to apply.").min(1).max(20).optional().nullable(),
78
+ onBehalf: /* @__PURE__ */ z.object({
79
+ memberId: /* @__PURE__ */ z.string().describe("Member ID.").regex(
80
+ /^[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}$/,
81
+ "Must be a valid GUID"
82
+ ),
83
+ orderMethod: /* @__PURE__ */ z.enum(["UNKNOWN", "MOTO", "POS"]).optional()
84
+ }).describe("Provided if checkout is initiated on buyer's behalf.").optional(),
85
+ submissionId: /* @__PURE__ */ z.string().describe("Submission ID of the form submitted with this order.").regex(
86
+ /^[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}$/,
87
+ "Must be a valid GUID"
88
+ ).optional().nullable()
89
+ }).optional()
76
90
  });
77
- var ManagementGetOrderResponse = /* @__PURE__ */ z.object({
91
+ var CreateOnlineOrderResponse = /* @__PURE__ */ z.object({
78
92
  order: /* @__PURE__ */ z.object({
79
93
  _id: /* @__PURE__ */ z.string().describe("Order ID.").regex(
80
94
  /^[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}$/,
@@ -395,474 +409,365 @@ var ManagementGetOrderResponse = /* @__PURE__ */ z.object({
395
409
  }).describe(
396
410
  "Information about the form submitted during the plan's checkout."
397
411
  ).optional()
398
- }).describe("Order.").optional()
412
+ }).describe("Created online order.").optional()
399
413
  });
400
- var ManagementListOrdersRequest = /* @__PURE__ */ z.object({
414
+ var CreateOfflineOrderRequest = /* @__PURE__ */ z.object({
415
+ planId: /* @__PURE__ */ z.string().describe("ID of the plan being ordered, from the Plans API.").regex(
416
+ /^[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}$/,
417
+ "Must be a valid GUID"
418
+ ),
419
+ memberId: /* @__PURE__ */ z.string().describe("ID of the member ordering the plan, from the Members API.").regex(
420
+ /^[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}$/,
421
+ "Must be a valid GUID"
422
+ ),
401
423
  options: /* @__PURE__ */ z.object({
402
- buyerIds: /* @__PURE__ */ z.array(/* @__PURE__ */ z.string()).optional(),
403
- planIds: /* @__PURE__ */ z.array(/* @__PURE__ */ z.string()).optional(),
404
- autoRenewCanceled: /* @__PURE__ */ z.boolean().describe(
405
- "Filter by whether or not the auto-renewal of recurring orders was canceled."
424
+ startDate: /* @__PURE__ */ z.date().describe(
425
+ "Start date and time for the ordered plan in a `YYYY-MM-DDThh:mm[:ss][.sss]Z` format.\n\nDefault: Current date and time."
406
426
  ).optional().nullable(),
407
- orderStatuses: /* @__PURE__ */ z.array(
408
- /* @__PURE__ */ z.enum([
409
- "UNDEFINED",
410
- "DRAFT",
411
- "PENDING",
412
- "ACTIVE",
413
- "PAUSED",
414
- "ENDED",
415
- "CANCELED"
416
- ])
427
+ paid: /* @__PURE__ */ z.boolean().describe("Whether the order is paid.\n\nDefault: `false`").optional().nullable(),
428
+ couponCode: /* @__PURE__ */ z.string().describe("Coupon code to apply, from the Coupons API.").min(1).max(20).optional().nullable(),
429
+ submissionId: /* @__PURE__ */ z.string().describe("Form submission ID that was submitted with the order.").regex(
430
+ /^[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}$/,
431
+ "Must be a valid GUID"
432
+ ).optional().nullable()
433
+ }).describe("Options for creating an offline order. ").optional()
434
+ });
435
+ var CreateOfflineOrderResponse = /* @__PURE__ */ z.object({
436
+ order: /* @__PURE__ */ z.object({
437
+ _id: /* @__PURE__ */ z.string().describe("Order ID.").regex(
438
+ /^[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}$/,
439
+ "Must be a valid GUID"
417
440
  ).optional(),
418
- paymentStatuses: /* @__PURE__ */ z.array(
419
- /* @__PURE__ */ z.enum([
420
- "UNDEFINED",
421
- "PAID",
422
- "REFUNDED",
423
- "FAILED",
424
- "UNPAID",
425
- "PENDING",
426
- "NOT_APPLICABLE"
427
- ])
441
+ planId: /* @__PURE__ */ z.string().describe(
442
+ "ID of the plan purchased with the order, from the Plans API."
443
+ ).regex(
444
+ /^[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}$/,
445
+ "Must be a valid GUID"
428
446
  ).optional(),
429
- limit: /* @__PURE__ */ z.number().int().describe(
430
- "Number of orders to return. See Sorting and Paging for more information.\n\nMax: `50`"
431
- ).min(1).max(50).optional().nullable(),
432
- offset: /* @__PURE__ */ z.number().int().describe("Number of orders to skip in the current sort order.").min(0).optional().nullable(),
433
- sorting: /* @__PURE__ */ z.object({
434
- fieldName: /* @__PURE__ */ z.string().describe("Name of the field to sort by.").max(512).optional(),
435
- order: /* @__PURE__ */ z.enum(["ASC", "DESC"]).optional(),
436
- origin: /* @__PURE__ */ z.object({
437
- latitude: /* @__PURE__ */ z.number().describe("Address latitude.").optional().nullable(),
438
- longitude: /* @__PURE__ */ z.number().describe("Address longitude.").optional().nullable()
439
- }).describe(
440
- "Origin point for geo-distance sorting on a GEO field\nresults are ordered by distance from this point (ASC = nearest first, DESC = farthest first)."
441
- ).optional()
442
- }).describe(
443
- "Sort order.\n\nUse `ASC` for ascending order or `DESC` for descending order.\n\nDefault: `DESC`."
447
+ subscriptionId: /* @__PURE__ */ z.string().describe(
448
+ "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)."
449
+ ).regex(
450
+ /^[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}$/,
451
+ "Must be a valid GUID"
444
452
  ).optional(),
445
- fieldSet: /* @__PURE__ */ z.enum(["UNKNOWN_SET", "BASIC", "FULL"]).optional()
446
- }).describe("Filtering, sorting, and pagination options. ").optional()
447
- });
448
- var ManagementListOrdersResponse = /* @__PURE__ */ z.object({
449
- orders: /* @__PURE__ */ z.array(
450
- /* @__PURE__ */ z.object({
451
- _id: /* @__PURE__ */ z.string().describe("Order ID.").regex(
452
- /^[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}$/,
453
- "Must be a valid GUID"
454
- ).optional(),
455
- planId: /* @__PURE__ */ z.string().describe(
456
- "ID of the plan purchased with the order, from the Plans API."
457
- ).regex(
458
- /^[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}$/,
459
- "Must be a valid GUID"
460
- ).optional(),
461
- subscriptionId: /* @__PURE__ */ z.string().describe(
462
- "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)."
463
- ).regex(
453
+ wixPayOrderId: /* @__PURE__ */ z.string().describe(
454
+ "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."
455
+ ).regex(
456
+ /^[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}$/,
457
+ "Must be a valid GUID"
458
+ ).optional().nullable(),
459
+ buyer: /* @__PURE__ */ z.object({
460
+ memberId: /* @__PURE__ */ z.string().describe("Member ID for a Wix site member, from the Members API.").regex(
464
461
  /^[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}$/,
465
462
  "Must be a valid GUID"
466
463
  ).optional(),
467
- wixPayOrderId: /* @__PURE__ */ z.string().describe(
468
- "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."
464
+ contactId: /* @__PURE__ */ z.string().describe(
465
+ "Contact ID for a Wix site contact, from the Contacts API."
469
466
  ).regex(
470
467
  /^[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}$/,
471
468
  "Must be a valid GUID"
472
- ).optional().nullable(),
473
- buyer: /* @__PURE__ */ z.object({
474
- memberId: /* @__PURE__ */ z.string().describe(
475
- "Member ID for a Wix site member, from the Members API."
476
- ).regex(
477
- /^[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}$/,
478
- "Must be a valid GUID"
469
+ ).optional()
470
+ }).describe(
471
+ "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`."
472
+ ).optional(),
473
+ priceDetails: /* @__PURE__ */ z.intersection(
474
+ /* @__PURE__ */ z.object({
475
+ subtotal: /* @__PURE__ */ z.string().describe(
476
+ 'Price of the order excluding tax, specified as a monetary amount. for example, `"9.99"`.'
479
477
  ).optional(),
480
- contactId: /* @__PURE__ */ z.string().describe(
481
- "Contact ID for a Wix site contact, from the Contacts API."
482
- ).regex(
483
- /^[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}$/,
484
- "Must be a valid GUID"
485
- ).optional()
486
- }).describe(
487
- "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`."
488
- ).optional(),
489
- priceDetails: /* @__PURE__ */ z.intersection(
490
- /* @__PURE__ */ z.object({
491
- subtotal: /* @__PURE__ */ z.string().describe(
492
- 'Price of the order excluding tax, specified as a monetary amount. for example, `"9.99"`.'
493
- ).optional(),
494
- discount: /* @__PURE__ */ z.string().describe("Total discount applied.").optional(),
495
- tax: /* @__PURE__ */ z.object({
496
- name: /* @__PURE__ */ z.string().describe("Name of the tax. For example, VAT.").optional(),
497
- includedInPrice: /* @__PURE__ */ z.boolean().describe(
498
- "Whether tax is included in the original price. When `false`, tax is added at checkout."
499
- ).optional(),
500
- rate: /* @__PURE__ */ z.string().describe(
501
- 'Tax rate percentage, as a number between 0 and 100. For example, a 7% tax rate is `"7.00"`.'
502
- ).optional(),
503
- amount: /* @__PURE__ */ z.string().describe(
504
- 'Total tax, specified as a monetary amount. For example, `"3.99"`.'
505
- ).optional()
506
- }).describe("Tax applied.").optional(),
507
- total: /* @__PURE__ */ z.string().describe(
508
- '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`.'
478
+ discount: /* @__PURE__ */ z.string().describe("Total discount applied.").optional(),
479
+ tax: /* @__PURE__ */ z.object({
480
+ name: /* @__PURE__ */ z.string().describe("Name of the tax. For example, VAT.").optional(),
481
+ includedInPrice: /* @__PURE__ */ z.boolean().describe(
482
+ "Whether tax is included in the original price. When `false`, tax is added at checkout."
509
483
  ).optional(),
510
- planPrice: /* @__PURE__ */ z.string().describe(
511
- "Plan price as it was at the moment of order creation."
484
+ rate: /* @__PURE__ */ z.string().describe(
485
+ 'Tax rate percentage, as a number between 0 and 100. For example, a 7% tax rate is `"7.00"`.'
512
486
  ).optional(),
513
- currency: /* @__PURE__ */ z.string().describe(
514
- "Currency code. Must be valid ISO 4217 currency code (e.g., USD)."
487
+ amount: /* @__PURE__ */ z.string().describe(
488
+ 'Total tax, specified as a monetary amount. For example, `"3.99"`.'
489
+ ).optional()
490
+ }).describe("Tax applied.").optional(),
491
+ total: /* @__PURE__ */ z.string().describe(
492
+ '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`.'
493
+ ).optional(),
494
+ planPrice: /* @__PURE__ */ z.string().describe("Plan price as it was at the moment of order creation.").optional(),
495
+ currency: /* @__PURE__ */ z.string().describe(
496
+ "Currency code. Must be valid ISO 4217 currency code (e.g., USD)."
497
+ ).optional(),
498
+ freeTrialDays: /* @__PURE__ */ z.number().int().describe(
499
+ "Free trial period for the order in days. Only available for recurring plans."
500
+ ).min(1).max(999).optional().nullable(),
501
+ coupon: /* @__PURE__ */ z.object({
502
+ code: /* @__PURE__ */ z.string().describe("Code of the applied coupon.").min(1).max(20).optional(),
503
+ amount: /* @__PURE__ */ z.string().describe(
504
+ "Total discount of the coupon, as a monetary amount."
515
505
  ).optional(),
516
- freeTrialDays: /* @__PURE__ */ z.number().int().describe(
517
- "Free trial period for the order in days. Only available for recurring plans."
518
- ).min(1).max(999).optional().nullable(),
519
- coupon: /* @__PURE__ */ z.object({
520
- code: /* @__PURE__ */ z.string().describe("Code of the applied coupon.").min(1).max(20).optional(),
521
- amount: /* @__PURE__ */ z.string().describe(
522
- "Total discount of the coupon, as a monetary amount."
523
- ).optional(),
524
- _id: /* @__PURE__ */ z.string().describe("Coupon ID.").regex(
525
- /^[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}$/,
526
- "Must be a valid GUID"
527
- ).optional()
528
- }).describe(
529
- "Coupon applied to the order. Empty means no coupon was applied."
506
+ _id: /* @__PURE__ */ z.string().describe("Coupon ID.").regex(
507
+ /^[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}$/,
508
+ "Must be a valid GUID"
530
509
  ).optional()
510
+ }).describe(
511
+ "Coupon applied to the order. Empty means no coupon was applied."
512
+ ).optional()
513
+ }),
514
+ /* @__PURE__ */ z.xor([
515
+ /* @__PURE__ */ z.object({
516
+ subscription: /* @__PURE__ */ z.never().optional(),
517
+ singlePaymentForDuration: /* @__PURE__ */ z.never().optional(),
518
+ singlePaymentUnlimited: /* @__PURE__ */ z.never().optional()
531
519
  }),
532
- /* @__PURE__ */ z.xor([
533
- /* @__PURE__ */ z.object({
534
- subscription: /* @__PURE__ */ z.never().optional(),
535
- singlePaymentForDuration: /* @__PURE__ */ z.never().optional(),
536
- singlePaymentUnlimited: /* @__PURE__ */ z.never().optional()
537
- }),
538
- /* @__PURE__ */ z.object({
539
- singlePaymentForDuration: /* @__PURE__ */ z.never().optional(),
540
- singlePaymentUnlimited: /* @__PURE__ */ z.never().optional(),
541
- subscription: /* @__PURE__ */ z.object({
542
- cycleDuration: /* @__PURE__ */ z.object({
543
- count: /* @__PURE__ */ z.number().int().describe(
544
- "Number of days, months, weeks, or years in a single payment cycle. Currently limited to support only `1`."
545
- ).min(1).optional().nullable(),
546
- unit: /* @__PURE__ */ z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).describe("Unit of time for the cycle duration.").optional()
547
- }).describe(
548
- "Number of payment cycles the subscription is valid for.\n`0` for unlimited plans or for plans that are valid until canceled."
549
- ).optional(),
550
- cycleCount: /* @__PURE__ */ z.number().int().describe(
551
- "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."
552
- ).min(0).max(2e3).optional().nullable()
553
- }).describe("Order has recurring payments.")
554
- }),
555
- /* @__PURE__ */ z.object({
556
- subscription: /* @__PURE__ */ z.never().optional(),
557
- singlePaymentUnlimited: /* @__PURE__ */ z.never().optional(),
558
- singlePaymentForDuration: /* @__PURE__ */ z.object({
520
+ /* @__PURE__ */ z.object({
521
+ singlePaymentForDuration: /* @__PURE__ */ z.never().optional(),
522
+ singlePaymentUnlimited: /* @__PURE__ */ z.never().optional(),
523
+ subscription: /* @__PURE__ */ z.object({
524
+ cycleDuration: /* @__PURE__ */ z.object({
559
525
  count: /* @__PURE__ */ z.number().int().describe(
560
526
  "Number of days, months, weeks, or years in a single payment cycle. Currently limited to support only `1`."
561
527
  ).min(1).optional().nullable(),
562
528
  unit: /* @__PURE__ */ z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).describe("Unit of time for the cycle duration.").optional()
563
529
  }).describe(
564
- "One-time payment. Order is valid for a specified duration."
565
- )
566
- }),
567
- /* @__PURE__ */ z.object({
568
- subscription: /* @__PURE__ */ z.never().optional(),
569
- singlePaymentForDuration: /* @__PURE__ */ z.never().optional(),
570
- singlePaymentUnlimited: /* @__PURE__ */ z.boolean().describe(
571
- "One-time payment. Order is valid until it is canceled."
572
- )
573
- })
574
- ])
575
- ).describe(
576
- "__Deprecated.__ Use `pricing` instead. This property will be removed on September 30, 2022."
577
- ).optional(),
578
- pricing: /* @__PURE__ */ z.intersection(
530
+ "Number of payment cycles the subscription is valid for.\n`0` for unlimited plans or for plans that are valid until canceled."
531
+ ).optional(),
532
+ cycleCount: /* @__PURE__ */ z.number().int().describe(
533
+ "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."
534
+ ).min(0).max(2e3).optional().nullable()
535
+ }).describe("Order has recurring payments.")
536
+ }),
579
537
  /* @__PURE__ */ z.object({
580
- prices: /* @__PURE__ */ z.array(
581
- /* @__PURE__ */ z.object({
582
- duration: /* @__PURE__ */ z.object({
583
- cycleFrom: /* @__PURE__ */ z.number().int().describe(
584
- "Price starts to apply with this cycle.\n\n`1` is the first payment cycle for all pricing models."
538
+ subscription: /* @__PURE__ */ z.never().optional(),
539
+ singlePaymentUnlimited: /* @__PURE__ */ z.never().optional(),
540
+ singlePaymentForDuration: /* @__PURE__ */ z.object({
541
+ count: /* @__PURE__ */ z.number().int().describe(
542
+ "Number of days, months, weeks, or years in a single payment cycle. Currently limited to support only `1`."
543
+ ).min(1).optional().nullable(),
544
+ unit: /* @__PURE__ */ z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).describe("Unit of time for the cycle duration.").optional()
545
+ }).describe(
546
+ "One-time payment. Order is valid for a specified duration."
547
+ )
548
+ }),
549
+ /* @__PURE__ */ z.object({
550
+ subscription: /* @__PURE__ */ z.never().optional(),
551
+ singlePaymentForDuration: /* @__PURE__ */ z.never().optional(),
552
+ singlePaymentUnlimited: /* @__PURE__ */ z.boolean().describe(
553
+ "One-time payment. Order is valid until it is canceled."
554
+ )
555
+ })
556
+ ])
557
+ ).describe(
558
+ "__Deprecated.__ Use `pricing` instead. This property will be removed on September 30, 2022."
559
+ ).optional(),
560
+ pricing: /* @__PURE__ */ z.intersection(
561
+ /* @__PURE__ */ z.object({
562
+ prices: /* @__PURE__ */ z.array(
563
+ /* @__PURE__ */ z.object({
564
+ duration: /* @__PURE__ */ z.object({
565
+ cycleFrom: /* @__PURE__ */ z.number().int().describe(
566
+ "Price starts to apply with this cycle.\n\n`1` is the first payment cycle for all pricing models."
567
+ ).optional(),
568
+ numberOfCycles: /* @__PURE__ */ z.number().int().describe(
569
+ "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`."
570
+ ).optional().nullable()
571
+ }).describe(
572
+ "Cycle duration to apply `price` for.\n\nUse with all pricing models.\nCan apply the same price to multiple payment cycles."
573
+ ).optional(),
574
+ price: /* @__PURE__ */ z.object({
575
+ subtotal: /* @__PURE__ */ z.string().describe(
576
+ 'Price of the order excluding tax, specified as a monetary amount. For example, `"9.99"`.'
577
+ ).optional(),
578
+ coupon: /* @__PURE__ */ z.object({
579
+ code: /* @__PURE__ */ z.string().describe("Code of the applied coupon.").min(1).max(20).optional(),
580
+ amount: /* @__PURE__ */ z.string().describe(
581
+ "Total discount of the coupon, as a monetary amount."
585
582
  ).optional(),
586
- numberOfCycles: /* @__PURE__ */ z.number().int().describe(
587
- "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`."
588
- ).optional().nullable()
583
+ _id: /* @__PURE__ */ z.string().describe("Coupon ID.").regex(
584
+ /^[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}$/,
585
+ "Must be a valid GUID"
586
+ ).optional()
589
587
  }).describe(
590
- "Cycle duration to apply `price` for.\n\nUse with all pricing models.\nCan apply the same price to multiple payment cycles."
588
+ "Coupon applied to the order, from the Coupons API."
591
589
  ).optional(),
592
- price: /* @__PURE__ */ z.object({
593
- subtotal: /* @__PURE__ */ z.string().describe(
594
- 'Price of the order excluding tax, specified as a monetary amount. For example, `"9.99"`.'
595
- ).optional(),
596
- coupon: /* @__PURE__ */ z.object({
597
- code: /* @__PURE__ */ z.string().describe("Code of the applied coupon.").min(1).max(20).optional(),
598
- amount: /* @__PURE__ */ z.string().describe(
599
- "Total discount of the coupon, as a monetary amount."
600
- ).optional(),
601
- _id: /* @__PURE__ */ z.string().describe("Coupon ID.").regex(
602
- /^[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}$/,
603
- "Must be a valid GUID"
604
- ).optional()
605
- }).describe(
606
- "Coupon applied to the order, from the Coupons API."
607
- ).optional(),
608
- discount: /* @__PURE__ */ z.string().describe("Total discount applied to the order.").optional(),
609
- tax: /* @__PURE__ */ z.object({
610
- name: /* @__PURE__ */ z.string().describe("Name of the tax. For example, VAT.").optional(),
611
- includedInPrice: /* @__PURE__ */ z.boolean().describe(
612
- "Whether tax is included in the original price. When `false`, tax is added at checkout."
613
- ).optional(),
614
- rate: /* @__PURE__ */ z.string().describe(
615
- 'Tax rate percentage, as a number between 0 and 100. For example, a 7% tax rate is `"7.00"`.'
616
- ).optional(),
617
- amount: /* @__PURE__ */ z.string().describe(
618
- 'Total tax, specified as a monetary amount. For example, `"3.99"`.'
619
- ).optional()
620
- }).describe(
621
- "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)."
622
- ).optional(),
623
- total: /* @__PURE__ */ z.string().describe(
624
- '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`.'
590
+ discount: /* @__PURE__ */ z.string().describe("Total discount applied to the order.").optional(),
591
+ tax: /* @__PURE__ */ z.object({
592
+ name: /* @__PURE__ */ z.string().describe("Name of the tax. For example, VAT.").optional(),
593
+ includedInPrice: /* @__PURE__ */ z.boolean().describe(
594
+ "Whether tax is included in the original price. When `false`, tax is added at checkout."
625
595
  ).optional(),
626
- currency: /* @__PURE__ */ z.string().describe(
627
- "Three-letter currency code in\n[ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format."
596
+ rate: /* @__PURE__ */ z.string().describe(
597
+ 'Tax rate percentage, as a number between 0 and 100. For example, a 7% tax rate is `"7.00"`.'
628
598
  ).optional(),
629
- proration: /* @__PURE__ */ z.string().describe(
630
- "Price change after billing date was change and price was adjusted. Could be positive and negative values."
599
+ amount: /* @__PURE__ */ z.string().describe(
600
+ 'Total tax, specified as a monetary amount. For example, `"3.99"`.'
631
601
  ).optional()
632
- }).describe("Order price.").optional()
633
- })
634
- ).optional()
635
- }),
636
- /* @__PURE__ */ z.xor([
637
- /* @__PURE__ */ z.object({
638
- subscription: /* @__PURE__ */ z.never().optional(),
639
- singlePaymentForDuration: /* @__PURE__ */ z.never().optional(),
640
- singlePaymentUnlimited: /* @__PURE__ */ z.never().optional()
641
- }),
642
- /* @__PURE__ */ z.object({
643
- singlePaymentForDuration: /* @__PURE__ */ z.never().optional(),
644
- singlePaymentUnlimited: /* @__PURE__ */ z.never().optional(),
645
- subscription: /* @__PURE__ */ z.object({
646
- cycleDuration: /* @__PURE__ */ z.object({
647
- count: /* @__PURE__ */ z.number().int().describe(
648
- "Number of days, months, weeks, or years in a single payment cycle. Currently limited to support only `1`."
649
- ).min(1).optional().nullable(),
650
- unit: /* @__PURE__ */ z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).describe("Unit of time for the cycle duration.").optional()
651
602
  }).describe(
652
- "Number of payment cycles the subscription is valid for.\n`0` for unlimited plans or for plans that are valid until canceled."
603
+ "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)."
653
604
  ).optional(),
654
- cycleCount: /* @__PURE__ */ z.number().int().describe(
655
- "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."
656
- ).min(0).max(2e3).optional().nullable()
657
- }).describe(
658
- "Pricing model for an order with recurring payment cycles."
659
- )
660
- }),
661
- /* @__PURE__ */ z.object({
662
- subscription: /* @__PURE__ */ z.never().optional(),
663
- singlePaymentUnlimited: /* @__PURE__ */ z.never().optional(),
664
- singlePaymentForDuration: /* @__PURE__ */ z.object({
605
+ total: /* @__PURE__ */ z.string().describe(
606
+ '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`.'
607
+ ).optional(),
608
+ currency: /* @__PURE__ */ z.string().describe(
609
+ "Three-letter currency code in\n[ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format."
610
+ ).optional(),
611
+ proration: /* @__PURE__ */ z.string().describe(
612
+ "Price change after billing date was change and price was adjusted. Could be positive and negative values."
613
+ ).optional()
614
+ }).describe("Order price.").optional()
615
+ })
616
+ ).optional()
617
+ }),
618
+ /* @__PURE__ */ z.xor([
619
+ /* @__PURE__ */ z.object({
620
+ subscription: /* @__PURE__ */ z.never().optional(),
621
+ singlePaymentForDuration: /* @__PURE__ */ z.never().optional(),
622
+ singlePaymentUnlimited: /* @__PURE__ */ z.never().optional()
623
+ }),
624
+ /* @__PURE__ */ z.object({
625
+ singlePaymentForDuration: /* @__PURE__ */ z.never().optional(),
626
+ singlePaymentUnlimited: /* @__PURE__ */ z.never().optional(),
627
+ subscription: /* @__PURE__ */ z.object({
628
+ cycleDuration: /* @__PURE__ */ z.object({
665
629
  count: /* @__PURE__ */ z.number().int().describe(
666
630
  "Number of days, months, weeks, or years in a single payment cycle. Currently limited to support only `1`."
667
631
  ).min(1).optional().nullable(),
668
632
  unit: /* @__PURE__ */ z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).describe("Unit of time for the cycle duration.").optional()
669
633
  }).describe(
670
- "Pricing model for an order with a one-time payment and the order is valid for a specific amount of time."
671
- )
672
- }),
673
- /* @__PURE__ */ z.object({
674
- subscription: /* @__PURE__ */ z.never().optional(),
675
- singlePaymentForDuration: /* @__PURE__ */ z.never().optional(),
676
- singlePaymentUnlimited: /* @__PURE__ */ z.boolean().describe(
677
- "Pricing model for an order with a one-time payment and the order is valid until canceled."
678
- )
679
- })
680
- ])
681
- ).describe(
682
- "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)."
683
- ).optional(),
684
- type: /* @__PURE__ */ z.enum(["UNDEFINED", "ONLINE", "OFFLINE", "EXTERNAL"]).describe("How the order was processed.").optional(),
685
- status: /* @__PURE__ */ z.enum([
686
- "UNDEFINED",
687
- "DRAFT",
688
- "PENDING",
689
- "ACTIVE",
690
- "PAUSED",
691
- "ENDED",
692
- "CANCELED"
693
- ]).describe("Status of the order.").optional(),
694
- autoRenewCanceled: /* @__PURE__ */ z.boolean().describe(
695
- "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."
696
- ).optional().nullable(),
697
- cancellation: /* @__PURE__ */ z.object({
698
- requestedDate: /* @__PURE__ */ z.date().describe("Date and time the cancellation was requested.").optional().nullable(),
699
- cause: /* @__PURE__ */ z.enum([
700
- "UNDEFINED",
701
- "OWNER_ACTION",
702
- "MEMBER_ACTION",
703
- "PAYMENT_FAILURE",
704
- "PAYMENT_SETUP_FAILURE",
705
- "UNKNOWN"
706
- ]).describe("Reason for the cancellation.").optional(),
707
- effectiveAt: /* @__PURE__ */ z.enum(["UNDEFINED", "IMMEDIATELY", "NEXT_PAYMENT_DATE"]).describe(
708
- "When the cancellation takes effect. Set when cancelling the order."
709
- ).optional()
710
- }).describe(
711
- "Details about the cancellation of an order.\n\nOnly present if the status is `CANCELED`."
712
- ).optional(),
713
- lastPaymentStatus: /* @__PURE__ */ z.enum([
714
- "UNDEFINED",
715
- "PAID",
716
- "REFUNDED",
717
- "FAILED",
718
- "UNPAID",
719
- "PENDING",
720
- "NOT_APPLICABLE"
721
- ]).describe(
722
- "Status of the last payment for the order.\nUpdated automatically for online orders. Updated manually by the Wix user for offline orders."
723
- ).optional(),
724
- startDate: /* @__PURE__ */ z.date().describe("Start date and time for the ordered plan.").optional().nullable(),
725
- endDate: /* @__PURE__ */ z.date().describe(
726
- "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`."
727
- ).optional().nullable(),
728
- pausePeriods: /* @__PURE__ */ z.array(
634
+ "Number of payment cycles the subscription is valid for.\n`0` for unlimited plans or for plans that are valid until canceled."
635
+ ).optional(),
636
+ cycleCount: /* @__PURE__ */ z.number().int().describe(
637
+ "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."
638
+ ).min(0).max(2e3).optional().nullable()
639
+ }).describe(
640
+ "Pricing model for an order with recurring payment cycles."
641
+ )
642
+ }),
729
643
  /* @__PURE__ */ z.object({
730
- status: /* @__PURE__ */ z.enum(["UNDEFINED", "ACTIVE", "ENDED"]).describe("Status of the pause period.").optional(),
731
- pauseDate: /* @__PURE__ */ z.date().describe("Start date and time of the pause period.").optional().nullable(),
732
- resumeDate: /* @__PURE__ */ z.date().describe(
733
- "End date and time of the pause period.\n\nOmitted while the pause period remains `ACTIVE`."
734
- ).optional().nullable()
644
+ subscription: /* @__PURE__ */ z.never().optional(),
645
+ singlePaymentUnlimited: /* @__PURE__ */ z.never().optional(),
646
+ singlePaymentForDuration: /* @__PURE__ */ z.object({
647
+ count: /* @__PURE__ */ z.number().int().describe(
648
+ "Number of days, months, weeks, or years in a single payment cycle. Currently limited to support only `1`."
649
+ ).min(1).optional().nullable(),
650
+ unit: /* @__PURE__ */ z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).describe("Unit of time for the cycle duration.").optional()
651
+ }).describe(
652
+ "Pricing model for an order with a one-time payment and the order is valid for a specific amount of time."
653
+ )
654
+ }),
655
+ /* @__PURE__ */ z.object({
656
+ subscription: /* @__PURE__ */ z.never().optional(),
657
+ singlePaymentForDuration: /* @__PURE__ */ z.never().optional(),
658
+ singlePaymentUnlimited: /* @__PURE__ */ z.boolean().describe(
659
+ "Pricing model for an order with a one-time payment and the order is valid until canceled."
660
+ )
735
661
  })
736
- ).optional(),
737
- freeTrialDays: /* @__PURE__ */ z.number().int().describe(
738
- "Free trial period for the order, in days.\n\nOnly available for recurring plans."
739
- ).min(1).max(999).optional().nullable(),
740
- earliestEndDate: /* @__PURE__ */ z.date().describe(
741
- "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."
742
- ).optional().nullable(),
743
- currentCycle: /* @__PURE__ */ z.object({
744
- index: /* @__PURE__ */ z.number().int().describe(
745
- "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`."
746
- ).min(0).optional(),
747
- startedDate: /* @__PURE__ */ z.date().describe("Start date and time for the current payment cycle.").optional().nullable(),
748
- endedDate: /* @__PURE__ */ z.date().describe("End date and time for the current payment cycle.").optional().nullable()
749
- }).describe(
750
- "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."
751
- ).optional(),
752
- planName: /* @__PURE__ */ z.string().describe("Plan name at the time of purchase.").optional(),
753
- planDescription: /* @__PURE__ */ z.string().describe("Plan description at the time of purchase").optional(),
754
- planPrice: /* @__PURE__ */ z.string().describe("Plan price as it was at the moment of order creation.").optional(),
755
- _createdDate: /* @__PURE__ */ z.date().describe("Date and time the order was created.").optional().nullable(),
756
- _updatedDate: /* @__PURE__ */ z.date().describe("Date and time the order was updated.").optional().nullable(),
757
- formData: /* @__PURE__ */ z.object({
758
- formId: /* @__PURE__ */ z.string().describe(
759
- "ID of the [order form](https://dev.wix.com/docs/rest/api-reference/wix-forms/form-submissions/introduction) associated with the plan at checkout."
760
- ).regex(
761
- /^[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}$/,
762
- "Must be a valid GUID"
763
- ).optional().nullable(),
764
- submissionId: /* @__PURE__ */ z.string().describe(
765
- "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."
766
- ).regex(
767
- /^[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}$/,
768
- "Must be a valid GUID"
769
- ).optional().nullable(),
770
- submissionData: /* @__PURE__ */ z.record(/* @__PURE__ */ z.string(), /* @__PURE__ */ z.any()).describe("Data submitted to the plan's order form at checkout.").optional()
771
- }).describe(
772
- "Information about the form submitted during the plan's checkout."
662
+ ])
663
+ ).describe(
664
+ "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)."
665
+ ).optional(),
666
+ type: /* @__PURE__ */ z.enum(["UNDEFINED", "ONLINE", "OFFLINE", "EXTERNAL"]).describe("How the order was processed.").optional(),
667
+ status: /* @__PURE__ */ z.enum([
668
+ "UNDEFINED",
669
+ "DRAFT",
670
+ "PENDING",
671
+ "ACTIVE",
672
+ "PAUSED",
673
+ "ENDED",
674
+ "CANCELED"
675
+ ]).describe("Status of the order.").optional(),
676
+ autoRenewCanceled: /* @__PURE__ */ z.boolean().describe(
677
+ "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."
678
+ ).optional().nullable(),
679
+ cancellation: /* @__PURE__ */ z.object({
680
+ requestedDate: /* @__PURE__ */ z.date().describe("Date and time the cancellation was requested.").optional().nullable(),
681
+ cause: /* @__PURE__ */ z.enum([
682
+ "UNDEFINED",
683
+ "OWNER_ACTION",
684
+ "MEMBER_ACTION",
685
+ "PAYMENT_FAILURE",
686
+ "PAYMENT_SETUP_FAILURE",
687
+ "UNKNOWN"
688
+ ]).describe("Reason for the cancellation.").optional(),
689
+ effectiveAt: /* @__PURE__ */ z.enum(["UNDEFINED", "IMMEDIATELY", "NEXT_PAYMENT_DATE"]).describe(
690
+ "When the cancellation takes effect. Set when cancelling the order."
773
691
  ).optional()
774
- })
775
- ).optional(),
776
- pagingMetadata: /* @__PURE__ */ z.object({
777
- count: /* @__PURE__ */ z.number().int().describe("Number of items returned in the response.").optional().nullable(),
778
- offset: /* @__PURE__ */ z.number().int().describe("Offset that was requested.").optional().nullable(),
779
- total: /* @__PURE__ */ z.number().int().describe(
780
- "Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set."
692
+ }).describe(
693
+ "Details about the cancellation of an order.\n\nOnly present if the status is `CANCELED`."
694
+ ).optional(),
695
+ lastPaymentStatus: /* @__PURE__ */ z.enum([
696
+ "UNDEFINED",
697
+ "PAID",
698
+ "REFUNDED",
699
+ "FAILED",
700
+ "UNPAID",
701
+ "PENDING",
702
+ "NOT_APPLICABLE"
703
+ ]).describe(
704
+ "Status of the last payment for the order.\nUpdated automatically for online orders. Updated manually by the Wix user for offline orders."
705
+ ).optional(),
706
+ startDate: /* @__PURE__ */ z.date().describe("Start date and time for the ordered plan.").optional().nullable(),
707
+ endDate: /* @__PURE__ */ z.date().describe(
708
+ "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`."
781
709
  ).optional().nullable(),
782
- tooManyToCount: /* @__PURE__ */ z.boolean().describe(
783
- "Flag that indicates the server failed to calculate the `total` field."
710
+ pausePeriods: /* @__PURE__ */ z.array(
711
+ /* @__PURE__ */ z.object({
712
+ status: /* @__PURE__ */ z.enum(["UNDEFINED", "ACTIVE", "ENDED"]).describe("Status of the pause period.").optional(),
713
+ pauseDate: /* @__PURE__ */ z.date().describe("Start date and time of the pause period.").optional().nullable(),
714
+ resumeDate: /* @__PURE__ */ z.date().describe(
715
+ "End date and time of the pause period.\n\nOmitted while the pause period remains `ACTIVE`."
716
+ ).optional().nullable()
717
+ })
718
+ ).optional(),
719
+ freeTrialDays: /* @__PURE__ */ z.number().int().describe(
720
+ "Free trial period for the order, in days.\n\nOnly available for recurring plans."
721
+ ).min(1).max(999).optional().nullable(),
722
+ earliestEndDate: /* @__PURE__ */ z.date().describe(
723
+ "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."
784
724
  ).optional().nullable(),
785
- cursors: /* @__PURE__ */ z.object({
786
- next: /* @__PURE__ */ z.string().describe(
787
- "Cursor string pointing to the next page in the list of results."
788
- ).max(16e3).optional().nullable(),
789
- prev: /* @__PURE__ */ z.string().describe(
790
- "Cursor pointing to the previous page in the list of results."
791
- ).max(16e3).optional().nullable()
725
+ currentCycle: /* @__PURE__ */ z.object({
726
+ index: /* @__PURE__ */ z.number().int().describe(
727
+ "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`."
728
+ ).min(0).optional(),
729
+ startedDate: /* @__PURE__ */ z.date().describe("Start date and time for the current payment cycle.").optional().nullable(),
730
+ endedDate: /* @__PURE__ */ z.date().describe("End date and time for the current payment cycle.").optional().nullable()
792
731
  }).describe(
793
- "Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used."
732
+ "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."
733
+ ).optional(),
734
+ planName: /* @__PURE__ */ z.string().describe("Plan name at the time of purchase.").optional(),
735
+ planDescription: /* @__PURE__ */ z.string().describe("Plan description at the time of purchase").optional(),
736
+ planPrice: /* @__PURE__ */ z.string().describe("Plan price as it was at the moment of order creation.").optional(),
737
+ _createdDate: /* @__PURE__ */ z.date().describe("Date and time the order was created.").optional().nullable(),
738
+ _updatedDate: /* @__PURE__ */ z.date().describe("Date and time the order was updated.").optional().nullable(),
739
+ formData: /* @__PURE__ */ z.object({
740
+ formId: /* @__PURE__ */ z.string().describe(
741
+ "ID of the [order form](https://dev.wix.com/docs/rest/api-reference/wix-forms/form-submissions/introduction) associated with the plan at checkout."
742
+ ).regex(
743
+ /^[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}$/,
744
+ "Must be a valid GUID"
745
+ ).optional().nullable(),
746
+ submissionId: /* @__PURE__ */ z.string().describe(
747
+ "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."
748
+ ).regex(
749
+ /^[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}$/,
750
+ "Must be a valid GUID"
751
+ ).optional().nullable(),
752
+ submissionData: /* @__PURE__ */ z.record(/* @__PURE__ */ z.string(), /* @__PURE__ */ z.any()).describe("Data submitted to the plan's order form at checkout.").optional()
753
+ }).describe(
754
+ "Information about the form submitted during the plan's checkout."
794
755
  ).optional()
795
- }).describe(
796
- "Object containing paging-related data (number of orders returned, offset)."
797
- ).optional()
798
- });
799
- var PostponeEndDateRequest = /* @__PURE__ */ z.object({
800
- _id: /* @__PURE__ */ z.string().describe("Order ID.").regex(
801
- /^[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}$/,
802
- "Must be a valid GUID"
803
- ),
804
- endDate: /* @__PURE__ */ z.date().describe(
805
- "New end date and time.\n\nMust be later than the current end date and time."
806
- )
807
- });
808
- var PostponeEndDateResponse = /* @__PURE__ */ z.object({});
809
- var CancelOrderRequest = /* @__PURE__ */ z.object({
810
- _id: /* @__PURE__ */ z.string().describe("Order ID.").regex(
811
- /^[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}$/,
812
- "Must be a valid GUID"
813
- ),
814
- effectiveAt: /* @__PURE__ */ z.enum([
815
- "UNDEFINED",
816
- "IMMEDIATELY",
817
- "NEXT_PAYMENT_DATE"
818
- ])
819
- });
820
- var CancelOrderResponse = /* @__PURE__ */ z.object({});
821
- var MarkAsPaidRequest = /* @__PURE__ */ z.object({
822
- _id: /* @__PURE__ */ z.string().describe("Order ID.").regex(
823
- /^[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}$/,
824
- "Must be a valid GUID"
825
- )
826
- });
827
- var MarkAsPaidResponse = /* @__PURE__ */ z.object({});
828
- var PauseOrderRequest = /* @__PURE__ */ z.object({
829
- _id: /* @__PURE__ */ z.string().describe("Order ID.").regex(
830
- /^[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}$/,
831
- "Must be a valid GUID"
832
- )
833
- });
834
- var PauseOrderResponse = /* @__PURE__ */ z.object({});
835
- var ResumeOrderRequest = /* @__PURE__ */ z.object({
836
- _id: /* @__PURE__ */ z.string().describe("Order ID.").regex(
837
- /^[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}$/,
838
- "Must be a valid GUID"
839
- )
756
+ }).describe("Order.").optional()
840
757
  });
841
- var ResumeOrderResponse = /* @__PURE__ */ z.object({});
842
- var CreateOnlineOrderRequest = /* @__PURE__ */ z.object({
758
+ var GetOnlineOrderPreviewRequest = /* @__PURE__ */ z.object({
843
759
  planId: /* @__PURE__ */ z.string().describe("Plan ID.").regex(
844
760
  /^[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}$/,
845
761
  "Must be a valid GUID"
846
762
  ),
847
763
  options: /* @__PURE__ */ z.object({
848
764
  startDate: /* @__PURE__ */ z.date().describe(
849
- "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."
765
+ "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."
850
766
  ).optional().nullable(),
851
- couponCode: /* @__PURE__ */ z.string().describe("Coupon code to apply.").min(1).max(20).optional().nullable(),
852
- onBehalf: /* @__PURE__ */ z.object({
853
- memberId: /* @__PURE__ */ z.string().describe("Member ID.").regex(
854
- /^[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}$/,
855
- "Must be a valid GUID"
856
- ),
857
- orderMethod: /* @__PURE__ */ z.enum(["UNKNOWN", "MOTO", "POS"]).optional()
858
- }).describe("Provided if checkout is initiated on buyer's behalf.").optional(),
859
- submissionId: /* @__PURE__ */ z.string().describe("Submission ID of the form submitted with this order.").regex(
860
- /^[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}$/,
861
- "Must be a valid GUID"
862
- ).optional().nullable()
767
+ couponCode: /* @__PURE__ */ z.string().describe("Coupon code to apply.").min(1).max(20).optional().nullable()
863
768
  }).optional()
864
769
  });
865
- var CreateOnlineOrderResponse = /* @__PURE__ */ z.object({
770
+ var GetOnlineOrderPreviewResponse = /* @__PURE__ */ z.object({
866
771
  order: /* @__PURE__ */ z.object({
867
772
  _id: /* @__PURE__ */ z.string().describe("Order ID.").regex(
868
773
  /^[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}$/,
@@ -1183,30 +1088,32 @@ var CreateOnlineOrderResponse = /* @__PURE__ */ z.object({
1183
1088
  }).describe(
1184
1089
  "Information about the form submitted during the plan's checkout."
1185
1090
  ).optional()
1186
- }).describe("Created online order.").optional()
1091
+ }).describe(
1092
+ "Order preview. This field is undefined if the member has already reached the purchase limit for the order's plan."
1093
+ ).optional(),
1094
+ purchaseLimitExceeded: /* @__PURE__ */ z.boolean().describe(
1095
+ "Whether the member has already reached purchase limit for the order's plan."
1096
+ ).optional()
1187
1097
  });
1188
- var CreateOfflineOrderRequest = /* @__PURE__ */ z.object({
1189
- planId: /* @__PURE__ */ z.string().describe("ID of the plan being ordered, from the Plans API.").regex(
1098
+ var GetOfflineOrderPreviewRequest = /* @__PURE__ */ z.object({
1099
+ planId: /* @__PURE__ */ z.string().describe("ID of the plan of the previewed order.").regex(
1190
1100
  /^[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}$/,
1191
1101
  "Must be a valid GUID"
1192
1102
  ),
1193
- memberId: /* @__PURE__ */ z.string().describe("ID of the member ordering the plan, from the Members API.").regex(
1103
+ memberId: /* @__PURE__ */ z.string().describe(
1104
+ "Member ID of the buyer the previewed order is for, from the Members API."
1105
+ ).regex(
1194
1106
  /^[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}$/,
1195
1107
  "Must be a valid GUID"
1196
1108
  ),
1197
1109
  options: /* @__PURE__ */ z.object({
1198
1110
  startDate: /* @__PURE__ */ z.date().describe(
1199
- "Start date and time for the ordered plan in a `YYYY-MM-DDThh:mm[:ss][.sss]Z` format.\n\nDefault: Current date and time."
1111
+ "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."
1200
1112
  ).optional().nullable(),
1201
- paid: /* @__PURE__ */ z.boolean().describe("Whether the order is paid.\n\nDefault: `false`").optional().nullable(),
1202
- couponCode: /* @__PURE__ */ z.string().describe("Coupon code to apply, from the Coupons API.").min(1).max(20).optional().nullable(),
1203
- submissionId: /* @__PURE__ */ z.string().describe("Form submission ID that was submitted with the order.").regex(
1204
- /^[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}$/,
1205
- "Must be a valid GUID"
1206
- ).optional().nullable()
1207
- }).describe("Options for creating an offline order. ").optional()
1208
- });
1209
- var CreateOfflineOrderResponse = /* @__PURE__ */ z.object({
1113
+ couponCode: /* @__PURE__ */ z.string().describe("Coupon code to apply, from the Coupons API.").min(1).max(20).optional().nullable()
1114
+ }).describe("Options for previewing the offline order. ").optional()
1115
+ });
1116
+ var GetOfflineOrderPreviewResponse = /* @__PURE__ */ z.object({
1210
1117
  order: /* @__PURE__ */ z.object({
1211
1118
  _id: /* @__PURE__ */ z.string().describe("Order ID.").regex(
1212
1119
  /^[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,21 +1434,168 @@ var CreateOfflineOrderResponse = /* @__PURE__ */ z.object({
1527
1434
  }).describe(
1528
1435
  "Information about the form submitted during the plan's checkout."
1529
1436
  ).optional()
1530
- }).describe("Order.").optional()
1437
+ }).describe("The previewed order, as if the plan had been ordered.").optional(),
1438
+ purchaseLimitExceeded: /* @__PURE__ */ z.boolean().describe(
1439
+ "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."
1440
+ ).optional()
1531
1441
  });
1532
- var GetOnlineOrderPreviewRequest = /* @__PURE__ */ z.object({
1533
- planId: /* @__PURE__ */ z.string().describe("Plan ID.").regex(
1442
+ var GetPricePreviewRequest = /* @__PURE__ */ z.object({
1443
+ planId: /* @__PURE__ */ z.string().describe("ID of plan to preview.").regex(
1534
1444
  /^[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}$/,
1535
1445
  "Must be a valid GUID"
1536
1446
  ),
1537
1447
  options: /* @__PURE__ */ z.object({
1538
- startDate: /* @__PURE__ */ z.date().describe(
1539
- "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."
1540
- ).optional().nullable(),
1541
- couponCode: /* @__PURE__ */ z.string().describe("Coupon code to apply.").min(1).max(20).optional().nullable()
1542
- }).optional()
1448
+ couponCode: /* @__PURE__ */ z.string().describe("Coupon code to apply, from the Coupons API.").min(1).max(20).optional().nullable()
1449
+ }).describe("Options for getting a price preview. ").optional()
1543
1450
  });
1544
- var GetOnlineOrderPreviewResponse = /* @__PURE__ */ z.object({
1451
+ var GetPricePreviewResponse = /* @__PURE__ */ z.object({
1452
+ price: /* @__PURE__ */ z.intersection(
1453
+ /* @__PURE__ */ z.object({
1454
+ subtotal: /* @__PURE__ */ z.string().describe(
1455
+ 'Price of the order excluding tax, specified as a monetary amount. for example, `"9.99"`.'
1456
+ ).optional(),
1457
+ discount: /* @__PURE__ */ z.string().describe("Total discount applied.").optional(),
1458
+ tax: /* @__PURE__ */ z.object({
1459
+ name: /* @__PURE__ */ z.string().describe("Name of the tax. For example, VAT.").optional(),
1460
+ includedInPrice: /* @__PURE__ */ z.boolean().describe(
1461
+ "Whether tax is included in the original price. When `false`, tax is added at checkout."
1462
+ ).optional(),
1463
+ rate: /* @__PURE__ */ z.string().describe(
1464
+ 'Tax rate percentage, as a number between 0 and 100. For example, a 7% tax rate is `"7.00"`.'
1465
+ ).optional(),
1466
+ amount: /* @__PURE__ */ z.string().describe(
1467
+ 'Total tax, specified as a monetary amount. For example, `"3.99"`.'
1468
+ ).optional()
1469
+ }).describe("Tax applied.").optional(),
1470
+ total: /* @__PURE__ */ z.string().describe(
1471
+ '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`.'
1472
+ ).optional(),
1473
+ planPrice: /* @__PURE__ */ z.string().describe("Plan price as it was at the moment of order creation.").optional(),
1474
+ currency: /* @__PURE__ */ z.string().describe(
1475
+ "Currency code. Must be valid ISO 4217 currency code (e.g., USD)."
1476
+ ).optional(),
1477
+ freeTrialDays: /* @__PURE__ */ z.number().int().describe(
1478
+ "Free trial period for the order in days. Only available for recurring plans."
1479
+ ).min(1).max(999).optional().nullable(),
1480
+ coupon: /* @__PURE__ */ z.object({
1481
+ code: /* @__PURE__ */ z.string().describe("Code of the applied coupon.").min(1).max(20).optional(),
1482
+ amount: /* @__PURE__ */ z.string().describe("Total discount of the coupon, as a monetary amount.").optional(),
1483
+ _id: /* @__PURE__ */ z.string().describe("Coupon ID.").regex(
1484
+ /^[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}$/,
1485
+ "Must be a valid GUID"
1486
+ ).optional()
1487
+ }).describe(
1488
+ "Coupon applied to the order. Empty means no coupon was applied."
1489
+ ).optional()
1490
+ }),
1491
+ /* @__PURE__ */ z.xor([
1492
+ /* @__PURE__ */ z.object({
1493
+ subscription: /* @__PURE__ */ z.never().optional(),
1494
+ singlePaymentForDuration: /* @__PURE__ */ z.never().optional(),
1495
+ singlePaymentUnlimited: /* @__PURE__ */ z.never().optional()
1496
+ }),
1497
+ /* @__PURE__ */ z.object({
1498
+ singlePaymentForDuration: /* @__PURE__ */ z.never().optional(),
1499
+ singlePaymentUnlimited: /* @__PURE__ */ z.never().optional(),
1500
+ subscription: /* @__PURE__ */ z.object({
1501
+ cycleDuration: /* @__PURE__ */ z.object({
1502
+ count: /* @__PURE__ */ z.number().int().describe(
1503
+ "Number of days, months, weeks, or years in a single payment cycle. Currently limited to support only `1`."
1504
+ ).min(1).optional().nullable(),
1505
+ unit: /* @__PURE__ */ z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).describe("Unit of time for the cycle duration.").optional()
1506
+ }).describe(
1507
+ "Number of payment cycles the subscription is valid for.\n`0` for unlimited plans or for plans that are valid until canceled."
1508
+ ).optional(),
1509
+ cycleCount: /* @__PURE__ */ z.number().int().describe(
1510
+ "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."
1511
+ ).min(0).max(2e3).optional().nullable()
1512
+ }).describe("Order has recurring payments.")
1513
+ }),
1514
+ /* @__PURE__ */ z.object({
1515
+ subscription: /* @__PURE__ */ z.never().optional(),
1516
+ singlePaymentUnlimited: /* @__PURE__ */ z.never().optional(),
1517
+ singlePaymentForDuration: /* @__PURE__ */ z.object({
1518
+ count: /* @__PURE__ */ z.number().int().describe(
1519
+ "Number of days, months, weeks, or years in a single payment cycle. Currently limited to support only `1`."
1520
+ ).min(1).optional().nullable(),
1521
+ unit: /* @__PURE__ */ z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).describe("Unit of time for the cycle duration.").optional()
1522
+ }).describe(
1523
+ "One-time payment. Order is valid for a specified duration."
1524
+ )
1525
+ }),
1526
+ /* @__PURE__ */ z.object({
1527
+ subscription: /* @__PURE__ */ z.never().optional(),
1528
+ singlePaymentForDuration: /* @__PURE__ */ z.never().optional(),
1529
+ singlePaymentUnlimited: /* @__PURE__ */ z.boolean().describe("One-time payment. Order is valid until it is canceled.")
1530
+ })
1531
+ ])
1532
+ ).describe(
1533
+ "__Deprecated.__ Use `prices` instead. This property will be removed on September 30, 2022."
1534
+ ).optional(),
1535
+ prices: /* @__PURE__ */ z.array(
1536
+ /* @__PURE__ */ z.object({
1537
+ duration: /* @__PURE__ */ z.object({
1538
+ cycleFrom: /* @__PURE__ */ z.number().int().describe(
1539
+ "Price starts to apply with this cycle.\n\n`1` is the first payment cycle for all pricing models."
1540
+ ).optional(),
1541
+ numberOfCycles: /* @__PURE__ */ z.number().int().describe(
1542
+ "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`."
1543
+ ).optional().nullable()
1544
+ }).describe(
1545
+ "Cycle duration to apply `price` for.\n\nUse with all pricing models.\nCan apply the same price to multiple payment cycles."
1546
+ ).optional(),
1547
+ price: /* @__PURE__ */ z.object({
1548
+ subtotal: /* @__PURE__ */ z.string().describe(
1549
+ 'Price of the order excluding tax, specified as a monetary amount. For example, `"9.99"`.'
1550
+ ).optional(),
1551
+ coupon: /* @__PURE__ */ z.object({
1552
+ code: /* @__PURE__ */ z.string().describe("Code of the applied coupon.").min(1).max(20).optional(),
1553
+ amount: /* @__PURE__ */ z.string().describe(
1554
+ "Total discount of the coupon, as a monetary amount."
1555
+ ).optional(),
1556
+ _id: /* @__PURE__ */ z.string().describe("Coupon ID.").regex(
1557
+ /^[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}$/,
1558
+ "Must be a valid GUID"
1559
+ ).optional()
1560
+ }).describe("Coupon applied to the order, from the Coupons API.").optional(),
1561
+ discount: /* @__PURE__ */ z.string().describe("Total discount applied to the order.").optional(),
1562
+ tax: /* @__PURE__ */ z.object({
1563
+ name: /* @__PURE__ */ z.string().describe("Name of the tax. For example, VAT.").optional(),
1564
+ includedInPrice: /* @__PURE__ */ z.boolean().describe(
1565
+ "Whether tax is included in the original price. When `false`, tax is added at checkout."
1566
+ ).optional(),
1567
+ rate: /* @__PURE__ */ z.string().describe(
1568
+ 'Tax rate percentage, as a number between 0 and 100. For example, a 7% tax rate is `"7.00"`.'
1569
+ ).optional(),
1570
+ amount: /* @__PURE__ */ z.string().describe(
1571
+ 'Total tax, specified as a monetary amount. For example, `"3.99"`.'
1572
+ ).optional()
1573
+ }).describe(
1574
+ "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)."
1575
+ ).optional(),
1576
+ total: /* @__PURE__ */ z.string().describe(
1577
+ '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`.'
1578
+ ).optional(),
1579
+ currency: /* @__PURE__ */ z.string().describe(
1580
+ "Three-letter currency code in\n[ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format."
1581
+ ).optional(),
1582
+ proration: /* @__PURE__ */ z.string().describe(
1583
+ "Price change after billing date was change and price was adjusted. Could be positive and negative values."
1584
+ ).optional()
1585
+ }).describe("Order price.").optional()
1586
+ })
1587
+ ).optional()
1588
+ });
1589
+ var ManagementGetOrderRequest = /* @__PURE__ */ z.object({
1590
+ _id: /* @__PURE__ */ z.string().describe("Order ID.").regex(
1591
+ /^[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}$/,
1592
+ "Must be a valid GUID"
1593
+ ),
1594
+ options: /* @__PURE__ */ z.object({
1595
+ fieldSet: /* @__PURE__ */ z.enum(["UNKNOWN_SET", "BASIC", "FULL"]).optional()
1596
+ }).describe("Options to use when getting an order. ").optional()
1597
+ });
1598
+ var ManagementGetOrderResponse = /* @__PURE__ */ z.object({
1545
1599
  order: /* @__PURE__ */ z.object({
1546
1600
  _id: /* @__PURE__ */ z.string().describe("Order ID.").regex(
1547
1601
  /^[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}$/,
@@ -1862,504 +1916,450 @@ var GetOnlineOrderPreviewResponse = /* @__PURE__ */ z.object({
1862
1916
  }).describe(
1863
1917
  "Information about the form submitted during the plan's checkout."
1864
1918
  ).optional()
1865
- }).describe(
1866
- "Order preview. This field is undefined if the member has already reached the purchase limit for the order's plan."
1867
- ).optional(),
1868
- purchaseLimitExceeded: /* @__PURE__ */ z.boolean().describe(
1869
- "Whether the member has already reached purchase limit for the order's plan."
1870
- ).optional()
1919
+ }).describe("Order.").optional()
1871
1920
  });
1872
- var GetOfflineOrderPreviewRequest = /* @__PURE__ */ z.object({
1873
- planId: /* @__PURE__ */ z.string().describe("ID of the plan of the previewed order.").regex(
1874
- /^[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}$/,
1875
- "Must be a valid GUID"
1876
- ),
1877
- memberId: /* @__PURE__ */ z.string().describe(
1878
- "Member ID of the buyer the previewed order is for, from the Members API."
1879
- ).regex(
1880
- /^[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}$/,
1881
- "Must be a valid GUID"
1882
- ),
1921
+ var ManagementListOrdersRequest = /* @__PURE__ */ z.object({
1883
1922
  options: /* @__PURE__ */ z.object({
1884
- startDate: /* @__PURE__ */ z.date().describe(
1885
- "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."
1923
+ buyerIds: /* @__PURE__ */ z.array(/* @__PURE__ */ z.string()).optional(),
1924
+ planIds: /* @__PURE__ */ z.array(/* @__PURE__ */ z.string()).optional(),
1925
+ autoRenewCanceled: /* @__PURE__ */ z.boolean().describe(
1926
+ "Filter by whether or not the auto-renewal of recurring orders was canceled."
1886
1927
  ).optional().nullable(),
1887
- couponCode: /* @__PURE__ */ z.string().describe("Coupon code to apply, from the Coupons API.").min(1).max(20).optional().nullable()
1888
- }).describe("Options for previewing the offline order. ").optional()
1889
- });
1890
- var GetOfflineOrderPreviewResponse = /* @__PURE__ */ z.object({
1891
- order: /* @__PURE__ */ z.object({
1892
- _id: /* @__PURE__ */ z.string().describe("Order ID.").regex(
1893
- /^[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}$/,
1894
- "Must be a valid GUID"
1928
+ orderStatuses: /* @__PURE__ */ z.array(
1929
+ /* @__PURE__ */ z.enum([
1930
+ "UNDEFINED",
1931
+ "DRAFT",
1932
+ "PENDING",
1933
+ "ACTIVE",
1934
+ "PAUSED",
1935
+ "ENDED",
1936
+ "CANCELED"
1937
+ ])
1895
1938
  ).optional(),
1896
- planId: /* @__PURE__ */ z.string().describe(
1897
- "ID of the plan purchased with the order, from the Plans API."
1898
- ).regex(
1899
- /^[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}$/,
1900
- "Must be a valid GUID"
1939
+ paymentStatuses: /* @__PURE__ */ z.array(
1940
+ /* @__PURE__ */ z.enum([
1941
+ "UNDEFINED",
1942
+ "PAID",
1943
+ "REFUNDED",
1944
+ "FAILED",
1945
+ "UNPAID",
1946
+ "PENDING",
1947
+ "NOT_APPLICABLE"
1948
+ ])
1901
1949
  ).optional(),
1902
- subscriptionId: /* @__PURE__ */ z.string().describe(
1903
- "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)."
1904
- ).regex(
1905
- /^[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}$/,
1906
- "Must be a valid GUID"
1950
+ limit: /* @__PURE__ */ z.number().int().describe(
1951
+ "Number of orders to return. See Sorting and Paging for more information.\n\nMax: `50`"
1952
+ ).min(1).max(50).optional().nullable(),
1953
+ offset: /* @__PURE__ */ z.number().int().describe("Number of orders to skip in the current sort order.").min(0).optional().nullable(),
1954
+ sorting: /* @__PURE__ */ z.object({
1955
+ fieldName: /* @__PURE__ */ z.string().describe("Name of the field to sort by.").max(512).optional(),
1956
+ order: /* @__PURE__ */ z.enum(["ASC", "DESC"]).optional(),
1957
+ origin: /* @__PURE__ */ z.object({
1958
+ latitude: /* @__PURE__ */ z.number().describe("Address latitude.").optional().nullable(),
1959
+ longitude: /* @__PURE__ */ z.number().describe("Address longitude.").optional().nullable()
1960
+ }).describe(
1961
+ "Origin point for geo-distance sorting on a GEO field\nresults are ordered by distance from this point (ASC = nearest first, DESC = farthest first)."
1962
+ ).optional()
1963
+ }).describe(
1964
+ "Sort order.\n\nUse `ASC` for ascending order or `DESC` for descending order.\n\nDefault: `DESC`."
1907
1965
  ).optional(),
1908
- wixPayOrderId: /* @__PURE__ */ z.string().describe(
1909
- "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."
1910
- ).regex(
1911
- /^[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}$/,
1912
- "Must be a valid GUID"
1913
- ).optional().nullable(),
1914
- buyer: /* @__PURE__ */ z.object({
1915
- memberId: /* @__PURE__ */ z.string().describe("Member ID for a Wix site member, from the Members API.").regex(
1966
+ fieldSet: /* @__PURE__ */ z.enum(["UNKNOWN_SET", "BASIC", "FULL"]).optional()
1967
+ }).describe("Filtering, sorting, and pagination options. ").optional()
1968
+ });
1969
+ var ManagementListOrdersResponse = /* @__PURE__ */ z.object({
1970
+ orders: /* @__PURE__ */ z.array(
1971
+ /* @__PURE__ */ z.object({
1972
+ _id: /* @__PURE__ */ z.string().describe("Order ID.").regex(
1916
1973
  /^[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}$/,
1917
1974
  "Must be a valid GUID"
1918
1975
  ).optional(),
1919
- contactId: /* @__PURE__ */ z.string().describe(
1920
- "Contact ID for a Wix site contact, from the Contacts API."
1976
+ planId: /* @__PURE__ */ z.string().describe(
1977
+ "ID of the plan purchased with the order, from the Plans API."
1921
1978
  ).regex(
1922
1979
  /^[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}$/,
1923
1980
  "Must be a valid GUID"
1924
- ).optional()
1925
- }).describe(
1926
- "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`."
1927
- ).optional(),
1928
- priceDetails: /* @__PURE__ */ z.intersection(
1929
- /* @__PURE__ */ z.object({
1930
- subtotal: /* @__PURE__ */ z.string().describe(
1931
- 'Price of the order excluding tax, specified as a monetary amount. for example, `"9.99"`.'
1981
+ ).optional(),
1982
+ subscriptionId: /* @__PURE__ */ z.string().describe(
1983
+ "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)."
1984
+ ).regex(
1985
+ /^[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}$/,
1986
+ "Must be a valid GUID"
1987
+ ).optional(),
1988
+ wixPayOrderId: /* @__PURE__ */ z.string().describe(
1989
+ "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."
1990
+ ).regex(
1991
+ /^[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}$/,
1992
+ "Must be a valid GUID"
1993
+ ).optional().nullable(),
1994
+ buyer: /* @__PURE__ */ z.object({
1995
+ memberId: /* @__PURE__ */ z.string().describe(
1996
+ "Member ID for a Wix site member, from the Members API."
1997
+ ).regex(
1998
+ /^[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}$/,
1999
+ "Must be a valid GUID"
1932
2000
  ).optional(),
1933
- discount: /* @__PURE__ */ z.string().describe("Total discount applied.").optional(),
1934
- tax: /* @__PURE__ */ z.object({
1935
- name: /* @__PURE__ */ z.string().describe("Name of the tax. For example, VAT.").optional(),
1936
- includedInPrice: /* @__PURE__ */ z.boolean().describe(
1937
- "Whether tax is included in the original price. When `false`, tax is added at checkout."
2001
+ contactId: /* @__PURE__ */ z.string().describe(
2002
+ "Contact ID for a Wix site contact, from the Contacts API."
2003
+ ).regex(
2004
+ /^[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}$/,
2005
+ "Must be a valid GUID"
2006
+ ).optional()
2007
+ }).describe(
2008
+ "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`."
2009
+ ).optional(),
2010
+ priceDetails: /* @__PURE__ */ z.intersection(
2011
+ /* @__PURE__ */ z.object({
2012
+ subtotal: /* @__PURE__ */ z.string().describe(
2013
+ 'Price of the order excluding tax, specified as a monetary amount. for example, `"9.99"`.'
1938
2014
  ).optional(),
1939
- rate: /* @__PURE__ */ z.string().describe(
1940
- 'Tax rate percentage, as a number between 0 and 100. For example, a 7% tax rate is `"7.00"`.'
2015
+ discount: /* @__PURE__ */ z.string().describe("Total discount applied.").optional(),
2016
+ tax: /* @__PURE__ */ z.object({
2017
+ name: /* @__PURE__ */ z.string().describe("Name of the tax. For example, VAT.").optional(),
2018
+ includedInPrice: /* @__PURE__ */ z.boolean().describe(
2019
+ "Whether tax is included in the original price. When `false`, tax is added at checkout."
2020
+ ).optional(),
2021
+ rate: /* @__PURE__ */ z.string().describe(
2022
+ 'Tax rate percentage, as a number between 0 and 100. For example, a 7% tax rate is `"7.00"`.'
2023
+ ).optional(),
2024
+ amount: /* @__PURE__ */ z.string().describe(
2025
+ 'Total tax, specified as a monetary amount. For example, `"3.99"`.'
2026
+ ).optional()
2027
+ }).describe("Tax applied.").optional(),
2028
+ total: /* @__PURE__ */ z.string().describe(
2029
+ '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`.'
1941
2030
  ).optional(),
1942
- amount: /* @__PURE__ */ z.string().describe(
1943
- 'Total tax, specified as a monetary amount. For example, `"3.99"`.'
1944
- ).optional()
1945
- }).describe("Tax applied.").optional(),
1946
- total: /* @__PURE__ */ z.string().describe(
1947
- '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`.'
1948
- ).optional(),
1949
- planPrice: /* @__PURE__ */ z.string().describe("Plan price as it was at the moment of order creation.").optional(),
1950
- currency: /* @__PURE__ */ z.string().describe(
1951
- "Currency code. Must be valid ISO 4217 currency code (e.g., USD)."
1952
- ).optional(),
1953
- freeTrialDays: /* @__PURE__ */ z.number().int().describe(
1954
- "Free trial period for the order in days. Only available for recurring plans."
1955
- ).min(1).max(999).optional().nullable(),
1956
- coupon: /* @__PURE__ */ z.object({
1957
- code: /* @__PURE__ */ z.string().describe("Code of the applied coupon.").min(1).max(20).optional(),
1958
- amount: /* @__PURE__ */ z.string().describe(
1959
- "Total discount of the coupon, as a monetary amount."
2031
+ planPrice: /* @__PURE__ */ z.string().describe(
2032
+ "Plan price as it was at the moment of order creation."
1960
2033
  ).optional(),
1961
- _id: /* @__PURE__ */ z.string().describe("Coupon ID.").regex(
1962
- /^[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}$/,
1963
- "Must be a valid GUID"
2034
+ currency: /* @__PURE__ */ z.string().describe(
2035
+ "Currency code. Must be valid ISO 4217 currency code (e.g., USD)."
2036
+ ).optional(),
2037
+ freeTrialDays: /* @__PURE__ */ z.number().int().describe(
2038
+ "Free trial period for the order in days. Only available for recurring plans."
2039
+ ).min(1).max(999).optional().nullable(),
2040
+ coupon: /* @__PURE__ */ z.object({
2041
+ code: /* @__PURE__ */ z.string().describe("Code of the applied coupon.").min(1).max(20).optional(),
2042
+ amount: /* @__PURE__ */ z.string().describe(
2043
+ "Total discount of the coupon, as a monetary amount."
2044
+ ).optional(),
2045
+ _id: /* @__PURE__ */ z.string().describe("Coupon ID.").regex(
2046
+ /^[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}$/,
2047
+ "Must be a valid GUID"
2048
+ ).optional()
2049
+ }).describe(
2050
+ "Coupon applied to the order. Empty means no coupon was applied."
1964
2051
  ).optional()
1965
- }).describe(
1966
- "Coupon applied to the order. Empty means no coupon was applied."
1967
- ).optional()
1968
- }),
1969
- /* @__PURE__ */ z.xor([
1970
- /* @__PURE__ */ z.object({
1971
- subscription: /* @__PURE__ */ z.never().optional(),
1972
- singlePaymentForDuration: /* @__PURE__ */ z.never().optional(),
1973
- singlePaymentUnlimited: /* @__PURE__ */ z.never().optional()
1974
2052
  }),
1975
- /* @__PURE__ */ z.object({
1976
- singlePaymentForDuration: /* @__PURE__ */ z.never().optional(),
1977
- singlePaymentUnlimited: /* @__PURE__ */ z.never().optional(),
1978
- subscription: /* @__PURE__ */ z.object({
1979
- cycleDuration: /* @__PURE__ */ z.object({
2053
+ /* @__PURE__ */ z.xor([
2054
+ /* @__PURE__ */ z.object({
2055
+ subscription: /* @__PURE__ */ z.never().optional(),
2056
+ singlePaymentForDuration: /* @__PURE__ */ z.never().optional(),
2057
+ singlePaymentUnlimited: /* @__PURE__ */ z.never().optional()
2058
+ }),
2059
+ /* @__PURE__ */ z.object({
2060
+ singlePaymentForDuration: /* @__PURE__ */ z.never().optional(),
2061
+ singlePaymentUnlimited: /* @__PURE__ */ z.never().optional(),
2062
+ subscription: /* @__PURE__ */ z.object({
2063
+ cycleDuration: /* @__PURE__ */ z.object({
2064
+ count: /* @__PURE__ */ z.number().int().describe(
2065
+ "Number of days, months, weeks, or years in a single payment cycle. Currently limited to support only `1`."
2066
+ ).min(1).optional().nullable(),
2067
+ unit: /* @__PURE__ */ z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).describe("Unit of time for the cycle duration.").optional()
2068
+ }).describe(
2069
+ "Number of payment cycles the subscription is valid for.\n`0` for unlimited plans or for plans that are valid until canceled."
2070
+ ).optional(),
2071
+ cycleCount: /* @__PURE__ */ z.number().int().describe(
2072
+ "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."
2073
+ ).min(0).max(2e3).optional().nullable()
2074
+ }).describe("Order has recurring payments.")
2075
+ }),
2076
+ /* @__PURE__ */ z.object({
2077
+ subscription: /* @__PURE__ */ z.never().optional(),
2078
+ singlePaymentUnlimited: /* @__PURE__ */ z.never().optional(),
2079
+ singlePaymentForDuration: /* @__PURE__ */ z.object({
1980
2080
  count: /* @__PURE__ */ z.number().int().describe(
1981
2081
  "Number of days, months, weeks, or years in a single payment cycle. Currently limited to support only `1`."
1982
2082
  ).min(1).optional().nullable(),
1983
2083
  unit: /* @__PURE__ */ z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).describe("Unit of time for the cycle duration.").optional()
1984
2084
  }).describe(
1985
- "Number of payment cycles the subscription is valid for.\n`0` for unlimited plans or for plans that are valid until canceled."
1986
- ).optional(),
1987
- cycleCount: /* @__PURE__ */ z.number().int().describe(
1988
- "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."
1989
- ).min(0).max(2e3).optional().nullable()
1990
- }).describe("Order has recurring payments.")
1991
- }),
1992
- /* @__PURE__ */ z.object({
1993
- subscription: /* @__PURE__ */ z.never().optional(),
1994
- singlePaymentUnlimited: /* @__PURE__ */ z.never().optional(),
1995
- singlePaymentForDuration: /* @__PURE__ */ z.object({
1996
- count: /* @__PURE__ */ z.number().int().describe(
1997
- "Number of days, months, weeks, or years in a single payment cycle. Currently limited to support only `1`."
1998
- ).min(1).optional().nullable(),
1999
- unit: /* @__PURE__ */ z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).describe("Unit of time for the cycle duration.").optional()
2000
- }).describe(
2001
- "One-time payment. Order is valid for a specified duration."
2002
- )
2003
- }),
2004
- /* @__PURE__ */ z.object({
2005
- subscription: /* @__PURE__ */ z.never().optional(),
2006
- singlePaymentForDuration: /* @__PURE__ */ z.never().optional(),
2007
- singlePaymentUnlimited: /* @__PURE__ */ z.boolean().describe(
2008
- "One-time payment. Order is valid until it is canceled."
2009
- )
2010
- })
2011
- ])
2012
- ).describe(
2013
- "__Deprecated.__ Use `pricing` instead. This property will be removed on September 30, 2022."
2014
- ).optional(),
2015
- pricing: /* @__PURE__ */ z.intersection(
2016
- /* @__PURE__ */ z.object({
2017
- prices: /* @__PURE__ */ z.array(
2085
+ "One-time payment. Order is valid for a specified duration."
2086
+ )
2087
+ }),
2018
2088
  /* @__PURE__ */ z.object({
2019
- duration: /* @__PURE__ */ z.object({
2020
- cycleFrom: /* @__PURE__ */ z.number().int().describe(
2021
- "Price starts to apply with this cycle.\n\n`1` is the first payment cycle for all pricing models."
2022
- ).optional(),
2023
- numberOfCycles: /* @__PURE__ */ z.number().int().describe(
2024
- "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`."
2025
- ).optional().nullable()
2026
- }).describe(
2027
- "Cycle duration to apply `price` for.\n\nUse with all pricing models.\nCan apply the same price to multiple payment cycles."
2028
- ).optional(),
2029
- price: /* @__PURE__ */ z.object({
2030
- subtotal: /* @__PURE__ */ z.string().describe(
2031
- 'Price of the order excluding tax, specified as a monetary amount. For example, `"9.99"`.'
2032
- ).optional(),
2033
- coupon: /* @__PURE__ */ z.object({
2034
- code: /* @__PURE__ */ z.string().describe("Code of the applied coupon.").min(1).max(20).optional(),
2035
- amount: /* @__PURE__ */ z.string().describe(
2036
- "Total discount of the coupon, as a monetary amount."
2089
+ subscription: /* @__PURE__ */ z.never().optional(),
2090
+ singlePaymentForDuration: /* @__PURE__ */ z.never().optional(),
2091
+ singlePaymentUnlimited: /* @__PURE__ */ z.boolean().describe(
2092
+ "One-time payment. Order is valid until it is canceled."
2093
+ )
2094
+ })
2095
+ ])
2096
+ ).describe(
2097
+ "__Deprecated.__ Use `pricing` instead. This property will be removed on September 30, 2022."
2098
+ ).optional(),
2099
+ pricing: /* @__PURE__ */ z.intersection(
2100
+ /* @__PURE__ */ z.object({
2101
+ prices: /* @__PURE__ */ z.array(
2102
+ /* @__PURE__ */ z.object({
2103
+ duration: /* @__PURE__ */ z.object({
2104
+ cycleFrom: /* @__PURE__ */ z.number().int().describe(
2105
+ "Price starts to apply with this cycle.\n\n`1` is the first payment cycle for all pricing models."
2037
2106
  ).optional(),
2038
- _id: /* @__PURE__ */ z.string().describe("Coupon ID.").regex(
2039
- /^[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}$/,
2040
- "Must be a valid GUID"
2041
- ).optional()
2107
+ numberOfCycles: /* @__PURE__ */ z.number().int().describe(
2108
+ "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`."
2109
+ ).optional().nullable()
2042
2110
  }).describe(
2043
- "Coupon applied to the order, from the Coupons API."
2111
+ "Cycle duration to apply `price` for.\n\nUse with all pricing models.\nCan apply the same price to multiple payment cycles."
2044
2112
  ).optional(),
2045
- discount: /* @__PURE__ */ z.string().describe("Total discount applied to the order.").optional(),
2046
- tax: /* @__PURE__ */ z.object({
2047
- name: /* @__PURE__ */ z.string().describe("Name of the tax. For example, VAT.").optional(),
2048
- includedInPrice: /* @__PURE__ */ z.boolean().describe(
2049
- "Whether tax is included in the original price. When `false`, tax is added at checkout."
2113
+ price: /* @__PURE__ */ z.object({
2114
+ subtotal: /* @__PURE__ */ z.string().describe(
2115
+ 'Price of the order excluding tax, specified as a monetary amount. For example, `"9.99"`.'
2050
2116
  ).optional(),
2051
- rate: /* @__PURE__ */ z.string().describe(
2052
- 'Tax rate percentage, as a number between 0 and 100. For example, a 7% tax rate is `"7.00"`.'
2117
+ coupon: /* @__PURE__ */ z.object({
2118
+ code: /* @__PURE__ */ z.string().describe("Code of the applied coupon.").min(1).max(20).optional(),
2119
+ amount: /* @__PURE__ */ z.string().describe(
2120
+ "Total discount of the coupon, as a monetary amount."
2121
+ ).optional(),
2122
+ _id: /* @__PURE__ */ z.string().describe("Coupon ID.").regex(
2123
+ /^[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}$/,
2124
+ "Must be a valid GUID"
2125
+ ).optional()
2126
+ }).describe(
2127
+ "Coupon applied to the order, from the Coupons API."
2053
2128
  ).optional(),
2054
- amount: /* @__PURE__ */ z.string().describe(
2055
- 'Total tax, specified as a monetary amount. For example, `"3.99"`.'
2129
+ discount: /* @__PURE__ */ z.string().describe("Total discount applied to the order.").optional(),
2130
+ tax: /* @__PURE__ */ z.object({
2131
+ name: /* @__PURE__ */ z.string().describe("Name of the tax. For example, VAT.").optional(),
2132
+ includedInPrice: /* @__PURE__ */ z.boolean().describe(
2133
+ "Whether tax is included in the original price. When `false`, tax is added at checkout."
2134
+ ).optional(),
2135
+ rate: /* @__PURE__ */ z.string().describe(
2136
+ 'Tax rate percentage, as a number between 0 and 100. For example, a 7% tax rate is `"7.00"`.'
2137
+ ).optional(),
2138
+ amount: /* @__PURE__ */ z.string().describe(
2139
+ 'Total tax, specified as a monetary amount. For example, `"3.99"`.'
2140
+ ).optional()
2141
+ }).describe(
2142
+ "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)."
2143
+ ).optional(),
2144
+ total: /* @__PURE__ */ z.string().describe(
2145
+ '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`.'
2146
+ ).optional(),
2147
+ currency: /* @__PURE__ */ z.string().describe(
2148
+ "Three-letter currency code in\n[ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format."
2149
+ ).optional(),
2150
+ proration: /* @__PURE__ */ z.string().describe(
2151
+ "Price change after billing date was change and price was adjusted. Could be positive and negative values."
2056
2152
  ).optional()
2153
+ }).describe("Order price.").optional()
2154
+ })
2155
+ ).optional()
2156
+ }),
2157
+ /* @__PURE__ */ z.xor([
2158
+ /* @__PURE__ */ z.object({
2159
+ subscription: /* @__PURE__ */ z.never().optional(),
2160
+ singlePaymentForDuration: /* @__PURE__ */ z.never().optional(),
2161
+ singlePaymentUnlimited: /* @__PURE__ */ z.never().optional()
2162
+ }),
2163
+ /* @__PURE__ */ z.object({
2164
+ singlePaymentForDuration: /* @__PURE__ */ z.never().optional(),
2165
+ singlePaymentUnlimited: /* @__PURE__ */ z.never().optional(),
2166
+ subscription: /* @__PURE__ */ z.object({
2167
+ cycleDuration: /* @__PURE__ */ z.object({
2168
+ count: /* @__PURE__ */ z.number().int().describe(
2169
+ "Number of days, months, weeks, or years in a single payment cycle. Currently limited to support only `1`."
2170
+ ).min(1).optional().nullable(),
2171
+ unit: /* @__PURE__ */ z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).describe("Unit of time for the cycle duration.").optional()
2057
2172
  }).describe(
2058
- "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)."
2059
- ).optional(),
2060
- total: /* @__PURE__ */ z.string().describe(
2061
- '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`.'
2062
- ).optional(),
2063
- currency: /* @__PURE__ */ z.string().describe(
2064
- "Three-letter currency code in\n[ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format."
2173
+ "Number of payment cycles the subscription is valid for.\n`0` for unlimited plans or for plans that are valid until canceled."
2065
2174
  ).optional(),
2066
- proration: /* @__PURE__ */ z.string().describe(
2067
- "Price change after billing date was change and price was adjusted. Could be positive and negative values."
2068
- ).optional()
2069
- }).describe("Order price.").optional()
2070
- })
2071
- ).optional()
2072
- }),
2073
- /* @__PURE__ */ z.xor([
2074
- /* @__PURE__ */ z.object({
2075
- subscription: /* @__PURE__ */ z.never().optional(),
2076
- singlePaymentForDuration: /* @__PURE__ */ z.never().optional(),
2077
- singlePaymentUnlimited: /* @__PURE__ */ z.never().optional()
2078
- }),
2079
- /* @__PURE__ */ z.object({
2080
- singlePaymentForDuration: /* @__PURE__ */ z.never().optional(),
2081
- singlePaymentUnlimited: /* @__PURE__ */ z.never().optional(),
2082
- subscription: /* @__PURE__ */ z.object({
2083
- cycleDuration: /* @__PURE__ */ z.object({
2175
+ cycleCount: /* @__PURE__ */ z.number().int().describe(
2176
+ "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."
2177
+ ).min(0).max(2e3).optional().nullable()
2178
+ }).describe(
2179
+ "Pricing model for an order with recurring payment cycles."
2180
+ )
2181
+ }),
2182
+ /* @__PURE__ */ z.object({
2183
+ subscription: /* @__PURE__ */ z.never().optional(),
2184
+ singlePaymentUnlimited: /* @__PURE__ */ z.never().optional(),
2185
+ singlePaymentForDuration: /* @__PURE__ */ z.object({
2084
2186
  count: /* @__PURE__ */ z.number().int().describe(
2085
2187
  "Number of days, months, weeks, or years in a single payment cycle. Currently limited to support only `1`."
2086
2188
  ).min(1).optional().nullable(),
2087
2189
  unit: /* @__PURE__ */ z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).describe("Unit of time for the cycle duration.").optional()
2088
2190
  }).describe(
2089
- "Number of payment cycles the subscription is valid for.\n`0` for unlimited plans or for plans that are valid until canceled."
2090
- ).optional(),
2091
- cycleCount: /* @__PURE__ */ z.number().int().describe(
2092
- "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."
2093
- ).min(0).max(2e3).optional().nullable()
2094
- }).describe(
2095
- "Pricing model for an order with recurring payment cycles."
2096
- )
2097
- }),
2098
- /* @__PURE__ */ z.object({
2099
- subscription: /* @__PURE__ */ z.never().optional(),
2100
- singlePaymentUnlimited: /* @__PURE__ */ z.never().optional(),
2101
- singlePaymentForDuration: /* @__PURE__ */ z.object({
2102
- count: /* @__PURE__ */ z.number().int().describe(
2103
- "Number of days, months, weeks, or years in a single payment cycle. Currently limited to support only `1`."
2104
- ).min(1).optional().nullable(),
2105
- unit: /* @__PURE__ */ z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).describe("Unit of time for the cycle duration.").optional()
2106
- }).describe(
2107
- "Pricing model for an order with a one-time payment and the order is valid for a specific amount of time."
2108
- )
2109
- }),
2110
- /* @__PURE__ */ z.object({
2111
- subscription: /* @__PURE__ */ z.never().optional(),
2112
- singlePaymentForDuration: /* @__PURE__ */ z.never().optional(),
2113
- singlePaymentUnlimited: /* @__PURE__ */ z.boolean().describe(
2114
- "Pricing model for an order with a one-time payment and the order is valid until canceled."
2115
- )
2116
- })
2117
- ])
2118
- ).describe(
2119
- "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)."
2120
- ).optional(),
2121
- type: /* @__PURE__ */ z.enum(["UNDEFINED", "ONLINE", "OFFLINE", "EXTERNAL"]).describe("How the order was processed.").optional(),
2122
- status: /* @__PURE__ */ z.enum([
2123
- "UNDEFINED",
2124
- "DRAFT",
2125
- "PENDING",
2126
- "ACTIVE",
2127
- "PAUSED",
2128
- "ENDED",
2129
- "CANCELED"
2130
- ]).describe("Status of the order.").optional(),
2131
- autoRenewCanceled: /* @__PURE__ */ z.boolean().describe(
2132
- "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."
2133
- ).optional().nullable(),
2134
- cancellation: /* @__PURE__ */ z.object({
2135
- requestedDate: /* @__PURE__ */ z.date().describe("Date and time the cancellation was requested.").optional().nullable(),
2136
- cause: /* @__PURE__ */ z.enum([
2191
+ "Pricing model for an order with a one-time payment and the order is valid for a specific amount of time."
2192
+ )
2193
+ }),
2194
+ /* @__PURE__ */ z.object({
2195
+ subscription: /* @__PURE__ */ z.never().optional(),
2196
+ singlePaymentForDuration: /* @__PURE__ */ z.never().optional(),
2197
+ singlePaymentUnlimited: /* @__PURE__ */ z.boolean().describe(
2198
+ "Pricing model for an order with a one-time payment and the order is valid until canceled."
2199
+ )
2200
+ })
2201
+ ])
2202
+ ).describe(
2203
+ "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)."
2204
+ ).optional(),
2205
+ type: /* @__PURE__ */ z.enum(["UNDEFINED", "ONLINE", "OFFLINE", "EXTERNAL"]).describe("How the order was processed.").optional(),
2206
+ status: /* @__PURE__ */ z.enum([
2137
2207
  "UNDEFINED",
2138
- "OWNER_ACTION",
2139
- "MEMBER_ACTION",
2140
- "PAYMENT_FAILURE",
2141
- "PAYMENT_SETUP_FAILURE",
2142
- "UNKNOWN"
2143
- ]).describe("Reason for the cancellation.").optional(),
2144
- effectiveAt: /* @__PURE__ */ z.enum(["UNDEFINED", "IMMEDIATELY", "NEXT_PAYMENT_DATE"]).describe(
2145
- "When the cancellation takes effect. Set when cancelling the order."
2146
- ).optional()
2147
- }).describe(
2148
- "Details about the cancellation of an order.\n\nOnly present if the status is `CANCELED`."
2149
- ).optional(),
2150
- lastPaymentStatus: /* @__PURE__ */ z.enum([
2151
- "UNDEFINED",
2152
- "PAID",
2153
- "REFUNDED",
2154
- "FAILED",
2155
- "UNPAID",
2156
- "PENDING",
2157
- "NOT_APPLICABLE"
2158
- ]).describe(
2159
- "Status of the last payment for the order.\nUpdated automatically for online orders. Updated manually by the Wix user for offline orders."
2160
- ).optional(),
2161
- startDate: /* @__PURE__ */ z.date().describe("Start date and time for the ordered plan.").optional().nullable(),
2162
- endDate: /* @__PURE__ */ z.date().describe(
2163
- "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`."
2164
- ).optional().nullable(),
2165
- pausePeriods: /* @__PURE__ */ z.array(
2166
- /* @__PURE__ */ z.object({
2167
- status: /* @__PURE__ */ z.enum(["UNDEFINED", "ACTIVE", "ENDED"]).describe("Status of the pause period.").optional(),
2168
- pauseDate: /* @__PURE__ */ z.date().describe("Start date and time of the pause period.").optional().nullable(),
2169
- resumeDate: /* @__PURE__ */ z.date().describe(
2170
- "End date and time of the pause period.\n\nOmitted while the pause period remains `ACTIVE`."
2171
- ).optional().nullable()
2172
- })
2173
- ).optional(),
2174
- freeTrialDays: /* @__PURE__ */ z.number().int().describe(
2175
- "Free trial period for the order, in days.\n\nOnly available for recurring plans."
2176
- ).min(1).max(999).optional().nullable(),
2177
- earliestEndDate: /* @__PURE__ */ z.date().describe(
2178
- "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."
2179
- ).optional().nullable(),
2180
- currentCycle: /* @__PURE__ */ z.object({
2181
- index: /* @__PURE__ */ z.number().int().describe(
2182
- "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`."
2183
- ).min(0).optional(),
2184
- startedDate: /* @__PURE__ */ z.date().describe("Start date and time for the current payment cycle.").optional().nullable(),
2185
- endedDate: /* @__PURE__ */ z.date().describe("End date and time for the current payment cycle.").optional().nullable()
2186
- }).describe(
2187
- "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."
2188
- ).optional(),
2189
- planName: /* @__PURE__ */ z.string().describe("Plan name at the time of purchase.").optional(),
2190
- planDescription: /* @__PURE__ */ z.string().describe("Plan description at the time of purchase").optional(),
2191
- planPrice: /* @__PURE__ */ z.string().describe("Plan price as it was at the moment of order creation.").optional(),
2192
- _createdDate: /* @__PURE__ */ z.date().describe("Date and time the order was created.").optional().nullable(),
2193
- _updatedDate: /* @__PURE__ */ z.date().describe("Date and time the order was updated.").optional().nullable(),
2194
- formData: /* @__PURE__ */ z.object({
2195
- formId: /* @__PURE__ */ z.string().describe(
2196
- "ID of the [order form](https://dev.wix.com/docs/rest/api-reference/wix-forms/form-submissions/introduction) associated with the plan at checkout."
2197
- ).regex(
2198
- /^[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}$/,
2199
- "Must be a valid GUID"
2200
- ).optional().nullable(),
2201
- submissionId: /* @__PURE__ */ z.string().describe(
2202
- "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."
2203
- ).regex(
2204
- /^[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}$/,
2205
- "Must be a valid GUID"
2208
+ "DRAFT",
2209
+ "PENDING",
2210
+ "ACTIVE",
2211
+ "PAUSED",
2212
+ "ENDED",
2213
+ "CANCELED"
2214
+ ]).describe("Status of the order.").optional(),
2215
+ autoRenewCanceled: /* @__PURE__ */ z.boolean().describe(
2216
+ "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."
2206
2217
  ).optional().nullable(),
2207
- submissionData: /* @__PURE__ */ z.record(/* @__PURE__ */ z.string(), /* @__PURE__ */ z.any()).describe("Data submitted to the plan's order form at checkout.").optional()
2208
- }).describe(
2209
- "Information about the form submitted during the plan's checkout."
2210
- ).optional()
2211
- }).describe("The previewed order, as if the plan had been ordered.").optional(),
2212
- purchaseLimitExceeded: /* @__PURE__ */ z.boolean().describe(
2213
- "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."
2214
- ).optional()
2215
- });
2216
- var GetPricePreviewRequest = /* @__PURE__ */ z.object({
2217
- planId: /* @__PURE__ */ z.string().describe("ID of plan to preview.").regex(
2218
- /^[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}$/,
2219
- "Must be a valid GUID"
2220
- ),
2221
- options: /* @__PURE__ */ z.object({
2222
- couponCode: /* @__PURE__ */ z.string().describe("Coupon code to apply, from the Coupons API.").min(1).max(20).optional().nullable()
2223
- }).describe("Options for getting a price preview. ").optional()
2224
- });
2225
- var GetPricePreviewResponse = /* @__PURE__ */ z.object({
2226
- price: /* @__PURE__ */ z.intersection(
2227
- /* @__PURE__ */ z.object({
2228
- subtotal: /* @__PURE__ */ z.string().describe(
2229
- 'Price of the order excluding tax, specified as a monetary amount. for example, `"9.99"`.'
2230
- ).optional(),
2231
- discount: /* @__PURE__ */ z.string().describe("Total discount applied.").optional(),
2232
- tax: /* @__PURE__ */ z.object({
2233
- name: /* @__PURE__ */ z.string().describe("Name of the tax. For example, VAT.").optional(),
2234
- includedInPrice: /* @__PURE__ */ z.boolean().describe(
2235
- "Whether tax is included in the original price. When `false`, tax is added at checkout."
2236
- ).optional(),
2237
- rate: /* @__PURE__ */ z.string().describe(
2238
- 'Tax rate percentage, as a number between 0 and 100. For example, a 7% tax rate is `"7.00"`.'
2239
- ).optional(),
2240
- amount: /* @__PURE__ */ z.string().describe(
2241
- 'Total tax, specified as a monetary amount. For example, `"3.99"`.'
2218
+ cancellation: /* @__PURE__ */ z.object({
2219
+ requestedDate: /* @__PURE__ */ z.date().describe("Date and time the cancellation was requested.").optional().nullable(),
2220
+ cause: /* @__PURE__ */ z.enum([
2221
+ "UNDEFINED",
2222
+ "OWNER_ACTION",
2223
+ "MEMBER_ACTION",
2224
+ "PAYMENT_FAILURE",
2225
+ "PAYMENT_SETUP_FAILURE",
2226
+ "UNKNOWN"
2227
+ ]).describe("Reason for the cancellation.").optional(),
2228
+ effectiveAt: /* @__PURE__ */ z.enum(["UNDEFINED", "IMMEDIATELY", "NEXT_PAYMENT_DATE"]).describe(
2229
+ "When the cancellation takes effect. Set when cancelling the order."
2242
2230
  ).optional()
2243
- }).describe("Tax applied.").optional(),
2244
- total: /* @__PURE__ */ z.string().describe(
2245
- '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`.'
2231
+ }).describe(
2232
+ "Details about the cancellation of an order.\n\nOnly present if the status is `CANCELED`."
2246
2233
  ).optional(),
2247
- planPrice: /* @__PURE__ */ z.string().describe("Plan price as it was at the moment of order creation.").optional(),
2248
- currency: /* @__PURE__ */ z.string().describe(
2249
- "Currency code. Must be valid ISO 4217 currency code (e.g., USD)."
2234
+ lastPaymentStatus: /* @__PURE__ */ z.enum([
2235
+ "UNDEFINED",
2236
+ "PAID",
2237
+ "REFUNDED",
2238
+ "FAILED",
2239
+ "UNPAID",
2240
+ "PENDING",
2241
+ "NOT_APPLICABLE"
2242
+ ]).describe(
2243
+ "Status of the last payment for the order.\nUpdated automatically for online orders. Updated manually by the Wix user for offline orders."
2244
+ ).optional(),
2245
+ startDate: /* @__PURE__ */ z.date().describe("Start date and time for the ordered plan.").optional().nullable(),
2246
+ endDate: /* @__PURE__ */ z.date().describe(
2247
+ "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`."
2248
+ ).optional().nullable(),
2249
+ pausePeriods: /* @__PURE__ */ z.array(
2250
+ /* @__PURE__ */ z.object({
2251
+ status: /* @__PURE__ */ z.enum(["UNDEFINED", "ACTIVE", "ENDED"]).describe("Status of the pause period.").optional(),
2252
+ pauseDate: /* @__PURE__ */ z.date().describe("Start date and time of the pause period.").optional().nullable(),
2253
+ resumeDate: /* @__PURE__ */ z.date().describe(
2254
+ "End date and time of the pause period.\n\nOmitted while the pause period remains `ACTIVE`."
2255
+ ).optional().nullable()
2256
+ })
2250
2257
  ).optional(),
2251
2258
  freeTrialDays: /* @__PURE__ */ z.number().int().describe(
2252
- "Free trial period for the order in days. Only available for recurring plans."
2259
+ "Free trial period for the order, in days.\n\nOnly available for recurring plans."
2253
2260
  ).min(1).max(999).optional().nullable(),
2254
- coupon: /* @__PURE__ */ z.object({
2255
- code: /* @__PURE__ */ z.string().describe("Code of the applied coupon.").min(1).max(20).optional(),
2256
- amount: /* @__PURE__ */ z.string().describe("Total discount of the coupon, as a monetary amount.").optional(),
2257
- _id: /* @__PURE__ */ z.string().describe("Coupon ID.").regex(
2261
+ earliestEndDate: /* @__PURE__ */ z.date().describe(
2262
+ "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."
2263
+ ).optional().nullable(),
2264
+ currentCycle: /* @__PURE__ */ z.object({
2265
+ index: /* @__PURE__ */ z.number().int().describe(
2266
+ "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`."
2267
+ ).min(0).optional(),
2268
+ startedDate: /* @__PURE__ */ z.date().describe("Start date and time for the current payment cycle.").optional().nullable(),
2269
+ endedDate: /* @__PURE__ */ z.date().describe("End date and time for the current payment cycle.").optional().nullable()
2270
+ }).describe(
2271
+ "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."
2272
+ ).optional(),
2273
+ planName: /* @__PURE__ */ z.string().describe("Plan name at the time of purchase.").optional(),
2274
+ planDescription: /* @__PURE__ */ z.string().describe("Plan description at the time of purchase").optional(),
2275
+ planPrice: /* @__PURE__ */ z.string().describe("Plan price as it was at the moment of order creation.").optional(),
2276
+ _createdDate: /* @__PURE__ */ z.date().describe("Date and time the order was created.").optional().nullable(),
2277
+ _updatedDate: /* @__PURE__ */ z.date().describe("Date and time the order was updated.").optional().nullable(),
2278
+ formData: /* @__PURE__ */ z.object({
2279
+ formId: /* @__PURE__ */ z.string().describe(
2280
+ "ID of the [order form](https://dev.wix.com/docs/rest/api-reference/wix-forms/form-submissions/introduction) associated with the plan at checkout."
2281
+ ).regex(
2258
2282
  /^[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}$/,
2259
2283
  "Must be a valid GUID"
2260
- ).optional()
2284
+ ).optional().nullable(),
2285
+ submissionId: /* @__PURE__ */ z.string().describe(
2286
+ "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."
2287
+ ).regex(
2288
+ /^[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}$/,
2289
+ "Must be a valid GUID"
2290
+ ).optional().nullable(),
2291
+ submissionData: /* @__PURE__ */ z.record(/* @__PURE__ */ z.string(), /* @__PURE__ */ z.any()).describe("Data submitted to the plan's order form at checkout.").optional()
2261
2292
  }).describe(
2262
- "Coupon applied to the order. Empty means no coupon was applied."
2293
+ "Information about the form submitted during the plan's checkout."
2263
2294
  ).optional()
2264
- }),
2265
- /* @__PURE__ */ z.xor([
2266
- /* @__PURE__ */ z.object({
2267
- subscription: /* @__PURE__ */ z.never().optional(),
2268
- singlePaymentForDuration: /* @__PURE__ */ z.never().optional(),
2269
- singlePaymentUnlimited: /* @__PURE__ */ z.never().optional()
2270
- }),
2271
- /* @__PURE__ */ z.object({
2272
- singlePaymentForDuration: /* @__PURE__ */ z.never().optional(),
2273
- singlePaymentUnlimited: /* @__PURE__ */ z.never().optional(),
2274
- subscription: /* @__PURE__ */ z.object({
2275
- cycleDuration: /* @__PURE__ */ z.object({
2276
- count: /* @__PURE__ */ z.number().int().describe(
2277
- "Number of days, months, weeks, or years in a single payment cycle. Currently limited to support only `1`."
2278
- ).min(1).optional().nullable(),
2279
- unit: /* @__PURE__ */ z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).describe("Unit of time for the cycle duration.").optional()
2280
- }).describe(
2281
- "Number of payment cycles the subscription is valid for.\n`0` for unlimited plans or for plans that are valid until canceled."
2282
- ).optional(),
2283
- cycleCount: /* @__PURE__ */ z.number().int().describe(
2284
- "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."
2285
- ).min(0).max(2e3).optional().nullable()
2286
- }).describe("Order has recurring payments.")
2287
- }),
2288
- /* @__PURE__ */ z.object({
2289
- subscription: /* @__PURE__ */ z.never().optional(),
2290
- singlePaymentUnlimited: /* @__PURE__ */ z.never().optional(),
2291
- singlePaymentForDuration: /* @__PURE__ */ z.object({
2292
- count: /* @__PURE__ */ z.number().int().describe(
2293
- "Number of days, months, weeks, or years in a single payment cycle. Currently limited to support only `1`."
2294
- ).min(1).optional().nullable(),
2295
- unit: /* @__PURE__ */ z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).describe("Unit of time for the cycle duration.").optional()
2296
- }).describe(
2297
- "One-time payment. Order is valid for a specified duration."
2298
- )
2299
- }),
2300
- /* @__PURE__ */ z.object({
2301
- subscription: /* @__PURE__ */ z.never().optional(),
2302
- singlePaymentForDuration: /* @__PURE__ */ z.never().optional(),
2303
- singlePaymentUnlimited: /* @__PURE__ */ z.boolean().describe("One-time payment. Order is valid until it is canceled.")
2304
- })
2305
- ])
2306
- ).describe(
2307
- "__Deprecated.__ Use `prices` instead. This property will be removed on September 30, 2022."
2308
- ).optional(),
2309
- prices: /* @__PURE__ */ z.array(
2310
- /* @__PURE__ */ z.object({
2311
- duration: /* @__PURE__ */ z.object({
2312
- cycleFrom: /* @__PURE__ */ z.number().int().describe(
2313
- "Price starts to apply with this cycle.\n\n`1` is the first payment cycle for all pricing models."
2314
- ).optional(),
2315
- numberOfCycles: /* @__PURE__ */ z.number().int().describe(
2316
- "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`."
2317
- ).optional().nullable()
2318
- }).describe(
2319
- "Cycle duration to apply `price` for.\n\nUse with all pricing models.\nCan apply the same price to multiple payment cycles."
2320
- ).optional(),
2321
- price: /* @__PURE__ */ z.object({
2322
- subtotal: /* @__PURE__ */ z.string().describe(
2323
- 'Price of the order excluding tax, specified as a monetary amount. For example, `"9.99"`.'
2324
- ).optional(),
2325
- coupon: /* @__PURE__ */ z.object({
2326
- code: /* @__PURE__ */ z.string().describe("Code of the applied coupon.").min(1).max(20).optional(),
2327
- amount: /* @__PURE__ */ z.string().describe(
2328
- "Total discount of the coupon, as a monetary amount."
2329
- ).optional(),
2330
- _id: /* @__PURE__ */ z.string().describe("Coupon ID.").regex(
2331
- /^[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}$/,
2332
- "Must be a valid GUID"
2333
- ).optional()
2334
- }).describe("Coupon applied to the order, from the Coupons API.").optional(),
2335
- discount: /* @__PURE__ */ z.string().describe("Total discount applied to the order.").optional(),
2336
- tax: /* @__PURE__ */ z.object({
2337
- name: /* @__PURE__ */ z.string().describe("Name of the tax. For example, VAT.").optional(),
2338
- includedInPrice: /* @__PURE__ */ z.boolean().describe(
2339
- "Whether tax is included in the original price. When `false`, tax is added at checkout."
2340
- ).optional(),
2341
- rate: /* @__PURE__ */ z.string().describe(
2342
- 'Tax rate percentage, as a number between 0 and 100. For example, a 7% tax rate is `"7.00"`.'
2343
- ).optional(),
2344
- amount: /* @__PURE__ */ z.string().describe(
2345
- 'Total tax, specified as a monetary amount. For example, `"3.99"`.'
2346
- ).optional()
2347
- }).describe(
2348
- "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)."
2349
- ).optional(),
2350
- total: /* @__PURE__ */ z.string().describe(
2351
- '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`.'
2352
- ).optional(),
2353
- currency: /* @__PURE__ */ z.string().describe(
2354
- "Three-letter currency code in\n[ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format."
2355
- ).optional(),
2356
- proration: /* @__PURE__ */ z.string().describe(
2357
- "Price change after billing date was change and price was adjusted. Could be positive and negative values."
2358
- ).optional()
2359
- }).describe("Order price.").optional()
2360
2295
  })
2296
+ ).optional(),
2297
+ pagingMetadata: /* @__PURE__ */ z.object({
2298
+ count: /* @__PURE__ */ z.number().int().describe("Number of items returned in the response.").optional().nullable(),
2299
+ offset: /* @__PURE__ */ z.number().int().describe("Offset that was requested.").optional().nullable(),
2300
+ total: /* @__PURE__ */ z.number().int().describe(
2301
+ "Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set."
2302
+ ).optional().nullable(),
2303
+ tooManyToCount: /* @__PURE__ */ z.boolean().describe(
2304
+ "Flag that indicates the server failed to calculate the `total` field."
2305
+ ).optional().nullable(),
2306
+ cursors: /* @__PURE__ */ z.object({
2307
+ next: /* @__PURE__ */ z.string().describe(
2308
+ "Cursor string pointing to the next page in the list of results."
2309
+ ).max(16e3).optional().nullable(),
2310
+ prev: /* @__PURE__ */ z.string().describe(
2311
+ "Cursor pointing to the previous page in the list of results."
2312
+ ).max(16e3).optional().nullable()
2313
+ }).describe(
2314
+ "Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used."
2315
+ ).optional()
2316
+ }).describe(
2317
+ "Object containing paging-related data (number of orders returned, offset)."
2361
2318
  ).optional()
2362
2319
  });
2320
+ var PostponeEndDateRequest = /* @__PURE__ */ z.object({
2321
+ _id: /* @__PURE__ */ z.string().describe("Order ID.").regex(
2322
+ /^[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}$/,
2323
+ "Must be a valid GUID"
2324
+ ),
2325
+ endDate: /* @__PURE__ */ z.date().describe(
2326
+ "New end date and time.\n\nMust be later than the current end date and time."
2327
+ )
2328
+ });
2329
+ var PostponeEndDateResponse = /* @__PURE__ */ z.object({});
2330
+ var CancelOrderRequest = /* @__PURE__ */ z.object({
2331
+ _id: /* @__PURE__ */ z.string().describe("Order ID.").regex(
2332
+ /^[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}$/,
2333
+ "Must be a valid GUID"
2334
+ ),
2335
+ effectiveAt: /* @__PURE__ */ z.enum([
2336
+ "UNDEFINED",
2337
+ "IMMEDIATELY",
2338
+ "NEXT_PAYMENT_DATE"
2339
+ ])
2340
+ });
2341
+ var CancelOrderResponse = /* @__PURE__ */ z.object({});
2342
+ var MarkAsPaidRequest = /* @__PURE__ */ z.object({
2343
+ _id: /* @__PURE__ */ z.string().describe("Order ID.").regex(
2344
+ /^[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}$/,
2345
+ "Must be a valid GUID"
2346
+ )
2347
+ });
2348
+ var MarkAsPaidResponse = /* @__PURE__ */ z.object({});
2349
+ var PauseOrderRequest = /* @__PURE__ */ z.object({
2350
+ _id: /* @__PURE__ */ z.string().describe("Order ID.").regex(
2351
+ /^[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}$/,
2352
+ "Must be a valid GUID"
2353
+ )
2354
+ });
2355
+ var PauseOrderResponse = /* @__PURE__ */ z.object({});
2356
+ var ResumeOrderRequest = /* @__PURE__ */ z.object({
2357
+ _id: /* @__PURE__ */ z.string().describe("Order ID.").regex(
2358
+ /^[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}$/,
2359
+ "Must be a valid GUID"
2360
+ )
2361
+ });
2362
+ var ResumeOrderResponse = /* @__PURE__ */ z.object({});
2363
2363
  var MemberGetOrderRequest = /* @__PURE__ */ z.object({
2364
2364
  _id: /* @__PURE__ */ z.string().describe("Order ID.").regex(
2365
2365
  /^[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}$/,