@wix/auto_sdk_pricing-plans_orders 1.0.119 → 1.0.121

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/build/cjs/index.d.ts +51 -51
  2. package/build/cjs/index.js +386 -367
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/index.typings.d.ts +353 -342
  5. package/build/cjs/index.typings.js +312 -293
  6. package/build/cjs/index.typings.js.map +1 -1
  7. package/build/cjs/meta.d.ts +232 -221
  8. package/build/cjs/meta.js +245 -226
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/cjs/schemas.d.ts +209 -201
  11. package/build/cjs/schemas.js +928 -916
  12. package/build/cjs/schemas.js.map +1 -1
  13. package/build/es/index.d.mts +51 -51
  14. package/build/es/index.mjs +386 -367
  15. package/build/es/index.mjs.map +1 -1
  16. package/build/es/index.typings.d.mts +353 -342
  17. package/build/es/index.typings.mjs +312 -293
  18. package/build/es/index.typings.mjs.map +1 -1
  19. package/build/es/meta.d.mts +232 -221
  20. package/build/es/meta.mjs +245 -226
  21. package/build/es/meta.mjs.map +1 -1
  22. package/build/es/schemas.d.mts +209 -201
  23. package/build/es/schemas.mjs +928 -916
  24. package/build/es/schemas.mjs.map +1 -1
  25. package/build/internal/cjs/index.d.ts +51 -51
  26. package/build/internal/cjs/index.js +386 -367
  27. package/build/internal/cjs/index.js.map +1 -1
  28. package/build/internal/cjs/index.typings.d.ts +412 -342
  29. package/build/internal/cjs/index.typings.js +312 -293
  30. package/build/internal/cjs/index.typings.js.map +1 -1
  31. package/build/internal/cjs/meta.d.ts +329 -217
  32. package/build/internal/cjs/meta.js +245 -226
  33. package/build/internal/cjs/meta.js.map +1 -1
  34. package/build/internal/cjs/schemas.d.ts +209 -201
  35. package/build/internal/cjs/schemas.js +928 -916
  36. package/build/internal/cjs/schemas.js.map +1 -1
  37. package/build/internal/es/index.d.mts +51 -51
  38. package/build/internal/es/index.mjs +386 -367
  39. package/build/internal/es/index.mjs.map +1 -1
  40. package/build/internal/es/index.typings.d.mts +412 -342
  41. package/build/internal/es/index.typings.mjs +312 -293
  42. package/build/internal/es/index.typings.mjs.map +1 -1
  43. package/build/internal/es/meta.d.mts +329 -217
  44. package/build/internal/es/meta.mjs +245 -226
  45. package/build/internal/es/meta.mjs.map +1 -1
  46. package/build/internal/es/schemas.d.mts +209 -201
  47. package/build/internal/es/schemas.mjs +928 -916
  48. package/build/internal/es/schemas.mjs.map +1 -1
  49. package/package.json +4 -4
