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