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