@@ -65,14 +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 MemberGetOrderRequest = z.object({
69
- _id: z.string().describe("Order ID.").regex(
68
+ var CreateOnlineOrderRequest = z.object({
69
+ planId: 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
- options: z.object({ fieldSet: z.enum(["UNKNOWN_SET", "BASIC", "FULL"]).optional() }).describe("Options for getting a logged-in member's order. ").optional()
73
+ options: z.object({
74
+ startDate: 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: z.string().describe("Coupon code to apply.").min(1).max(20).optional().nullable(),
78
+ onBehalf: z.object({
79
+ memberId: 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: z.enum(["UNKNOWN", "MOTO", "POS"]).optional()
84
+ }).describe("Provided if checkout is initiated on buyer's behalf.").optional(),
85
+ submissionId: 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()
74
90
  });
75
- var MemberGetOrderResponse = z.object({
91
+ var CreateOnlineOrderResponse = z.object({
76
92
  order: z.object({
77
93
  _id: z.string().describe("Order ID.").regex(
78
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}$/,
@@ -393,428 +409,365 @@ var MemberGetOrderResponse = z.object({
393
409
  }).describe(
394
410
  "Information about the form submitted during the plan's checkout."
395
411
  ).optional()
396
- }).describe("Requested order.").optional()
412
+ }).describe("Created online order.").optional()
397
413
  });
398
- var MemberListOrdersRequest = z.object({
414
+ var CreateOfflineOrderRequest = z.object({
415
+ planId: 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: 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
+ ),
399
423
  options: z.object({
400
- planIds: z.array(z.string()).optional(),
401
- autoRenewCanceled: z.boolean().describe("Filter for orders where auto renewal was canceled.").optional().nullable(),
402
- orderStatuses: z.array(
403
- z.enum([
404
- "UNDEFINED",
405
- "DRAFT",
406
- "PENDING",
407
- "ACTIVE",
408
- "PAUSED",
409
- "ENDED",
410
- "CANCELED"
411
- ])
424
+ startDate: 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."
426
+ ).optional().nullable(),
427
+ paid: z.boolean().describe("Whether the order is paid.\n\nDefault: `false`").optional().nullable(),
428
+ couponCode: z.string().describe("Coupon code to apply, from the Coupons API.").min(1).max(20).optional().nullable(),
429
+ submissionId: 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 = z.object({
436
+ order: z.object({
437
+ _id: 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"
412
440
  ).optional(),
413
- paymentStatuses: z.array(
414
- z.enum([
415
- "UNDEFINED",
416
- "PAID",
417
- "REFUNDED",
418
- "FAILED",
419
- "UNPAID",
420
- "PENDING",
421
- "NOT_APPLICABLE"
422
- ])
441
+ planId: 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"
423
446
  ).optional(),
424
- limit: z.number().int().describe(
425
- "Limit the number of pricing plans returned. Default limit is 50."
426
- ).min(1).max(50).optional().nullable(),
427
- offset: z.number().int().describe("Number of entries to offset.").min(0).optional().nullable(),
428
- sorting: z.object({
429
- fieldName: z.string().describe("Name of the field to sort by.").max(512).optional(),
430
- order: z.enum(["ASC", "DESC"]).optional()
431
- }).describe("Sorting direction (defaults to ASC) and field to sort by.").optional(),
432
- fieldSet: z.enum(["UNKNOWN_SET", "BASIC", "FULL"]).optional()
433
- }).describe("Filtering, sorting, and pagination options. ").optional()
434
- });
435
- var MemberListOrdersResponse = z.object({
436
- orders: z.array(
437
- z.object({
438
- _id: z.string().describe("Order ID.").regex(
439
- /^[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}$/,
440
- "Must be a valid GUID"
441
- ).optional(),
442
- planId: z.string().describe(
443
- "ID of the plan purchased with the order, from the Plans API."
444
- ).regex(
445
- /^[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}$/,
446
- "Must be a valid GUID"
447
- ).optional(),
448
- subscriptionId: z.string().describe(
449
- "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)."
450
- ).regex(
447
+ subscriptionId: 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"
452
+ ).optional(),
453
+ wixPayOrderId: 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: z.object({
460
+ memberId: z.string().describe("Member ID for a Wix site member, from the Members API.").regex(
451
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}$/,
452
462
  "Must be a valid GUID"
453
463
  ).optional(),
454
- wixPayOrderId: z.string().describe(
455
- "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: z.string().describe(
465
+ "Contact ID for a Wix site contact, from the Contacts API."
456
466
  ).regex(
457
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}$/,
458
468
  "Must be a valid GUID"
459
- ).optional().nullable(),
460
- buyer: z.object({
461
- memberId: z.string().describe(
462
- "Member ID for a Wix site member, from the Members API."
463
- ).regex(
464
- /^[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
- "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: z.intersection(
474
+ z.object({
475
+ subtotal: z.string().describe(
476
+ 'Price of the order excluding tax, specified as a monetary amount. for example, `"9.99"`.'
466
477
  ).optional(),
467
- contactId: z.string().describe(
468
- "Contact ID for a Wix site contact, from the Contacts API."
469
- ).regex(
470
- /^[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
- "Must be a valid GUID"
472
- ).optional()
473
- }).describe(
474
- "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`."
475
- ).optional(),
476
- priceDetails: z.intersection(
477
- z.object({
478
- subtotal: z.string().describe(
479
- 'Price of the order excluding tax, specified as a monetary amount. for example, `"9.99"`.'
480
- ).optional(),
481
- discount: z.string().describe("Total discount applied.").optional(),
482
- tax: z.object({
483
- name: z.string().describe("Name of the tax. For example, VAT.").optional(),
484
- includedInPrice: z.boolean().describe(
485
- "Whether tax is included in the original price. When `false`, tax is added at checkout."
486
- ).optional(),
487
- rate: z.string().describe(
488
- 'Tax rate percentage, as a number between 0 and 100. For example, a 7% tax rate is `"7.00"`.'
489
- ).optional(),
490
- amount: z.string().describe(
491
- 'Total tax, specified as a monetary amount. For example, `"3.99"`.'
492
- ).optional()
493
- }).describe("Tax applied.").optional(),
494
- total: z.string().describe(
495
- '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: z.string().describe("Total discount applied.").optional(),
479
+ tax: z.object({
480
+ name: z.string().describe("Name of the tax. For example, VAT.").optional(),
481
+ includedInPrice: z.boolean().describe(
482
+ "Whether tax is included in the original price. When `false`, tax is added at checkout."
496
483
  ).optional(),
497
- planPrice: z.string().describe(
498
- "Plan price as it was at the moment of order creation."
484
+ rate: z.string().describe(
485
+ 'Tax rate percentage, as a number between 0 and 100. For example, a 7% tax rate is `"7.00"`.'
499
486
  ).optional(),
500
- currency: z.string().describe(
501
- "Currency code. Must be valid ISO 4217 currency code (e.g., USD)."
487
+ amount: z.string().describe(
488
+ 'Total tax, specified as a monetary amount. For example, `"3.99"`.'
489
+ ).optional()
490
+ }).describe("Tax applied.").optional(),
491
+ total: 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: z.string().describe("Plan price as it was at the moment of order creation.").optional(),
495
+ currency: z.string().describe(
496
+ "Currency code. Must be valid ISO 4217 currency code (e.g., USD)."
497
+ ).optional(),
498
+ freeTrialDays: 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: z.object({
502
+ code: z.string().describe("Code of the applied coupon.").min(1).max(20).optional(),
503
+ amount: z.string().describe(
504
+ "Total discount of the coupon, as a monetary amount."
502
505
  ).optional(),
503
- freeTrialDays: z.number().int().describe(
504
- "Free trial period for the order in days. Only available for recurring plans."
505
- ).min(1).max(999).optional().nullable(),
506
- coupon: z.object({
507
- code: z.string().describe("Code of the applied coupon.").min(1).max(20).optional(),
508
- amount: z.string().describe(
509
- "Total discount of the coupon, as a monetary amount."
510
- ).optional(),
511
- _id: z.string().describe("Coupon ID.").regex(
512
- /^[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}$/,
513
- "Must be a valid GUID"
514
- ).optional()
515
- }).describe(
516
- "Coupon applied to the order. Empty means no coupon was applied."
506
+ _id: 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"
517
509
  ).optional()
510
+ }).describe(
511
+ "Coupon applied to the order. Empty means no coupon was applied."
512
+ ).optional()
513
+ }),
514
+ z.xor([
515
+ z.object({
516
+ subscription: z.never().optional(),
517
+ singlePaymentForDuration: z.never().optional(),
518
+ singlePaymentUnlimited: z.never().optional()
518
519
  }),
519
- z.xor([
520
- z.object({
521
- subscription: z.never().optional(),
522
- singlePaymentForDuration: z.never().optional(),
523
- singlePaymentUnlimited: z.never().optional()
524
- }),
525
- z.object({
526
- singlePaymentForDuration: z.never().optional(),
527
- singlePaymentUnlimited: z.never().optional(),
528
- subscription: z.object({
529
- cycleDuration: z.object({
530
- count: z.number().int().describe(
531
- "Number of days, months, weeks, or years in a single payment cycle. Currently limited to support only `1`."
532
- ).min(1).optional().nullable(),
533
- unit: z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).describe("Unit of time for the cycle duration.").optional()
534
- }).describe(
535
- "Number of payment cycles the subscription is valid for.\n`0` for unlimited plans or for plans that are valid until canceled."
536
- ).optional(),
537
- cycleCount: z.number().int().describe(
538
- "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."
539
- ).min(0).max(2e3).optional().nullable()
540
- }).describe("Order has recurring payments.")
541
- }),
542
- z.object({
543
- subscription: z.never().optional(),
544
- singlePaymentUnlimited: z.never().optional(),
545
- singlePaymentForDuration: z.object({
520
+ z.object({
521
+ singlePaymentForDuration: z.never().optional(),
522
+ singlePaymentUnlimited: z.never().optional(),
523
+ subscription: z.object({
524
+ cycleDuration: z.object({
546
525
  count: z.number().int().describe(
547
526
  "Number of days, months, weeks, or years in a single payment cycle. Currently limited to support only `1`."
548
527
  ).min(1).optional().nullable(),
549
528
  unit: z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).describe("Unit of time for the cycle duration.").optional()
550
529
  }).describe(
551
- "One-time payment. Order is valid for a specified duration."
552
- )
553
- }),
554
- z.object({
555
- subscription: z.never().optional(),
556
- singlePaymentForDuration: z.never().optional(),
557
- singlePaymentUnlimited: z.boolean().describe(
558
- "One-time payment. Order is valid until it is canceled."
559
- )
560
- })
561
- ])
562
- ).describe(
563
- "__Deprecated.__ Use `pricing` instead. This property will be removed on September 30, 2022."
564
- ).optional(),
565
- pricing: 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: 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
+ }),
566
537
  z.object({
567
- prices: z.array(
568
- z.object({
569
- duration: z.object({
570
- cycleFrom: z.number().int().describe(
571
- "Price starts to apply with this cycle.\n\n`1` is the first payment cycle for all pricing models."
538
+ subscription: z.never().optional(),
539
+ singlePaymentUnlimited: z.never().optional(),
540
+ singlePaymentForDuration: z.object({
541
+ count: 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: 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
+ z.object({
550
+ subscription: z.never().optional(),
551
+ singlePaymentForDuration: z.never().optional(),
552
+ singlePaymentUnlimited: 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: z.intersection(
561
+ z.object({
562
+ prices: z.array(
563
+ z.object({
564
+ duration: z.object({
565
+ cycleFrom: 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: 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: z.object({
575
+ subtotal: z.string().describe(
576
+ 'Price of the order excluding tax, specified as a monetary amount. For example, `"9.99"`.'
577
+ ).optional(),
578
+ coupon: z.object({
579
+ code: z.string().describe("Code of the applied coupon.").min(1).max(20).optional(),
580
+ amount: z.string().describe(
581
+ "Total discount of the coupon, as a monetary amount."
572
582
  ).optional(),
573
- numberOfCycles: z.number().int().describe(
574
- "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`."
575
- ).optional().nullable()
583
+ _id: 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()
576
587
  }).describe(
577
- "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."
578
589
  ).optional(),
579
- price: z.object({
580
- subtotal: z.string().describe(
581
- 'Price of the order excluding tax, specified as a monetary amount. For example, `"9.99"`.'
582
- ).optional(),
583
- coupon: z.object({
584
- code: z.string().describe("Code of the applied coupon.").min(1).max(20).optional(),
585
- amount: z.string().describe(
586
- "Total discount of the coupon, as a monetary amount."
587
- ).optional(),
588
- _id: z.string().describe("Coupon ID.").regex(
589
- /^[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}$/,
590
- "Must be a valid GUID"
591
- ).optional()
592
- }).describe(
593
- "Coupon applied to the order, from the Coupons API."
594
- ).optional(),
595
- discount: z.string().describe("Total discount applied to the order.").optional(),
596
- tax: z.object({
597
- name: z.string().describe("Name of the tax. For example, VAT.").optional(),
598
- includedInPrice: z.boolean().describe(
599
- "Whether tax is included in the original price. When `false`, tax is added at checkout."
600
- ).optional(),
601
- rate: z.string().describe(
602
- 'Tax rate percentage, as a number between 0 and 100. For example, a 7% tax rate is `"7.00"`.'
603
- ).optional(),
604
- amount: z.string().describe(
605
- 'Total tax, specified as a monetary amount. For example, `"3.99"`.'
606
- ).optional()
607
- }).describe(
608
- "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)."
609
- ).optional(),
610
- total: z.string().describe(
611
- '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: z.string().describe("Total discount applied to the order.").optional(),
591
+ tax: z.object({
592
+ name: z.string().describe("Name of the tax. For example, VAT.").optional(),
593
+ includedInPrice: z.boolean().describe(
594
+ "Whether tax is included in the original price. When `false`, tax is added at checkout."
612
595
  ).optional(),
613
- currency: z.string().describe(
614
- "Three-letter currency code in\n[ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format."
596
+ rate: z.string().describe(
597
+ 'Tax rate percentage, as a number between 0 and 100. For example, a 7% tax rate is `"7.00"`.'
615
598
  ).optional(),
616
- proration: z.string().describe(
617
- "Price change after billing date was change and price was adjusted. Could be positive and negative values."
599
+ amount: z.string().describe(
600
+ 'Total tax, specified as a monetary amount. For example, `"3.99"`.'
618
601
  ).optional()
619
- }).describe("Order price.").optional()
620
- })
621
- ).optional()
622
- }),
623
- z.xor([
624
- z.object({
625
- subscription: z.never().optional(),
626
- singlePaymentForDuration: z.never().optional(),
627
- singlePaymentUnlimited: z.never().optional()
628
- }),
629
- z.object({
630
- singlePaymentForDuration: z.never().optional(),
631
- singlePaymentUnlimited: z.never().optional(),
632
- subscription: z.object({
633
- cycleDuration: z.object({
634
- count: z.number().int().describe(
635
- "Number of days, months, weeks, or years in a single payment cycle. Currently limited to support only `1`."
636
- ).min(1).optional().nullable(),
637
- unit: z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).describe("Unit of time for the cycle duration.").optional()
638
602
  }).describe(
639
- "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)."
640
604
  ).optional(),
641
- cycleCount: z.number().int().describe(
642
- "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."
643
- ).min(0).max(2e3).optional().nullable()
644
- }).describe(
645
- "Pricing model for an order with recurring payment cycles."
646
- )
647
- }),
648
- z.object({
649
- subscription: z.never().optional(),
650
- singlePaymentUnlimited: z.never().optional(),
651
- singlePaymentForDuration: z.object({
605
+ total: 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: 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: 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
+ z.xor([
619
+ z.object({
620
+ subscription: z.never().optional(),
621
+ singlePaymentForDuration: z.never().optional(),
622
+ singlePaymentUnlimited: z.never().optional()
623
+ }),
624
+ z.object({
625
+ singlePaymentForDuration: z.never().optional(),
626
+ singlePaymentUnlimited: z.never().optional(),
627
+ subscription: z.object({
628
+ cycleDuration: z.object({
652
629
  count: z.number().int().describe(
653
630
  "Number of days, months, weeks, or years in a single payment cycle. Currently limited to support only `1`."
654
631
  ).min(1).optional().nullable(),
655
632
  unit: z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).describe("Unit of time for the cycle duration.").optional()
656
633
  }).describe(
657
- "Pricing model for an order with a one-time payment and the order is valid for a specific amount of time."
658
- )
659
- }),
660
- z.object({
661
- subscription: z.never().optional(),
662
- singlePaymentForDuration: z.never().optional(),
663
- singlePaymentUnlimited: z.boolean().describe(
664
- "Pricing model for an order with a one-time payment and the order is valid until canceled."
665
- )
666
- })
667
- ])
668
- ).describe(
669
- "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)."
670
- ).optional(),
671
- type: z.enum(["UNDEFINED", "ONLINE", "OFFLINE", "EXTERNAL"]).describe("How the order was processed.").optional(),
672
- status: z.enum([
673
- "UNDEFINED",
674
- "DRAFT",
675
- "PENDING",
676
- "ACTIVE",
677
- "PAUSED",
678
- "ENDED",
679
- "CANCELED"
680
- ]).describe("Status of the order.").optional(),
681
- autoRenewCanceled: z.boolean().describe(
682
- "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."
683
- ).optional().nullable(),
684
- cancellation: z.object({
685
- requestedDate: z.date().describe("Date and time the cancellation was requested.").optional().nullable(),
686
- cause: z.enum([
687
- "UNDEFINED",
688
- "OWNER_ACTION",
689
- "MEMBER_ACTION",
690
- "PAYMENT_FAILURE",
691
- "PAYMENT_SETUP_FAILURE",
692
- "UNKNOWN"
693
- ]).describe("Reason for the cancellation.").optional(),
694
- effectiveAt: z.enum(["UNDEFINED", "IMMEDIATELY", "NEXT_PAYMENT_DATE"]).describe(
695
- "When the cancellation takes effect. Set when cancelling the order."
696
- ).optional()
697
- }).describe(
698
- "Details about the cancellation of an order.\n\nOnly present if the status is `CANCELED`."
699
- ).optional(),
700
- lastPaymentStatus: z.enum([
701
- "UNDEFINED",
702
- "PAID",
703
- "REFUNDED",
704
- "FAILED",
705
- "UNPAID",
706
- "PENDING",
707
- "NOT_APPLICABLE"
708
- ]).describe(
709
- "Status of the last payment for the order.\nUpdated automatically for online orders. Updated manually by the Wix user for offline orders."
710
- ).optional(),
711
- startDate: z.date().describe("Start date and time for the ordered plan.").optional().nullable(),
712
- endDate: z.date().describe(
713
- "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`."
714
- ).optional().nullable(),
715
- pausePeriods: 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: 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
+ }),
716
643
  z.object({
717
- status: z.enum(["UNDEFINED", "ACTIVE", "ENDED"]).describe("Status of the pause period.").optional(),
718
- pauseDate: z.date().describe("Start date and time of the pause period.").optional().nullable(),
719
- resumeDate: z.date().describe(
720
- "End date and time of the pause period.\n\nOmitted while the pause period remains `ACTIVE`."
721
- ).optional().nullable()
722
- })
723
- ).optional(),
724
- freeTrialDays: z.number().int().describe(
725
- "Free trial period for the order, in days.\n\nOnly available for recurring plans."
726
- ).min(1).max(999).optional().nullable(),
727
- earliestEndDate: z.date().describe(
728
- "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."
729
- ).optional().nullable(),
730
- currentCycle: z.object({
731
- index: z.number().int().describe(
732
- "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`."
733
- ).min(0).optional(),
734
- startedDate: z.date().describe("Start date and time for the current payment cycle.").optional().nullable(),
735
- endedDate: z.date().describe("End date and time for the current payment cycle.").optional().nullable()
736
- }).describe(
737
- "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."
738
- ).optional(),
739
- planName: z.string().describe("Plan name at the time of purchase.").optional(),
740
- planDescription: z.string().describe("Plan description at the time of purchase").optional(),
741
- planPrice: z.string().describe("Plan price as it was at the moment of order creation.").optional(),
742
- _createdDate: z.date().describe("Date and time the order was created.").optional().nullable(),
743
- _updatedDate: z.date().describe("Date and time the order was updated.").optional().nullable(),
744
- formData: z.object({
745
- formId: z.string().describe(
746
- "ID of the [order form](https://dev.wix.com/docs/rest/api-reference/wix-forms/form-submissions/introduction) associated with the plan at checkout."
747
- ).regex(
748
- /^[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}$/,
749
- "Must be a valid GUID"
750
- ).optional().nullable(),
751
- submissionId: z.string().describe(
752
- "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."
753
- ).regex(
754
- /^[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}$/,
755
- "Must be a valid GUID"
756
- ).optional().nullable(),
757
- submissionData: z.record(z.string(), z.any()).describe("Data submitted to the plan's order form at checkout.").optional()
758
- }).describe(
759
- "Information about the form submitted during the plan's checkout."
644
+ subscription: z.never().optional(),
645
+ singlePaymentUnlimited: z.never().optional(),
646
+ singlePaymentForDuration: z.object({
647
+ count: 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: 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
+ z.object({
656
+ subscription: z.never().optional(),
657
+ singlePaymentForDuration: z.never().optional(),
658
+ singlePaymentUnlimited: z.boolean().describe(
659
+ "Pricing model for an order with a one-time payment and the order is valid until canceled."
660
+ )
661
+ })
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: z.enum(["UNDEFINED", "ONLINE", "OFFLINE", "EXTERNAL"]).describe("How the order was processed.").optional(),
667
+ status: 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: 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: z.object({
680
+ requestedDate: z.date().describe("Date and time the cancellation was requested.").optional().nullable(),
681
+ cause: 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: z.enum(["UNDEFINED", "IMMEDIATELY", "NEXT_PAYMENT_DATE"]).describe(
690
+ "When the cancellation takes effect. Set when cancelling the order."
760
691
  ).optional()
761
- })
762
- ).optional(),
763
- pagingMetadata: z.object({
764
- count: z.number().int().describe("Number of items returned in the response.").optional().nullable(),
765
- offset: z.number().int().describe("Offset that was requested.").optional().nullable(),
766
- total: z.number().int().describe(
767
- "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: 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: z.date().describe("Start date and time for the ordered plan.").optional().nullable(),
707
+ endDate: 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`."
768
709
  ).optional().nullable(),
769
- tooManyToCount: z.boolean().describe(
770
- "Flag that indicates the server failed to calculate the `total` field."
710
+ pausePeriods: z.array(
711
+ z.object({
712
+ status: z.enum(["UNDEFINED", "ACTIVE", "ENDED"]).describe("Status of the pause period.").optional(),
713
+ pauseDate: z.date().describe("Start date and time of the pause period.").optional().nullable(),
714
+ resumeDate: 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: 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: 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."
771
724
  ).optional().nullable(),
772
- cursors: z.object({
773
- next: z.string().describe(
774
- "Cursor string pointing to the next page in the list of results."
775
- ).max(16e3).optional().nullable(),
776
- prev: z.string().describe(
777
- "Cursor pointing to the previous page in the list of results."
778
- ).max(16e3).optional().nullable()
725
+ currentCycle: z.object({
726
+ index: 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: z.date().describe("Start date and time for the current payment cycle.").optional().nullable(),
730
+ endedDate: z.date().describe("End date and time for the current payment cycle.").optional().nullable()
779
731
  }).describe(
780
- "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: z.string().describe("Plan name at the time of purchase.").optional(),
735
+ planDescription: z.string().describe("Plan description at the time of purchase").optional(),
736
+ planPrice: z.string().describe("Plan price as it was at the moment of order creation.").optional(),
737
+ _createdDate: z.date().describe("Date and time the order was created.").optional().nullable(),
738
+ _updatedDate: z.date().describe("Date and time the order was updated.").optional().nullable(),
739
+ formData: z.object({
740
+ formId: 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: 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: z.record(z.string(), 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."
781
755
  ).optional()
782
- }).describe(
783
- "Object containing paging-related data (number of orders returned, offset)."
784
- ).optional()
785
- });
786
- var RequestCancellationRequest = z.object({
787
- _id: z.string().describe("Order ID.").regex(
788
- /^[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}$/,
789
- "Must be a valid GUID"
790
- ),
791
- effectiveAt: z.enum(["UNDEFINED", "IMMEDIATELY", "NEXT_PAYMENT_DATE"])
756
+ }).describe("Order.").optional()
792
757
  });
793
- var RequestCancellationResponse = z.object({});
794
- var CreateOnlineOrderRequest = z.object({
758
+ var GetOnlineOrderPreviewRequest = z.object({
795
759
  planId: z.string().describe("Plan ID.").regex(
796
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}$/,
797
761
  "Must be a valid GUID"
798
762
  ),
799
763
  options: z.object({
800
764
  startDate: z.date().describe(
801
- "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."
802
766
  ).optional().nullable(),
803
- couponCode: z.string().describe("Coupon code to apply.").min(1).max(20).optional().nullable(),
804
- onBehalf: z.object({
805
- memberId: z.string().describe("Member ID.").regex(
806
- /^[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}$/,
807
- "Must be a valid GUID"
808
- ),
809
- orderMethod: z.enum(["UNKNOWN", "MOTO", "POS"]).optional()
810
- }).describe("Provided if checkout is initiated on buyer's behalf.").optional(),
811
- submissionId: z.string().describe("Submission ID of the form submitted with this order.").regex(
812
- /^[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}$/,
813
- "Must be a valid GUID"
814
- ).optional().nullable()
767
+ couponCode: z.string().describe("Coupon code to apply.").min(1).max(20).optional().nullable()
815
768
  }).optional()
816
769
  });
817
- var CreateOnlineOrderResponse = z.object({
770
+ var GetOnlineOrderPreviewResponse = z.object({
818
771
  order: z.object({
819
772
  _id: z.string().describe("Order ID.").regex(
820
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}$/,
@@ -1135,30 +1088,32 @@ var CreateOnlineOrderResponse = z.object({
1135
1088
  }).describe(
1136
1089
  "Information about the form submitted during the plan's checkout."
1137
1090
  ).optional()
1138
- }).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: z.boolean().describe(
1095
+ "Whether the member has already reached purchase limit for the order's plan."
1096
+ ).optional()
1139
1097
  });
1140
- var CreateOfflineOrderRequest = z.object({
1141
- planId: z.string().describe("ID of the plan being ordered, from the Plans API.").regex(
1098
+ var GetOfflineOrderPreviewRequest = z.object({
1099
+ planId: z.string().describe("ID of the plan of the previewed order.").regex(
1142
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}$/,
1143
1101
  "Must be a valid GUID"
1144
1102
  ),
1145
- memberId: z.string().describe("ID of the member ordering the plan, from the Members API.").regex(
1103
+ memberId: z.string().describe(
1104
+ "Member ID of the buyer the previewed order is for, from the Members API."
1105
+ ).regex(
1146
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}$/,
1147
1107
  "Must be a valid GUID"
1148
1108
  ),
1149
1109
  options: z.object({
1150
1110
  startDate: z.date().describe(
1151
- "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."
1152
1112
  ).optional().nullable(),
1153
- paid: z.boolean().describe("Whether the order is paid.\n\nDefault: `false`").optional().nullable(),
1154
- couponCode: z.string().describe("Coupon code to apply, from the Coupons API.").min(1).max(20).optional().nullable(),
1155
- submissionId: z.string().describe("Form submission ID that was submitted with the order.").regex(
1156
- /^[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}$/,
1157
- "Must be a valid GUID"
1158
- ).optional().nullable()
1159
- }).describe("Options for creating an offline order. ").optional()
1113
+ couponCode: 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()
1160
1115
  });
1161
- var CreateOfflineOrderResponse = z.object({
1116
+ var GetOfflineOrderPreviewResponse = z.object({
1162
1117
  order: z.object({
1163
1118
  _id: z.string().describe("Order ID.").regex(
1164
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}$/,
@@ -1479,43 +1434,188 @@ var CreateOfflineOrderResponse = z.object({
1479
1434
  }).describe(
1480
1435
  "Information about the form submitted during the plan's checkout."
1481
1436
  ).optional()
1482
- }).describe("Order.").optional()
1437
+ }).describe("The previewed order, as if the plan had been ordered.").optional(),
1438
+ purchaseLimitExceeded: 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()
1483
1441
  });
1484
- var GetOnlineOrderPreviewRequest = z.object({
1485
- planId: z.string().describe("Plan ID.").regex(
1442
+ var GetPricePreviewRequest = z.object({
1443
+ planId: z.string().describe("ID of plan to preview.").regex(
1486
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}$/,
1487
1445
  "Must be a valid GUID"
1488
1446
  ),
1489
1447
  options: z.object({
1490
- startDate: z.date().describe(
1491
- "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."
1492
- ).optional().nullable(),
1493
- couponCode: z.string().describe("Coupon code to apply.").min(1).max(20).optional().nullable()
1494
- }).optional()
1448
+ couponCode: 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()
1495
1450
  });
1496
- var GetOnlineOrderPreviewResponse = z.object({
1497
- order: z.object({
1498
- _id: z.string().describe("Order ID.").regex(
1499
- /^[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}$/,
1500
- "Must be a valid GUID"
1501
- ).optional(),
1502
- planId: z.string().describe(
1503
- "ID of the plan purchased with the order, from the Plans API."
1504
- ).regex(
1505
- /^[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}$/,
1506
- "Must be a valid GUID"
1507
- ).optional(),
1508
- subscriptionId: z.string().describe(
1509
- "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)."
1510
- ).regex(
1511
- /^[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}$/,
1512
- "Must be a valid GUID"
1513
- ).optional(),
1514
- wixPayOrderId: z.string().describe(
1515
- "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."
1516
- ).regex(
1517
- /^[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}$/,
1518
- "Must be a valid GUID"
1451
+ var GetPricePreviewResponse = z.object({
1452
+ price: z.intersection(
1453
+ z.object({
1454
+ subtotal: z.string().describe(
1455
+ 'Price of the order excluding tax, specified as a monetary amount. for example, `"9.99"`.'
1456
+ ).optional(),
1457
+ discount: z.string().describe("Total discount applied.").optional(),
1458
+ tax: z.object({
1459
+ name: z.string().describe("Name of the tax. For example, VAT.").optional(),
1460
+ includedInPrice: z.boolean().describe(
1461
+ "Whether tax is included in the original price. When `false`, tax is added at checkout."
1462
+ ).optional(),
1463
+ rate: 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: z.string().describe(
1467
+ 'Total tax, specified as a monetary amount. For example, `"3.99"`.'
1468
+ ).optional()
1469
+ }).describe("Tax applied.").optional(),
1470
+ total: 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: z.string().describe("Plan price as it was at the moment of order creation.").optional(),
1474
+ currency: z.string().describe(
1475
+ "Currency code. Must be valid ISO 4217 currency code (e.g., USD)."
1476
+ ).optional(),
1477
+ freeTrialDays: 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: z.object({
1481
+ code: z.string().describe("Code of the applied coupon.").min(1).max(20).optional(),
1482
+ amount: z.string().describe("Total discount of the coupon, as a monetary amount.").optional(),
1483
+ _id: 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
+ z.xor([
1492
+ z.object({
1493
+ subscription: z.never().optional(),
1494
+ singlePaymentForDuration: z.never().optional(),
1495
+ singlePaymentUnlimited: z.never().optional()
1496
+ }),
1497
+ z.object({
1498
+ singlePaymentForDuration: z.never().optional(),
1499
+ singlePaymentUnlimited: z.never().optional(),
1500
+ subscription: z.object({
1501
+ cycleDuration: z.object({
1502
+ count: 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: 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: 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
+ z.object({
1515
+ subscription: z.never().optional(),
1516
+ singlePaymentUnlimited: z.never().optional(),
1517
+ singlePaymentForDuration: z.object({
1518
+ count: 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: 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
+ z.object({
1527
+ subscription: z.never().optional(),
1528
+ singlePaymentForDuration: z.never().optional(),
1529
+ singlePaymentUnlimited: 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: z.array(
1536
+ z.object({
1537
+ duration: z.object({
1538
+ cycleFrom: 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: 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: z.object({
1548
+ subtotal: z.string().describe(
1549
+ 'Price of the order excluding tax, specified as a monetary amount. For example, `"9.99"`.'
1550
+ ).optional(),
1551
+ coupon: z.object({
1552
+ code: z.string().describe("Code of the applied coupon.").min(1).max(20).optional(),
1553
+ amount: z.string().describe(
1554
+ "Total discount of the coupon, as a monetary amount."
1555
+ ).optional(),
1556
+ _id: 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: z.string().describe("Total discount applied to the order.").optional(),
1562
+ tax: z.object({
1563
+ name: z.string().describe("Name of the tax. For example, VAT.").optional(),
1564
+ includedInPrice: z.boolean().describe(
1565
+ "Whether tax is included in the original price. When `false`, tax is added at checkout."
1566
+ ).optional(),
1567
+ rate: 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: 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: 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: 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: 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 = z.object({
1590
+ _id: 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: z.object({ fieldSet: z.enum(["UNKNOWN_SET", "BASIC", "FULL"]).optional() }).describe("Options to use when getting an order. ").optional()
1595
+ });
1596
+ var ManagementGetOrderResponse = z.object({
1597
+ order: z.object({
1598
+ _id: z.string().describe("Order ID.").regex(
1599
+ /^[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}$/,
1600
+ "Must be a valid GUID"
1601
+ ).optional(),
1602
+ planId: z.string().describe(
1603
+ "ID of the plan purchased with the order, from the Plans API."
1604
+ ).regex(
1605
+ /^[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}$/,
1606
+ "Must be a valid GUID"
1607
+ ).optional(),
1608
+ subscriptionId: z.string().describe(
1609
+ "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)."
1610
+ ).regex(
1611
+ /^[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}$/,
1612
+ "Must be a valid GUID"
1613
+ ).optional(),
1614
+ wixPayOrderId: z.string().describe(
1615
+ "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."
1616
+ ).regex(
1617
+ /^[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}$/,
1618
+ "Must be a valid GUID"
1519
1619
  ).optional().nullable(),
1520
1620
  buyer: z.object({
1521
1621
  memberId: z.string().describe("Member ID for a Wix site member, from the Members API.").regex(
@@ -1814,512 +1914,454 @@ var GetOnlineOrderPreviewResponse = z.object({
1814
1914
  }).describe(
1815
1915
  "Information about the form submitted during the plan's checkout."
1816
1916
  ).optional()
1817
- }).describe(
1818
- "Order preview. This field is undefined if the member has already reached the purchase limit for the order's plan."
1819
- ).optional(),
1820
- purchaseLimitExceeded: z.boolean().describe(
1821
- "Whether the member has already reached purchase limit for the order's plan."
1822
- ).optional()
1917
+ }).describe("Order.").optional()
1823
1918
  });
1824
- var GetOfflineOrderPreviewRequest = z.object({
1825
- planId: z.string().describe("ID of the plan of the previewed order.").regex(
1826
- /^[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}$/,
1827
- "Must be a valid GUID"
1828
- ),
1829
- memberId: z.string().describe(
1830
- "Member ID of the buyer the previewed order is for, from the Members API."
1831
- ).regex(
1832
- /^[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}$/,
1833
- "Must be a valid GUID"
1834
- ),
1919
+ var ManagementListOrdersRequest = z.object({
1835
1920
  options: z.object({
1836
- startDate: z.date().describe(
1837
- "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."
1921
+ buyerIds: z.array(z.string()).optional(),
1922
+ planIds: z.array(z.string()).optional(),
1923
+ autoRenewCanceled: z.boolean().describe(
1924
+ "Filter by whether or not the auto-renewal of recurring orders was canceled."
1838
1925
  ).optional().nullable(),
1839
- couponCode: z.string().describe("Coupon code to apply, from the Coupons API.").min(1).max(20).optional().nullable()
1840
- }).describe("Options for previewing the offline order. ").optional()
1841
- });
1842
- var GetOfflineOrderPreviewResponse = z.object({
1843
- order: z.object({
1844
- _id: z.string().describe("Order ID.").regex(
1845
- /^[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}$/,
1846
- "Must be a valid GUID"
1926
+ orderStatuses: z.array(
1927
+ z.enum([
1928
+ "UNDEFINED",
1929
+ "DRAFT",
1930
+ "PENDING",
1931
+ "ACTIVE",
1932
+ "PAUSED",
1933
+ "ENDED",
1934
+ "CANCELED"
1935
+ ])
1847
1936
  ).optional(),
1848
- planId: z.string().describe(
1849
- "ID of the plan purchased with the order, from the Plans API."
1850
- ).regex(
1851
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1852
- "Must be a valid GUID"
1937
+ paymentStatuses: z.array(
1938
+ z.enum([
1939
+ "UNDEFINED",
1940
+ "PAID",
1941
+ "REFUNDED",
1942
+ "FAILED",
1943
+ "UNPAID",
1944
+ "PENDING",
1945
+ "NOT_APPLICABLE"
1946
+ ])
1853
1947
  ).optional(),
1854
- subscriptionId: z.string().describe(
1855
- "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)."
1856
- ).regex(
1857
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1858
- "Must be a valid GUID"
1948
+ limit: z.number().int().describe(
1949
+ "Number of orders to return. See Sorting and Paging for more information.\n\nMax: `50`"
1950
+ ).min(1).max(50).optional().nullable(),
1951
+ offset: z.number().int().describe("Number of orders to skip in the current sort order.").min(0).optional().nullable(),
1952
+ sorting: z.object({
1953
+ fieldName: z.string().describe("Name of the field to sort by.").max(512).optional(),
1954
+ order: z.enum(["ASC", "DESC"]).optional(),
1955
+ origin: z.object({
1956
+ latitude: z.number().describe("Address latitude.").optional().nullable(),
1957
+ longitude: z.number().describe("Address longitude.").optional().nullable()
1958
+ }).describe(
1959
+ "Origin point for geo-distance sorting on a GEO field\nresults are ordered by distance from this point (ASC = nearest first, DESC = farthest first)."
1960
+ ).optional()
1961
+ }).describe(
1962
+ "Sort order.\n\nUse `ASC` for ascending order or `DESC` for descending order.\n\nDefault: `DESC`."
1859
1963
  ).optional(),
1860
- wixPayOrderId: z.string().describe(
1861
- "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."
1862
- ).regex(
1863
- /^[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}$/,
1864
- "Must be a valid GUID"
1865
- ).optional().nullable(),
1866
- buyer: z.object({
1867
- memberId: z.string().describe("Member ID for a Wix site member, from the Members API.").regex(
1964
+ fieldSet: z.enum(["UNKNOWN_SET", "BASIC", "FULL"]).optional()
1965
+ }).describe("Filtering, sorting, and pagination options. ").optional()
1966
+ });
1967
+ var ManagementListOrdersResponse = z.object({
1968
+ orders: z.array(
1969
+ z.object({
1970
+ _id: z.string().describe("Order ID.").regex(
1868
1971
  /^[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}$/,
1869
1972
  "Must be a valid GUID"
1870
1973
  ).optional(),
1871
- contactId: z.string().describe(
1872
- "Contact ID for a Wix site contact, from the Contacts API."
1974
+ planId: z.string().describe(
1975
+ "ID of the plan purchased with the order, from the Plans API."
1873
1976
  ).regex(
1874
1977
  /^[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
1978
  "Must be a valid GUID"
1876
- ).optional()
1877
- }).describe(
1878
- "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`."
1879
- ).optional(),
1880
- priceDetails: z.intersection(
1881
- z.object({
1882
- subtotal: z.string().describe(
1883
- 'Price of the order excluding tax, specified as a monetary amount. for example, `"9.99"`.'
1979
+ ).optional(),
1980
+ subscriptionId: z.string().describe(
1981
+ "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)."
1982
+ ).regex(
1983
+ /^[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}$/,
1984
+ "Must be a valid GUID"
1985
+ ).optional(),
1986
+ wixPayOrderId: z.string().describe(
1987
+ "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."
1988
+ ).regex(
1989
+ /^[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}$/,
1990
+ "Must be a valid GUID"
1991
+ ).optional().nullable(),
1992
+ buyer: z.object({
1993
+ memberId: z.string().describe(
1994
+ "Member ID for a Wix site member, from the Members API."
1995
+ ).regex(
1996
+ /^[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}$/,
1997
+ "Must be a valid GUID"
1884
1998
  ).optional(),
1885
- discount: z.string().describe("Total discount applied.").optional(),
1886
- tax: z.object({
1887
- name: z.string().describe("Name of the tax. For example, VAT.").optional(),
1888
- includedInPrice: z.boolean().describe(
1889
- "Whether tax is included in the original price. When `false`, tax is added at checkout."
1999
+ contactId: z.string().describe(
2000
+ "Contact ID for a Wix site contact, from the Contacts API."
2001
+ ).regex(
2002
+ /^[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}$/,
2003
+ "Must be a valid GUID"
2004
+ ).optional()
2005
+ }).describe(
2006
+ "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`."
2007
+ ).optional(),
2008
+ priceDetails: z.intersection(
2009
+ z.object({
2010
+ subtotal: z.string().describe(
2011
+ 'Price of the order excluding tax, specified as a monetary amount. for example, `"9.99"`.'
1890
2012
  ).optional(),
1891
- rate: z.string().describe(
1892
- 'Tax rate percentage, as a number between 0 and 100. For example, a 7% tax rate is `"7.00"`.'
2013
+ discount: z.string().describe("Total discount applied.").optional(),
2014
+ tax: z.object({
2015
+ name: z.string().describe("Name of the tax. For example, VAT.").optional(),
2016
+ includedInPrice: z.boolean().describe(
2017
+ "Whether tax is included in the original price. When `false`, tax is added at checkout."
2018
+ ).optional(),
2019
+ rate: z.string().describe(
2020
+ 'Tax rate percentage, as a number between 0 and 100. For example, a 7% tax rate is `"7.00"`.'
2021
+ ).optional(),
2022
+ amount: z.string().describe(
2023
+ 'Total tax, specified as a monetary amount. For example, `"3.99"`.'
2024
+ ).optional()
2025
+ }).describe("Tax applied.").optional(),
2026
+ total: z.string().describe(
2027
+ '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`.'
1893
2028
  ).optional(),
1894
- amount: z.string().describe(
1895
- 'Total tax, specified as a monetary amount. For example, `"3.99"`.'
1896
- ).optional()
1897
- }).describe("Tax applied.").optional(),
1898
- total: z.string().describe(
1899
- '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`.'
1900
- ).optional(),
1901
- planPrice: z.string().describe("Plan price as it was at the moment of order creation.").optional(),
1902
- currency: z.string().describe(
1903
- "Currency code. Must be valid ISO 4217 currency code (e.g., USD)."
1904
- ).optional(),
1905
- freeTrialDays: z.number().int().describe(
1906
- "Free trial period for the order in days. Only available for recurring plans."
1907
- ).min(1).max(999).optional().nullable(),
1908
- coupon: z.object({
1909
- code: z.string().describe("Code of the applied coupon.").min(1).max(20).optional(),
1910
- amount: z.string().describe(
1911
- "Total discount of the coupon, as a monetary amount."
2029
+ planPrice: z.string().describe(
2030
+ "Plan price as it was at the moment of order creation."
1912
2031
  ).optional(),
1913
- _id: z.string().describe("Coupon ID.").regex(
1914
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1915
- "Must be a valid GUID"
2032
+ currency: z.string().describe(
2033
+ "Currency code. Must be valid ISO 4217 currency code (e.g., USD)."
2034
+ ).optional(),
2035
+ freeTrialDays: z.number().int().describe(
2036
+ "Free trial period for the order in days. Only available for recurring plans."
2037
+ ).min(1).max(999).optional().nullable(),
2038
+ coupon: z.object({
2039
+ code: z.string().describe("Code of the applied coupon.").min(1).max(20).optional(),
2040
+ amount: z.string().describe(
2041
+ "Total discount of the coupon, as a monetary amount."
2042
+ ).optional(),
2043
+ _id: z.string().describe("Coupon ID.").regex(
2044
+ /^[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}$/,
2045
+ "Must be a valid GUID"
2046
+ ).optional()
2047
+ }).describe(
2048
+ "Coupon applied to the order. Empty means no coupon was applied."
1916
2049
  ).optional()
1917
- }).describe(
1918
- "Coupon applied to the order. Empty means no coupon was applied."
1919
- ).optional()
1920
- }),
1921
- z.xor([
1922
- z.object({
1923
- subscription: z.never().optional(),
1924
- singlePaymentForDuration: z.never().optional(),
1925
- singlePaymentUnlimited: z.never().optional()
1926
2050
  }),
1927
- z.object({
1928
- singlePaymentForDuration: z.never().optional(),
1929
- singlePaymentUnlimited: z.never().optional(),
1930
- subscription: z.object({
1931
- cycleDuration: z.object({
2051
+ z.xor([
2052
+ z.object({
2053
+ subscription: z.never().optional(),
2054
+ singlePaymentForDuration: z.never().optional(),
2055
+ singlePaymentUnlimited: z.never().optional()
2056
+ }),
2057
+ z.object({
2058
+ singlePaymentForDuration: z.never().optional(),
2059
+ singlePaymentUnlimited: z.never().optional(),
2060
+ subscription: z.object({
2061
+ cycleDuration: z.object({
2062
+ count: z.number().int().describe(
2063
+ "Number of days, months, weeks, or years in a single payment cycle. Currently limited to support only `1`."
2064
+ ).min(1).optional().nullable(),
2065
+ unit: z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).describe("Unit of time for the cycle duration.").optional()
2066
+ }).describe(
2067
+ "Number of payment cycles the subscription is valid for.\n`0` for unlimited plans or for plans that are valid until canceled."
2068
+ ).optional(),
2069
+ cycleCount: z.number().int().describe(
2070
+ "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."
2071
+ ).min(0).max(2e3).optional().nullable()
2072
+ }).describe("Order has recurring payments.")
2073
+ }),
2074
+ z.object({
2075
+ subscription: z.never().optional(),
2076
+ singlePaymentUnlimited: z.never().optional(),
2077
+ singlePaymentForDuration: z.object({
1932
2078
  count: z.number().int().describe(
1933
2079
  "Number of days, months, weeks, or years in a single payment cycle. Currently limited to support only `1`."
1934
2080
  ).min(1).optional().nullable(),
1935
2081
  unit: z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).describe("Unit of time for the cycle duration.").optional()
1936
2082
  }).describe(
1937
- "Number of payment cycles the subscription is valid for.\n`0` for unlimited plans or for plans that are valid until canceled."
1938
- ).optional(),
1939
- cycleCount: z.number().int().describe(
1940
- "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."
1941
- ).min(0).max(2e3).optional().nullable()
1942
- }).describe("Order has recurring payments.")
1943
- }),
1944
- z.object({
1945
- subscription: z.never().optional(),
1946
- singlePaymentUnlimited: z.never().optional(),
1947
- singlePaymentForDuration: z.object({
1948
- count: z.number().int().describe(
1949
- "Number of days, months, weeks, or years in a single payment cycle. Currently limited to support only `1`."
1950
- ).min(1).optional().nullable(),
1951
- unit: z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).describe("Unit of time for the cycle duration.").optional()
1952
- }).describe(
1953
- "One-time payment. Order is valid for a specified duration."
1954
- )
1955
- }),
1956
- z.object({
1957
- subscription: z.never().optional(),
1958
- singlePaymentForDuration: z.never().optional(),
1959
- singlePaymentUnlimited: z.boolean().describe(
1960
- "One-time payment. Order is valid until it is canceled."
1961
- )
1962
- })
1963
- ])
1964
- ).describe(
1965
- "__Deprecated.__ Use `pricing` instead. This property will be removed on September 30, 2022."
1966
- ).optional(),
1967
- pricing: z.intersection(
1968
- z.object({
1969
- prices: z.array(
2083
+ "One-time payment. Order is valid for a specified duration."
2084
+ )
2085
+ }),
1970
2086
  z.object({
1971
- duration: z.object({
1972
- cycleFrom: z.number().int().describe(
1973
- "Price starts to apply with this cycle.\n\n`1` is the first payment cycle for all pricing models."
1974
- ).optional(),
1975
- numberOfCycles: z.number().int().describe(
1976
- "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`."
1977
- ).optional().nullable()
1978
- }).describe(
1979
- "Cycle duration to apply `price` for.\n\nUse with all pricing models.\nCan apply the same price to multiple payment cycles."
1980
- ).optional(),
1981
- price: z.object({
1982
- subtotal: z.string().describe(
1983
- 'Price of the order excluding tax, specified as a monetary amount. For example, `"9.99"`.'
1984
- ).optional(),
1985
- coupon: z.object({
1986
- code: z.string().describe("Code of the applied coupon.").min(1).max(20).optional(),
1987
- amount: z.string().describe(
1988
- "Total discount of the coupon, as a monetary amount."
2087
+ subscription: z.never().optional(),
2088
+ singlePaymentForDuration: z.never().optional(),
2089
+ singlePaymentUnlimited: z.boolean().describe(
2090
+ "One-time payment. Order is valid until it is canceled."
2091
+ )
2092
+ })
2093
+ ])
2094
+ ).describe(
2095
+ "__Deprecated.__ Use `pricing` instead. This property will be removed on September 30, 2022."
2096
+ ).optional(),
2097
+ pricing: z.intersection(
2098
+ z.object({
2099
+ prices: z.array(
2100
+ z.object({
2101
+ duration: z.object({
2102
+ cycleFrom: z.number().int().describe(
2103
+ "Price starts to apply with this cycle.\n\n`1` is the first payment cycle for all pricing models."
1989
2104
  ).optional(),
1990
- _id: z.string().describe("Coupon ID.").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()
2105
+ numberOfCycles: z.number().int().describe(
2106
+ "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`."
2107
+ ).optional().nullable()
1994
2108
  }).describe(
1995
- "Coupon applied to the order, from the Coupons API."
2109
+ "Cycle duration to apply `price` for.\n\nUse with all pricing models.\nCan apply the same price to multiple payment cycles."
1996
2110
  ).optional(),
1997
- discount: z.string().describe("Total discount applied to the order.").optional(),
1998
- tax: z.object({
1999
- name: z.string().describe("Name of the tax. For example, VAT.").optional(),
2000
- includedInPrice: z.boolean().describe(
2001
- "Whether tax is included in the original price. When `false`, tax is added at checkout."
2111
+ price: z.object({
2112
+ subtotal: z.string().describe(
2113
+ 'Price of the order excluding tax, specified as a monetary amount. For example, `"9.99"`.'
2002
2114
  ).optional(),
2003
- rate: z.string().describe(
2004
- 'Tax rate percentage, as a number between 0 and 100. For example, a 7% tax rate is `"7.00"`.'
2115
+ coupon: z.object({
2116
+ code: z.string().describe("Code of the applied coupon.").min(1).max(20).optional(),
2117
+ amount: z.string().describe(
2118
+ "Total discount of the coupon, as a monetary amount."
2119
+ ).optional(),
2120
+ _id: z.string().describe("Coupon ID.").regex(
2121
+ /^[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}$/,
2122
+ "Must be a valid GUID"
2123
+ ).optional()
2124
+ }).describe(
2125
+ "Coupon applied to the order, from the Coupons API."
2005
2126
  ).optional(),
2006
- amount: z.string().describe(
2007
- 'Total tax, specified as a monetary amount. For example, `"3.99"`.'
2008
- ).optional()
2009
- }).describe(
2010
- "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)."
2011
- ).optional(),
2012
- total: z.string().describe(
2013
- '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`.'
2014
- ).optional(),
2015
- currency: z.string().describe(
2016
- "Three-letter currency code in\n[ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format."
2017
- ).optional(),
2018
- proration: z.string().describe(
2019
- "Price change after billing date was change and price was adjusted. Could be positive and negative values."
2020
- ).optional()
2021
- }).describe("Order price.").optional()
2022
- })
2023
- ).optional()
2024
- }),
2025
- z.xor([
2026
- z.object({
2027
- subscription: z.never().optional(),
2028
- singlePaymentForDuration: z.never().optional(),
2029
- singlePaymentUnlimited: z.never().optional()
2127
+ discount: z.string().describe("Total discount applied to the order.").optional(),
2128
+ tax: z.object({
2129
+ name: z.string().describe("Name of the tax. For example, VAT.").optional(),
2130
+ includedInPrice: z.boolean().describe(
2131
+ "Whether tax is included in the original price. When `false`, tax is added at checkout."
2132
+ ).optional(),
2133
+ rate: z.string().describe(
2134
+ 'Tax rate percentage, as a number between 0 and 100. For example, a 7% tax rate is `"7.00"`.'
2135
+ ).optional(),
2136
+ amount: z.string().describe(
2137
+ 'Total tax, specified as a monetary amount. For example, `"3.99"`.'
2138
+ ).optional()
2139
+ }).describe(
2140
+ "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)."
2141
+ ).optional(),
2142
+ total: z.string().describe(
2143
+ '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`.'
2144
+ ).optional(),
2145
+ currency: z.string().describe(
2146
+ "Three-letter currency code in\n[ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format."
2147
+ ).optional(),
2148
+ proration: z.string().describe(
2149
+ "Price change after billing date was change and price was adjusted. Could be positive and negative values."
2150
+ ).optional()
2151
+ }).describe("Order price.").optional()
2152
+ })
2153
+ ).optional()
2030
2154
  }),
2031
- z.object({
2032
- singlePaymentForDuration: z.never().optional(),
2033
- singlePaymentUnlimited: z.never().optional(),
2034
- subscription: z.object({
2035
- cycleDuration: z.object({
2155
+ z.xor([
2156
+ z.object({
2157
+ subscription: z.never().optional(),
2158
+ singlePaymentForDuration: z.never().optional(),
2159
+ singlePaymentUnlimited: z.never().optional()
2160
+ }),
2161
+ z.object({
2162
+ singlePaymentForDuration: z.never().optional(),
2163
+ singlePaymentUnlimited: z.never().optional(),
2164
+ subscription: z.object({
2165
+ cycleDuration: z.object({
2166
+ count: z.number().int().describe(
2167
+ "Number of days, months, weeks, or years in a single payment cycle. Currently limited to support only `1`."
2168
+ ).min(1).optional().nullable(),
2169
+ unit: z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).describe("Unit of time for the cycle duration.").optional()
2170
+ }).describe(
2171
+ "Number of payment cycles the subscription is valid for.\n`0` for unlimited plans or for plans that are valid until canceled."
2172
+ ).optional(),
2173
+ cycleCount: z.number().int().describe(
2174
+ "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."
2175
+ ).min(0).max(2e3).optional().nullable()
2176
+ }).describe(
2177
+ "Pricing model for an order with recurring payment cycles."
2178
+ )
2179
+ }),
2180
+ z.object({
2181
+ subscription: z.never().optional(),
2182
+ singlePaymentUnlimited: z.never().optional(),
2183
+ singlePaymentForDuration: z.object({
2036
2184
  count: z.number().int().describe(
2037
2185
  "Number of days, months, weeks, or years in a single payment cycle. Currently limited to support only `1`."
2038
2186
  ).min(1).optional().nullable(),
2039
2187
  unit: z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).describe("Unit of time for the cycle duration.").optional()
2040
2188
  }).describe(
2041
- "Number of payment cycles the subscription is valid for.\n`0` for unlimited plans or for plans that are valid until canceled."
2042
- ).optional(),
2043
- cycleCount: z.number().int().describe(
2044
- "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."
2045
- ).min(0).max(2e3).optional().nullable()
2046
- }).describe(
2047
- "Pricing model for an order with recurring payment cycles."
2048
- )
2049
- }),
2050
- z.object({
2051
- subscription: z.never().optional(),
2052
- singlePaymentUnlimited: z.never().optional(),
2053
- singlePaymentForDuration: z.object({
2054
- count: z.number().int().describe(
2055
- "Number of days, months, weeks, or years in a single payment cycle. Currently limited to support only `1`."
2056
- ).min(1).optional().nullable(),
2057
- unit: z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).describe("Unit of time for the cycle duration.").optional()
2058
- }).describe(
2059
- "Pricing model for an order with a one-time payment and the order is valid for a specific amount of time."
2060
- )
2061
- }),
2062
- z.object({
2063
- subscription: z.never().optional(),
2064
- singlePaymentForDuration: z.never().optional(),
2065
- singlePaymentUnlimited: z.boolean().describe(
2066
- "Pricing model for an order with a one-time payment and the order is valid until canceled."
2067
- )
2068
- })
2069
- ])
2070
- ).describe(
2071
- "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)."
2072
- ).optional(),
2073
- type: z.enum(["UNDEFINED", "ONLINE", "OFFLINE", "EXTERNAL"]).describe("How the order was processed.").optional(),
2074
- status: z.enum([
2075
- "UNDEFINED",
2076
- "DRAFT",
2077
- "PENDING",
2078
- "ACTIVE",
2079
- "PAUSED",
2080
- "ENDED",
2081
- "CANCELED"
2082
- ]).describe("Status of the order.").optional(),
2083
- autoRenewCanceled: z.boolean().describe(
2084
- "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."
2085
- ).optional().nullable(),
2086
- cancellation: z.object({
2087
- requestedDate: z.date().describe("Date and time the cancellation was requested.").optional().nullable(),
2088
- cause: z.enum([
2189
+ "Pricing model for an order with a one-time payment and the order is valid for a specific amount of time."
2190
+ )
2191
+ }),
2192
+ z.object({
2193
+ subscription: z.never().optional(),
2194
+ singlePaymentForDuration: z.never().optional(),
2195
+ singlePaymentUnlimited: z.boolean().describe(
2196
+ "Pricing model for an order with a one-time payment and the order is valid until canceled."
2197
+ )
2198
+ })
2199
+ ])
2200
+ ).describe(
2201
+ "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)."
2202
+ ).optional(),
2203
+ type: z.enum(["UNDEFINED", "ONLINE", "OFFLINE", "EXTERNAL"]).describe("How the order was processed.").optional(),
2204
+ status: z.enum([
2089
2205
  "UNDEFINED",
2090
- "OWNER_ACTION",
2091
- "MEMBER_ACTION",
2092
- "PAYMENT_FAILURE",
2093
- "PAYMENT_SETUP_FAILURE",
2094
- "UNKNOWN"
2095
- ]).describe("Reason for the cancellation.").optional(),
2096
- effectiveAt: z.enum(["UNDEFINED", "IMMEDIATELY", "NEXT_PAYMENT_DATE"]).describe(
2097
- "When the cancellation takes effect. Set when cancelling the order."
2098
- ).optional()
2099
- }).describe(
2100
- "Details about the cancellation of an order.\n\nOnly present if the status is `CANCELED`."
2101
- ).optional(),
2102
- lastPaymentStatus: z.enum([
2103
- "UNDEFINED",
2104
- "PAID",
2105
- "REFUNDED",
2106
- "FAILED",
2107
- "UNPAID",
2108
- "PENDING",
2109
- "NOT_APPLICABLE"
2110
- ]).describe(
2111
- "Status of the last payment for the order.\nUpdated automatically for online orders. Updated manually by the Wix user for offline orders."
2112
- ).optional(),
2113
- startDate: z.date().describe("Start date and time for the ordered plan.").optional().nullable(),
2114
- endDate: z.date().describe(
2115
- "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`."
2116
- ).optional().nullable(),
2117
- pausePeriods: z.array(
2118
- z.object({
2119
- status: z.enum(["UNDEFINED", "ACTIVE", "ENDED"]).describe("Status of the pause period.").optional(),
2120
- pauseDate: z.date().describe("Start date and time of the pause period.").optional().nullable(),
2121
- resumeDate: z.date().describe(
2122
- "End date and time of the pause period.\n\nOmitted while the pause period remains `ACTIVE`."
2123
- ).optional().nullable()
2124
- })
2125
- ).optional(),
2126
- freeTrialDays: z.number().int().describe(
2127
- "Free trial period for the order, in days.\n\nOnly available for recurring plans."
2128
- ).min(1).max(999).optional().nullable(),
2129
- earliestEndDate: z.date().describe(
2130
- "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."
2131
- ).optional().nullable(),
2132
- currentCycle: z.object({
2133
- index: z.number().int().describe(
2134
- "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`."
2135
- ).min(0).optional(),
2136
- startedDate: z.date().describe("Start date and time for the current payment cycle.").optional().nullable(),
2137
- endedDate: z.date().describe("End date and time for the current payment cycle.").optional().nullable()
2138
- }).describe(
2139
- "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."
2140
- ).optional(),
2141
- planName: z.string().describe("Plan name at the time of purchase.").optional(),
2142
- planDescription: z.string().describe("Plan description at the time of purchase").optional(),
2143
- planPrice: z.string().describe("Plan price as it was at the moment of order creation.").optional(),
2144
- _createdDate: z.date().describe("Date and time the order was created.").optional().nullable(),
2145
- _updatedDate: z.date().describe("Date and time the order was updated.").optional().nullable(),
2146
- formData: z.object({
2147
- formId: z.string().describe(
2148
- "ID of the [order form](https://dev.wix.com/docs/rest/api-reference/wix-forms/form-submissions/introduction) associated with the plan at checkout."
2149
- ).regex(
2150
- /^[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}$/,
2151
- "Must be a valid GUID"
2152
- ).optional().nullable(),
2153
- submissionId: z.string().describe(
2154
- "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."
2155
- ).regex(
2156
- /^[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}$/,
2157
- "Must be a valid GUID"
2206
+ "DRAFT",
2207
+ "PENDING",
2208
+ "ACTIVE",
2209
+ "PAUSED",
2210
+ "ENDED",
2211
+ "CANCELED"
2212
+ ]).describe("Status of the order.").optional(),
2213
+ autoRenewCanceled: z.boolean().describe(
2214
+ "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."
2158
2215
  ).optional().nullable(),
2159
- submissionData: z.record(z.string(), z.any()).describe("Data submitted to the plan's order form at checkout.").optional()
2160
- }).describe(
2161
- "Information about the form submitted during the plan's checkout."
2162
- ).optional()
2163
- }).describe("The previewed order, as if the plan had been ordered.").optional(),
2164
- purchaseLimitExceeded: z.boolean().describe(
2165
- "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."
2166
- ).optional()
2167
- });
2168
- var GetPricePreviewRequest = z.object({
2169
- planId: z.string().describe("ID of plan to preview.").regex(
2170
- /^[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}$/,
2171
- "Must be a valid GUID"
2172
- ),
2173
- options: z.object({
2174
- couponCode: z.string().describe("Coupon code to apply, from the Coupons API.").min(1).max(20).optional().nullable()
2175
- }).describe("Options for getting a price preview. ").optional()
2176
- });
2177
- var GetPricePreviewResponse = z.object({
2178
- price: z.intersection(
2179
- z.object({
2180
- subtotal: z.string().describe(
2181
- 'Price of the order excluding tax, specified as a monetary amount. for example, `"9.99"`.'
2182
- ).optional(),
2183
- discount: z.string().describe("Total discount applied.").optional(),
2184
- tax: z.object({
2185
- name: z.string().describe("Name of the tax. For example, VAT.").optional(),
2186
- includedInPrice: z.boolean().describe(
2187
- "Whether tax is included in the original price. When `false`, tax is added at checkout."
2188
- ).optional(),
2189
- rate: z.string().describe(
2190
- 'Tax rate percentage, as a number between 0 and 100. For example, a 7% tax rate is `"7.00"`.'
2191
- ).optional(),
2192
- amount: z.string().describe(
2193
- 'Total tax, specified as a monetary amount. For example, `"3.99"`.'
2216
+ cancellation: z.object({
2217
+ requestedDate: z.date().describe("Date and time the cancellation was requested.").optional().nullable(),
2218
+ cause: z.enum([
2219
+ "UNDEFINED",
2220
+ "OWNER_ACTION",
2221
+ "MEMBER_ACTION",
2222
+ "PAYMENT_FAILURE",
2223
+ "PAYMENT_SETUP_FAILURE",
2224
+ "UNKNOWN"
2225
+ ]).describe("Reason for the cancellation.").optional(),
2226
+ effectiveAt: z.enum(["UNDEFINED", "IMMEDIATELY", "NEXT_PAYMENT_DATE"]).describe(
2227
+ "When the cancellation takes effect. Set when cancelling the order."
2194
2228
  ).optional()
2195
- }).describe("Tax applied.").optional(),
2196
- total: z.string().describe(
2197
- '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`.'
2229
+ }).describe(
2230
+ "Details about the cancellation of an order.\n\nOnly present if the status is `CANCELED`."
2198
2231
  ).optional(),
2199
- planPrice: z.string().describe("Plan price as it was at the moment of order creation.").optional(),
2200
- currency: z.string().describe(
2201
- "Currency code. Must be valid ISO 4217 currency code (e.g., USD)."
2232
+ lastPaymentStatus: z.enum([
2233
+ "UNDEFINED",
2234
+ "PAID",
2235
+ "REFUNDED",
2236
+ "FAILED",
2237
+ "UNPAID",
2238
+ "PENDING",
2239
+ "NOT_APPLICABLE"
2240
+ ]).describe(
2241
+ "Status of the last payment for the order.\nUpdated automatically for online orders. Updated manually by the Wix user for offline orders."
2242
+ ).optional(),
2243
+ startDate: z.date().describe("Start date and time for the ordered plan.").optional().nullable(),
2244
+ endDate: z.date().describe(
2245
+ "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`."
2246
+ ).optional().nullable(),
2247
+ pausePeriods: z.array(
2248
+ z.object({
2249
+ status: z.enum(["UNDEFINED", "ACTIVE", "ENDED"]).describe("Status of the pause period.").optional(),
2250
+ pauseDate: z.date().describe("Start date and time of the pause period.").optional().nullable(),
2251
+ resumeDate: z.date().describe(
2252
+ "End date and time of the pause period.\n\nOmitted while the pause period remains `ACTIVE`."
2253
+ ).optional().nullable()
2254
+ })
2202
2255
  ).optional(),
2203
2256
  freeTrialDays: z.number().int().describe(
2204
- "Free trial period for the order in days. Only available for recurring plans."
2257
+ "Free trial period for the order, in days.\n\nOnly available for recurring plans."
2205
2258
  ).min(1).max(999).optional().nullable(),
2206
- coupon: z.object({
2207
- code: z.string().describe("Code of the applied coupon.").min(1).max(20).optional(),
2208
- amount: z.string().describe("Total discount of the coupon, as a monetary amount.").optional(),
2209
- _id: z.string().describe("Coupon ID.").regex(
2259
+ earliestEndDate: z.date().describe(
2260
+ "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."
2261
+ ).optional().nullable(),
2262
+ currentCycle: z.object({
2263
+ index: z.number().int().describe(
2264
+ "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`."
2265
+ ).min(0).optional(),
2266
+ startedDate: z.date().describe("Start date and time for the current payment cycle.").optional().nullable(),
2267
+ endedDate: z.date().describe("End date and time for the current payment cycle.").optional().nullable()
2268
+ }).describe(
2269
+ "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."
2270
+ ).optional(),
2271
+ planName: z.string().describe("Plan name at the time of purchase.").optional(),
2272
+ planDescription: z.string().describe("Plan description at the time of purchase").optional(),
2273
+ planPrice: z.string().describe("Plan price as it was at the moment of order creation.").optional(),
2274
+ _createdDate: z.date().describe("Date and time the order was created.").optional().nullable(),
2275
+ _updatedDate: z.date().describe("Date and time the order was updated.").optional().nullable(),
2276
+ formData: z.object({
2277
+ formId: z.string().describe(
2278
+ "ID of the [order form](https://dev.wix.com/docs/rest/api-reference/wix-forms/form-submissions/introduction) associated with the plan at checkout."
2279
+ ).regex(
2210
2280
  /^[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}$/,
2211
2281
  "Must be a valid GUID"
2212
- ).optional()
2282
+ ).optional().nullable(),
2283
+ submissionId: z.string().describe(
2284
+ "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."
2285
+ ).regex(
2286
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
2287
+ "Must be a valid GUID"
2288
+ ).optional().nullable(),
2289
+ submissionData: z.record(z.string(), z.any()).describe("Data submitted to the plan's order form at checkout.").optional()
2213
2290
  }).describe(
2214
- "Coupon applied to the order. Empty means no coupon was applied."
2291
+ "Information about the form submitted during the plan's checkout."
2215
2292
  ).optional()
2216
- }),
2217
- z.xor([
2218
- z.object({
2219
- subscription: z.never().optional(),
2220
- singlePaymentForDuration: z.never().optional(),
2221
- singlePaymentUnlimited: z.never().optional()
2222
- }),
2223
- z.object({
2224
- singlePaymentForDuration: z.never().optional(),
2225
- singlePaymentUnlimited: z.never().optional(),
2226
- subscription: z.object({
2227
- cycleDuration: z.object({
2228
- count: z.number().int().describe(
2229
- "Number of days, months, weeks, or years in a single payment cycle. Currently limited to support only `1`."
2230
- ).min(1).optional().nullable(),
2231
- unit: z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).describe("Unit of time for the cycle duration.").optional()
2232
- }).describe(
2233
- "Number of payment cycles the subscription is valid for.\n`0` for unlimited plans or for plans that are valid until canceled."
2234
- ).optional(),
2235
- cycleCount: z.number().int().describe(
2236
- "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."
2237
- ).min(0).max(2e3).optional().nullable()
2238
- }).describe("Order has recurring payments.")
2239
- }),
2240
- z.object({
2241
- subscription: z.never().optional(),
2242
- singlePaymentUnlimited: z.never().optional(),
2243
- singlePaymentForDuration: z.object({
2244
- count: z.number().int().describe(
2245
- "Number of days, months, weeks, or years in a single payment cycle. Currently limited to support only `1`."
2246
- ).min(1).optional().nullable(),
2247
- unit: z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).describe("Unit of time for the cycle duration.").optional()
2248
- }).describe(
2249
- "One-time payment. Order is valid for a specified duration."
2250
- )
2251
- }),
2252
- z.object({
2253
- subscription: z.never().optional(),
2254
- singlePaymentForDuration: z.never().optional(),
2255
- singlePaymentUnlimited: z.boolean().describe("One-time payment. Order is valid until it is canceled.")
2256
- })
2257
- ])
2258
- ).describe(
2259
- "__Deprecated.__ Use `prices` instead. This property will be removed on September 30, 2022."
2260
- ).optional(),
2261
- prices: z.array(
2262
- z.object({
2263
- duration: z.object({
2264
- cycleFrom: z.number().int().describe(
2265
- "Price starts to apply with this cycle.\n\n`1` is the first payment cycle for all pricing models."
2266
- ).optional(),
2267
- numberOfCycles: z.number().int().describe(
2268
- "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`."
2269
- ).optional().nullable()
2270
- }).describe(
2271
- "Cycle duration to apply `price` for.\n\nUse with all pricing models.\nCan apply the same price to multiple payment cycles."
2272
- ).optional(),
2273
- price: z.object({
2274
- subtotal: z.string().describe(
2275
- 'Price of the order excluding tax, specified as a monetary amount. For example, `"9.99"`.'
2276
- ).optional(),
2277
- coupon: z.object({
2278
- code: z.string().describe("Code of the applied coupon.").min(1).max(20).optional(),
2279
- amount: z.string().describe(
2280
- "Total discount of the coupon, as a monetary amount."
2281
- ).optional(),
2282
- _id: z.string().describe("Coupon ID.").regex(
2283
- /^[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}$/,
2284
- "Must be a valid GUID"
2285
- ).optional()
2286
- }).describe("Coupon applied to the order, from the Coupons API.").optional(),
2287
- discount: z.string().describe("Total discount applied to the order.").optional(),
2288
- tax: z.object({
2289
- name: z.string().describe("Name of the tax. For example, VAT.").optional(),
2290
- includedInPrice: z.boolean().describe(
2291
- "Whether tax is included in the original price. When `false`, tax is added at checkout."
2292
- ).optional(),
2293
- rate: z.string().describe(
2294
- 'Tax rate percentage, as a number between 0 and 100. For example, a 7% tax rate is `"7.00"`.'
2295
- ).optional(),
2296
- amount: z.string().describe(
2297
- 'Total tax, specified as a monetary amount. For example, `"3.99"`.'
2298
- ).optional()
2299
- }).describe(
2300
- "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)."
2301
- ).optional(),
2302
- total: z.string().describe(
2303
- '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`.'
2304
- ).optional(),
2305
- currency: z.string().describe(
2306
- "Three-letter currency code in\n[ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format."
2307
- ).optional(),
2308
- proration: z.string().describe(
2309
- "Price change after billing date was change and price was adjusted. Could be positive and negative values."
2310
- ).optional()
2311
- }).describe("Order price.").optional()
2312
2293
  })
2294
+ ).optional(),
2295
+ pagingMetadata: z.object({
2296
+ count: z.number().int().describe("Number of items returned in the response.").optional().nullable(),
2297
+ offset: z.number().int().describe("Offset that was requested.").optional().nullable(),
2298
+ total: z.number().int().describe(
2299
+ "Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set."
2300
+ ).optional().nullable(),
2301
+ tooManyToCount: z.boolean().describe(
2302
+ "Flag that indicates the server failed to calculate the `total` field."
2303
+ ).optional().nullable(),
2304
+ cursors: z.object({
2305
+ next: z.string().describe(
2306
+ "Cursor string pointing to the next page in the list of results."
2307
+ ).max(16e3).optional().nullable(),
2308
+ prev: z.string().describe(
2309
+ "Cursor pointing to the previous page in the list of results."
2310
+ ).max(16e3).optional().nullable()
2311
+ }).describe(
2312
+ "Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used."
2313
+ ).optional()
2314
+ }).describe(
2315
+ "Object containing paging-related data (number of orders returned, offset)."
2313
2316
  ).optional()
2314
2317
  });
2315
- var ManagementGetOrderRequest = z.object({
2318
+ var PostponeEndDateRequest = z.object({
2316
2319
  _id: z.string().describe("Order ID.").regex(
2317
2320
  /^[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}$/,
2318
2321
  "Must be a valid GUID"
2319
2322
  ),
2320
- options: z.object({ fieldSet: z.enum(["UNKNOWN_SET", "BASIC", "FULL"]).optional() }).describe("Options to use when getting an order. ").optional()
2323
+ endDate: z.date().describe(
2324
+ "New end date and time.\n\nMust be later than the current end date and time."
2325
+ )
2321
2326
  });
2322
- var ManagementGetOrderResponse = z.object({
2327
+ var PostponeEndDateResponse = z.object({});
2328
+ var CancelOrderRequest = z.object({
2329
+ _id: z.string().describe("Order ID.").regex(
2330
+ /^[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}$/,
2331
+ "Must be a valid GUID"
2332
+ ),
2333
+ effectiveAt: z.enum(["UNDEFINED", "IMMEDIATELY", "NEXT_PAYMENT_DATE"])
2334
+ });
2335
+ var CancelOrderResponse = z.object({});
2336
+ var MarkAsPaidRequest = z.object({
2337
+ _id: z.string().describe("Order ID.").regex(
2338
+ /^[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}$/,
2339
+ "Must be a valid GUID"
2340
+ )
2341
+ });
2342
+ var MarkAsPaidResponse = z.object({});
2343
+ var PauseOrderRequest = z.object({
2344
+ _id: z.string().describe("Order ID.").regex(
2345
+ /^[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}$/,
2346
+ "Must be a valid GUID"
2347
+ )
2348
+ });
2349
+ var PauseOrderResponse = z.object({});
2350
+ var ResumeOrderRequest = z.object({
2351
+ _id: z.string().describe("Order ID.").regex(
2352
+ /^[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}$/,
2353
+ "Must be a valid GUID"
2354
+ )
2355
+ });
2356
+ var ResumeOrderResponse = z.object({});
2357
+ var MemberGetOrderRequest = z.object({
2358
+ _id: z.string().describe("Order ID.").regex(
2359
+ /^[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}$/,
2360
+ "Must be a valid GUID"
2361
+ ),
2362
+ options: z.object({ fieldSet: z.enum(["UNKNOWN_SET", "BASIC", "FULL"]).optional() }).describe("Options for getting a logged-in member's order. ").optional()
2363
+ });
2364
+ var MemberGetOrderResponse = z.object({
2323
2365
  _id: z.string().describe("Order ID.").regex(
2324
2366
  /^[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}$/,
2325
2367
  "Must be a valid GUID"
@@ -2632,13 +2674,10 @@ var ManagementGetOrderResponse = z.object({
2632
2674
  "Information about the form submitted during the plan's checkout."
2633
2675
  ).optional()
2634
2676
  });
2635
- var ManagementListOrdersRequest = z.object({
2677
+ var MemberListOrdersRequest = z.object({
2636
2678
  options: z.object({
2637
- buyerIds: z.array(z.string()).optional(),
2638
2679
  planIds: z.array(z.string()).optional(),
2639
- autoRenewCanceled: z.boolean().describe(
2640
- "Filter by whether or not the auto-renewal of recurring orders was canceled."
2641
- ).optional().nullable(),
2680
+ autoRenewCanceled: z.boolean().describe("Filter for orders where auto renewal was canceled.").optional().nullable(),
2642
2681
  orderStatuses: z.array(
2643
2682
  z.enum([
2644
2683
  "UNDEFINED",
@@ -2662,19 +2701,23 @@ var ManagementListOrdersRequest = z.object({
2662
2701
  ])
2663
2702
  ).optional(),
2664
2703
  limit: z.number().int().describe(
2665
- "Number of orders to return. See Sorting and Paging for more information.\n\nMax: `50`"
2704
+ "Limit the number of pricing plans returned. Default limit is 50."
2666
2705
  ).min(1).max(50).optional().nullable(),
2667
- offset: z.number().int().describe("Number of orders to skip in the current sort order.").min(0).optional().nullable(),
2706
+ offset: z.number().int().describe("Number of entries to offset.").min(0).optional().nullable(),
2668
2707
  sorting: z.object({
2669
2708
  fieldName: z.string().describe("Name of the field to sort by.").max(512).optional(),
2670
- order: z.enum(["ASC", "DESC"]).optional()
2671
- }).describe(
2672
- "Sort order.\n\nUse `ASC` for ascending order or `DESC` for descending order.\n\nDefault: `DESC`."
2673
- ).optional(),
2709
+ order: z.enum(["ASC", "DESC"]).optional(),
2710
+ origin: z.object({
2711
+ latitude: z.number().describe("Address latitude.").optional().nullable(),
2712
+ longitude: z.number().describe("Address longitude.").optional().nullable()
2713
+ }).describe(
2714
+ "Origin point for geo-distance sorting on a GEO field\nresults are ordered by distance from this point (ASC = nearest first, DESC = farthest first)."
2715
+ ).optional()
2716
+ }).describe("Sorting direction (defaults to ASC) and field to sort by.").optional(),
2674
2717
  fieldSet: z.enum(["UNKNOWN_SET", "BASIC", "FULL"]).optional()
2675
2718
  }).describe("Filtering, sorting, and pagination options. ").optional()
2676
2719
  });
2677
- var ManagementListOrdersResponse = z.object({
2720
+ var MemberListOrdersResponse = z.object({
2678
2721
  orders: z.array(
2679
2722
  z.object({
2680
2723
  _id: z.string().describe("Order ID.").regex(
@@ -3025,45 +3068,14 @@ var ManagementListOrdersResponse = z.object({
3025
3068
  "Object containing paging-related data (number of orders returned, offset)."
3026
3069
  ).optional()
3027
3070
  });
3028
- var PostponeEndDateRequest = z.object({
3029
- _id: z.string().describe("Order ID.").regex(
3030
- /^[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}$/,
3031
- "Must be a valid GUID"
3032
- ),
3033
- endDate: z.date().describe(
3034
- "New end date and time.\n\nMust be later than the current end date and time."
3035
- )
3036
- });
3037
- var PostponeEndDateResponse = z.object({});
3038
- var CancelOrderRequest = z.object({
3071
+ var RequestCancellationRequest = z.object({
3039
3072
  _id: z.string().describe("Order ID.").regex(
3040
3073
  /^[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}$/,
3041
3074
  "Must be a valid GUID"
3042
3075
  ),
3043
3076
  effectiveAt: z.enum(["UNDEFINED", "IMMEDIATELY", "NEXT_PAYMENT_DATE"])
3044
3077
  });
3045
- var CancelOrderResponse = z.object({});
3046
- var MarkAsPaidRequest = z.object({
3047
- _id: z.string().describe("Order ID.").regex(
3048
- /^[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}$/,
3049
- "Must be a valid GUID"
3050
- )
3051
- });
3052
- var MarkAsPaidResponse = z.object({});
3053
- var PauseOrderRequest = z.object({
3054
- _id: z.string().describe("Order ID.").regex(
3055
- /^[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}$/,
3056
- "Must be a valid GUID"
3057
- )
3058
- });
3059
- var PauseOrderResponse = z.object({});
3060
- var ResumeOrderRequest = z.object({
3061
- _id: z.string().describe("Order ID.").regex(
3062
- /^[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}$/,
3063
- "Must be a valid GUID"
3064
- )
3065
- });
3066
- var ResumeOrderResponse = z.object({});
3078
+ var RequestCancellationResponse = z.object({});
3067
3079
  // Annotate the CommonJS export names for ESM import in node:
3068
3080
  0 && (module.exports = {
3069
3081
  CancelOrderRequest,