@wix/auto_sdk_loyalty_coupons 1.0.44 → 1.0.45
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/schemas.d.ts +755 -0
- package/build/cjs/schemas.js +1325 -0
- package/build/cjs/schemas.js.map +1 -0
- package/build/es/schemas.d.mts +755 -0
- package/build/es/schemas.mjs +1275 -0
- package/build/es/schemas.mjs.map +1 -0
- package/build/internal/cjs/schemas.d.ts +755 -0
- package/build/internal/cjs/schemas.js +1325 -0
- package/build/internal/cjs/schemas.js.map +1 -0
- package/build/internal/es/schemas.d.mts +755 -0
- package/build/internal/es/schemas.mjs +1275 -0
- package/build/internal/es/schemas.mjs.map +1 -0
- package/package.json +12 -5
- package/schemas/package.json +3 -0
|
@@ -0,0 +1,1325 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// schemas.ts
|
|
31
|
+
var schemas_exports = {};
|
|
32
|
+
__export(schemas_exports, {
|
|
33
|
+
BulkGetLoyaltyCouponRequest: () => BulkGetLoyaltyCouponRequest,
|
|
34
|
+
BulkGetLoyaltyCouponResponse: () => BulkGetLoyaltyCouponResponse,
|
|
35
|
+
DeleteLoyaltyCouponRequest: () => DeleteLoyaltyCouponRequest,
|
|
36
|
+
DeleteLoyaltyCouponResponse: () => DeleteLoyaltyCouponResponse,
|
|
37
|
+
GetCurrentMemberCouponsRequest: () => GetCurrentMemberCouponsRequest,
|
|
38
|
+
GetCurrentMemberCouponsResponse: () => GetCurrentMemberCouponsResponse,
|
|
39
|
+
GetLoyaltyCouponRequest: () => GetLoyaltyCouponRequest,
|
|
40
|
+
GetLoyaltyCouponResponse: () => GetLoyaltyCouponResponse,
|
|
41
|
+
QueryLoyaltyCouponsRequest: () => QueryLoyaltyCouponsRequest,
|
|
42
|
+
QueryLoyaltyCouponsResponse: () => QueryLoyaltyCouponsResponse,
|
|
43
|
+
RedeemCurrentMemberPointsForCouponRequest: () => RedeemCurrentMemberPointsForCouponRequest,
|
|
44
|
+
RedeemCurrentMemberPointsForCouponResponse: () => RedeemCurrentMemberPointsForCouponResponse,
|
|
45
|
+
RedeemPointsForCouponRequest: () => RedeemPointsForCouponRequest,
|
|
46
|
+
RedeemPointsForCouponResponse: () => RedeemPointsForCouponResponse
|
|
47
|
+
});
|
|
48
|
+
module.exports = __toCommonJS(schemas_exports);
|
|
49
|
+
|
|
50
|
+
// src/loyalty-v1-coupon-coupons.schemas.ts
|
|
51
|
+
var z = __toESM(require("zod"));
|
|
52
|
+
var RedeemPointsForCouponRequest = z.object({
|
|
53
|
+
rewardId: z.string().describe(
|
|
54
|
+
"ID of the loyalty reward to redeem. See the Loyalty Rewards API for more information."
|
|
55
|
+
).regex(
|
|
56
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
57
|
+
"Must be a valid GUID"
|
|
58
|
+
),
|
|
59
|
+
options: z.object({
|
|
60
|
+
loyaltyAccountId: z.string().describe(
|
|
61
|
+
"ID of the loyalty account of the customer redeeming points. See the Loyalty Accounts API for more information."
|
|
62
|
+
).regex(
|
|
63
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
64
|
+
"Must be a valid GUID"
|
|
65
|
+
)
|
|
66
|
+
})
|
|
67
|
+
});
|
|
68
|
+
var RedeemPointsForCouponResponse = z.object({
|
|
69
|
+
coupon: z.object({
|
|
70
|
+
_id: z.string().describe("Loyalty coupon ID.").regex(
|
|
71
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
72
|
+
"Must be a valid GUID"
|
|
73
|
+
).optional(),
|
|
74
|
+
accountId: z.string().describe(
|
|
75
|
+
"Loyalty [account ID](https://dev.wix.com/docs/rest/crm/loyalty-program/accounts/account-object) of the customer that redeemed points for a coupon."
|
|
76
|
+
).regex(
|
|
77
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
78
|
+
"Must be a valid GUID"
|
|
79
|
+
).optional(),
|
|
80
|
+
memberIdDeprecated: z.string().describe(
|
|
81
|
+
"Member ID of the customer that redeemed points for a coupon. See the Members API for more information."
|
|
82
|
+
).regex(
|
|
83
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
84
|
+
"Must be a valid GUID"
|
|
85
|
+
).optional(),
|
|
86
|
+
memberId: z.string().describe(
|
|
87
|
+
"Member ID of the customer that redeemed points for a coupon. See the Members API for more information."
|
|
88
|
+
).regex(
|
|
89
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
90
|
+
"Must be a valid GUID"
|
|
91
|
+
).optional().nullable(),
|
|
92
|
+
transactionId: z.string().describe(
|
|
93
|
+
"[Transaction ID](https://dev.wix.com/docs/rest/crm/loyalty-program/transactions/loyalty-transaction-object) for the transaction that created a coupon."
|
|
94
|
+
).regex(
|
|
95
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
96
|
+
"Must be a valid GUID"
|
|
97
|
+
).optional().nullable(),
|
|
98
|
+
couponReference: z.object({
|
|
99
|
+
couponId: z.string().describe("Coupon ID.").regex(
|
|
100
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
101
|
+
"Must be a valid GUID"
|
|
102
|
+
).optional(),
|
|
103
|
+
code: z.string().describe(
|
|
104
|
+
"Coupon code.\n\nUnique code entered by a customer to apply the coupon."
|
|
105
|
+
).max(20).optional(),
|
|
106
|
+
name: z.string().describe("Name of coupon.").max(80).optional().nullable(),
|
|
107
|
+
specification: z.intersection(
|
|
108
|
+
z.object({
|
|
109
|
+
name: z.string().describe("Name of coupon.").optional().nullable(),
|
|
110
|
+
type: z.enum([
|
|
111
|
+
"UNKNOWN",
|
|
112
|
+
"MONEY_OFF_AMOUNT",
|
|
113
|
+
"PERCENT_OFF_RATE",
|
|
114
|
+
"FREE_SHIPPING",
|
|
115
|
+
"FIXED_PRICE_AMOUNT",
|
|
116
|
+
"BUY_X_GET_Y"
|
|
117
|
+
]).optional(),
|
|
118
|
+
limitedToOneItem: z.boolean().describe(
|
|
119
|
+
"Whether the coupon is limited to 1 discount per order. If true and a customer pays for multiple items\nthat the coupon applies to, only the lowest priced item is discounted.\nCoupons with a `bookings` `namespace` are always limited to 1 item."
|
|
120
|
+
).optional().nullable(),
|
|
121
|
+
appliesToSubscriptions: z.boolean().describe("Whether the coupon also applies to subscriptions.").optional().nullable(),
|
|
122
|
+
discountedCycleCount: z.number().int().describe(
|
|
123
|
+
"Specifies the amount of cycles to apply the discount to for a subscription item.\n\nCan only be set when `appliesToSubscriptions` is `TRUE` and `specification.scope.namespace` is `pricingPlans`.\nIf `discountedCycleCount` is empty, the coupon applies to all available cycles.\n\nMin: `1`\n\nMax: `999`"
|
|
124
|
+
).optional().nullable()
|
|
125
|
+
}),
|
|
126
|
+
z.intersection(
|
|
127
|
+
z.xor([
|
|
128
|
+
z.object({
|
|
129
|
+
moneyOffAmount: z.never().optional(),
|
|
130
|
+
percentOffRate: z.never().optional(),
|
|
131
|
+
freeShipping: z.never().optional(),
|
|
132
|
+
fixedPriceAmount: z.never().optional(),
|
|
133
|
+
buyXGetY: z.never().optional()
|
|
134
|
+
}),
|
|
135
|
+
z.object({
|
|
136
|
+
percentOffRate: z.never().optional(),
|
|
137
|
+
freeShipping: z.never().optional(),
|
|
138
|
+
fixedPriceAmount: z.never().optional(),
|
|
139
|
+
buyXGetY: z.never().optional(),
|
|
140
|
+
moneyOffAmount: z.number().describe("Fixed price discount.").min(0.01)
|
|
141
|
+
}),
|
|
142
|
+
z.object({
|
|
143
|
+
moneyOffAmount: z.never().optional(),
|
|
144
|
+
freeShipping: z.never().optional(),
|
|
145
|
+
fixedPriceAmount: z.never().optional(),
|
|
146
|
+
buyXGetY: z.never().optional(),
|
|
147
|
+
percentOffRate: z.number().describe("Discount as a percentage.")
|
|
148
|
+
}),
|
|
149
|
+
z.object({
|
|
150
|
+
moneyOffAmount: z.never().optional(),
|
|
151
|
+
percentOffRate: z.never().optional(),
|
|
152
|
+
fixedPriceAmount: z.never().optional(),
|
|
153
|
+
buyXGetY: z.never().optional(),
|
|
154
|
+
freeShipping: z.boolean().describe(
|
|
155
|
+
"Free shipping. If true, the coupon applies to all items in all `namespaces` on a site."
|
|
156
|
+
)
|
|
157
|
+
}),
|
|
158
|
+
z.object({
|
|
159
|
+
moneyOffAmount: z.never().optional(),
|
|
160
|
+
percentOffRate: z.never().optional(),
|
|
161
|
+
freeShipping: z.never().optional(),
|
|
162
|
+
buyXGetY: z.never().optional(),
|
|
163
|
+
fixedPriceAmount: z.number().describe(
|
|
164
|
+
"Specific sale price. Currently only supported for coupons with a `stores` `namespace`."
|
|
165
|
+
)
|
|
166
|
+
}),
|
|
167
|
+
z.object({
|
|
168
|
+
moneyOffAmount: z.never().optional(),
|
|
169
|
+
percentOffRate: z.never().optional(),
|
|
170
|
+
freeShipping: z.never().optional(),
|
|
171
|
+
fixedPriceAmount: z.never().optional(),
|
|
172
|
+
buyXGetY: z.object({
|
|
173
|
+
x: z.number().int().describe(
|
|
174
|
+
"Number of purchased items required to receive free items."
|
|
175
|
+
).optional(),
|
|
176
|
+
y: z.number().int().describe(
|
|
177
|
+
"Number of items received for free if required number of items were purchased."
|
|
178
|
+
).optional()
|
|
179
|
+
}).describe(
|
|
180
|
+
"Free products when making a purchase. `buyXGetY` is an object that specifies `x` and `y` in the\nfollowing scenario: if a visitor purchases x number of products, they receive y number of products for free. C\nurrently only supported for coupons with a `stores` `namespace`."
|
|
181
|
+
)
|
|
182
|
+
})
|
|
183
|
+
]),
|
|
184
|
+
z.xor([
|
|
185
|
+
z.object({
|
|
186
|
+
scope: z.never().optional(),
|
|
187
|
+
minimumSubtotal: z.never().optional()
|
|
188
|
+
}),
|
|
189
|
+
z.object({
|
|
190
|
+
minimumSubtotal: z.never().optional(),
|
|
191
|
+
scope: z.object({
|
|
192
|
+
name: z.string().describe(
|
|
193
|
+
"Group within a `namespace` for which the coupon is applicable.\n\nIf no group is specified, the coupon applies to all items in the namespace.\n`group` is required in some namespaces. See [Scope Values](https://dev.wix.com/api/rest/coupons/coupons/valid-scope-values)\nfor a list of currently supported groups for each namespace."
|
|
194
|
+
).optional().nullable(),
|
|
195
|
+
entityId: z.string().describe(
|
|
196
|
+
"ID of the specific entity in the group for which the coupon is applicable.\n\nIf no `entityId` is specified, the coupon applies to all entities in the group. In some cases when a group is specified,\nan `entityId` is required. See [Scope Values](https://dev.wix.com/api/rest/coupons/coupons/valid-scope-values)\nfor a list of currently supported entities for each namespace and group."
|
|
197
|
+
).optional().nullable(),
|
|
198
|
+
namespace: z.string().describe(
|
|
199
|
+
'Wix application for which the coupon is applicable.\n\nOne of the following:\n+ `"stores"`\n+ `"bookings"`\n+ `"events"`\n+ `"pricingPlans"`'
|
|
200
|
+
).optional()
|
|
201
|
+
}).describe(
|
|
202
|
+
"Scope of the coupon. When no scope is defined, the coupon applies to all\nitems in all `namespaces` in the site."
|
|
203
|
+
)
|
|
204
|
+
}),
|
|
205
|
+
z.object({
|
|
206
|
+
scope: z.never().optional(),
|
|
207
|
+
minimumSubtotal: z.number().describe(
|
|
208
|
+
"The coupon is only applicable when the order subtotal is over this amount."
|
|
209
|
+
)
|
|
210
|
+
})
|
|
211
|
+
])
|
|
212
|
+
)
|
|
213
|
+
).describe("The information to use when creating the coupon.").optional(),
|
|
214
|
+
deleted: z.boolean().describe("Whether the referenced coupon was deleted.").optional().nullable()
|
|
215
|
+
}).describe(
|
|
216
|
+
"Reference coupon information for the corresponding [coupon](https://dev.wix.com/docs/rest/business-management/marketing/coupons/coupons/coupon-object)\nthat is created along with the loyalty coupon."
|
|
217
|
+
).optional(),
|
|
218
|
+
status: z.enum(["UNKNOWN", "PENDING", "ACTIVE", "APPLIED", "FAILED", "ARCHIVED"]).describe(
|
|
219
|
+
"Loyalty coupon status.\n\nThis status relates to the corresponding coupon that is created\nat the same time as the loyalty coupon and is included in `couponReference`."
|
|
220
|
+
).optional(),
|
|
221
|
+
rewardName: z.string().describe("Name of reward that was redeemed to create this coupon.").min(1).max(50).optional(),
|
|
222
|
+
revision: z.string().regex(/^\d+$/, "Must be a valid UInt64 string").describe(
|
|
223
|
+
"Revision number, which increments by 1 each time the loyalty coupon is updated.\n\nTo prevent conflicting changes, the current `revision` must be passed when updating the loyalty coupon."
|
|
224
|
+
).optional().nullable(),
|
|
225
|
+
_createdDate: z.date().describe("Date and time the loyalty coupon was created.").optional().nullable(),
|
|
226
|
+
_updatedDate: z.date().describe("Date and time the loyalty coupon was last updated.").optional().nullable(),
|
|
227
|
+
refundable: z.boolean().describe(
|
|
228
|
+
'Whether the loyalty coupon was created in a "refundable workflow" i.e. checkout-exchange, and therefore can be deleted in the background. Refundable coupons should not be visible to customers in the UI.'
|
|
229
|
+
).optional().nullable()
|
|
230
|
+
}).describe("Created loyalty coupon.").optional()
|
|
231
|
+
});
|
|
232
|
+
var RedeemCurrentMemberPointsForCouponRequest = z.object({
|
|
233
|
+
rewardId: z.string().describe(
|
|
234
|
+
"ID of the loyalty reward to redeem. See the Loyalty Rewards API for more information."
|
|
235
|
+
).regex(
|
|
236
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
237
|
+
"Must be a valid GUID"
|
|
238
|
+
)
|
|
239
|
+
});
|
|
240
|
+
var RedeemCurrentMemberPointsForCouponResponse = z.object({
|
|
241
|
+
coupon: z.object({
|
|
242
|
+
_id: z.string().describe("Loyalty coupon ID.").regex(
|
|
243
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
244
|
+
"Must be a valid GUID"
|
|
245
|
+
).optional(),
|
|
246
|
+
accountId: z.string().describe(
|
|
247
|
+
"Loyalty [account ID](https://dev.wix.com/docs/rest/crm/loyalty-program/accounts/account-object) of the customer that redeemed points for a coupon."
|
|
248
|
+
).regex(
|
|
249
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
250
|
+
"Must be a valid GUID"
|
|
251
|
+
).optional(),
|
|
252
|
+
memberIdDeprecated: z.string().describe(
|
|
253
|
+
"Member ID of the customer that redeemed points for a coupon. See the Members API for more information."
|
|
254
|
+
).regex(
|
|
255
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
256
|
+
"Must be a valid GUID"
|
|
257
|
+
).optional(),
|
|
258
|
+
memberId: z.string().describe(
|
|
259
|
+
"Member ID of the customer that redeemed points for a coupon. See the Members API for more information."
|
|
260
|
+
).regex(
|
|
261
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
262
|
+
"Must be a valid GUID"
|
|
263
|
+
).optional().nullable(),
|
|
264
|
+
transactionId: z.string().describe(
|
|
265
|
+
"[Transaction ID](https://dev.wix.com/docs/rest/crm/loyalty-program/transactions/loyalty-transaction-object) for the transaction that created a coupon."
|
|
266
|
+
).regex(
|
|
267
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
268
|
+
"Must be a valid GUID"
|
|
269
|
+
).optional().nullable(),
|
|
270
|
+
couponReference: z.object({
|
|
271
|
+
couponId: z.string().describe("Coupon ID.").regex(
|
|
272
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
273
|
+
"Must be a valid GUID"
|
|
274
|
+
).optional(),
|
|
275
|
+
code: z.string().describe(
|
|
276
|
+
"Coupon code.\n\nUnique code entered by a customer to apply the coupon."
|
|
277
|
+
).max(20).optional(),
|
|
278
|
+
name: z.string().describe("Name of coupon.").max(80).optional().nullable(),
|
|
279
|
+
specification: z.intersection(
|
|
280
|
+
z.object({
|
|
281
|
+
name: z.string().describe("Name of coupon.").optional().nullable(),
|
|
282
|
+
type: z.enum([
|
|
283
|
+
"UNKNOWN",
|
|
284
|
+
"MONEY_OFF_AMOUNT",
|
|
285
|
+
"PERCENT_OFF_RATE",
|
|
286
|
+
"FREE_SHIPPING",
|
|
287
|
+
"FIXED_PRICE_AMOUNT",
|
|
288
|
+
"BUY_X_GET_Y"
|
|
289
|
+
]).optional(),
|
|
290
|
+
limitedToOneItem: z.boolean().describe(
|
|
291
|
+
"Whether the coupon is limited to 1 discount per order. If true and a customer pays for multiple items\nthat the coupon applies to, only the lowest priced item is discounted.\nCoupons with a `bookings` `namespace` are always limited to 1 item."
|
|
292
|
+
).optional().nullable(),
|
|
293
|
+
appliesToSubscriptions: z.boolean().describe("Whether the coupon also applies to subscriptions.").optional().nullable(),
|
|
294
|
+
discountedCycleCount: z.number().int().describe(
|
|
295
|
+
"Specifies the amount of cycles to apply the discount to for a subscription item.\n\nCan only be set when `appliesToSubscriptions` is `TRUE` and `specification.scope.namespace` is `pricingPlans`.\nIf `discountedCycleCount` is empty, the coupon applies to all available cycles.\n\nMin: `1`\n\nMax: `999`"
|
|
296
|
+
).optional().nullable()
|
|
297
|
+
}),
|
|
298
|
+
z.intersection(
|
|
299
|
+
z.xor([
|
|
300
|
+
z.object({
|
|
301
|
+
moneyOffAmount: z.never().optional(),
|
|
302
|
+
percentOffRate: z.never().optional(),
|
|
303
|
+
freeShipping: z.never().optional(),
|
|
304
|
+
fixedPriceAmount: z.never().optional(),
|
|
305
|
+
buyXGetY: z.never().optional()
|
|
306
|
+
}),
|
|
307
|
+
z.object({
|
|
308
|
+
percentOffRate: z.never().optional(),
|
|
309
|
+
freeShipping: z.never().optional(),
|
|
310
|
+
fixedPriceAmount: z.never().optional(),
|
|
311
|
+
buyXGetY: z.never().optional(),
|
|
312
|
+
moneyOffAmount: z.number().describe("Fixed price discount.").min(0.01)
|
|
313
|
+
}),
|
|
314
|
+
z.object({
|
|
315
|
+
moneyOffAmount: z.never().optional(),
|
|
316
|
+
freeShipping: z.never().optional(),
|
|
317
|
+
fixedPriceAmount: z.never().optional(),
|
|
318
|
+
buyXGetY: z.never().optional(),
|
|
319
|
+
percentOffRate: z.number().describe("Discount as a percentage.")
|
|
320
|
+
}),
|
|
321
|
+
z.object({
|
|
322
|
+
moneyOffAmount: z.never().optional(),
|
|
323
|
+
percentOffRate: z.never().optional(),
|
|
324
|
+
fixedPriceAmount: z.never().optional(),
|
|
325
|
+
buyXGetY: z.never().optional(),
|
|
326
|
+
freeShipping: z.boolean().describe(
|
|
327
|
+
"Free shipping. If true, the coupon applies to all items in all `namespaces` on a site."
|
|
328
|
+
)
|
|
329
|
+
}),
|
|
330
|
+
z.object({
|
|
331
|
+
moneyOffAmount: z.never().optional(),
|
|
332
|
+
percentOffRate: z.never().optional(),
|
|
333
|
+
freeShipping: z.never().optional(),
|
|
334
|
+
buyXGetY: z.never().optional(),
|
|
335
|
+
fixedPriceAmount: z.number().describe(
|
|
336
|
+
"Specific sale price. Currently only supported for coupons with a `stores` `namespace`."
|
|
337
|
+
)
|
|
338
|
+
}),
|
|
339
|
+
z.object({
|
|
340
|
+
moneyOffAmount: z.never().optional(),
|
|
341
|
+
percentOffRate: z.never().optional(),
|
|
342
|
+
freeShipping: z.never().optional(),
|
|
343
|
+
fixedPriceAmount: z.never().optional(),
|
|
344
|
+
buyXGetY: z.object({
|
|
345
|
+
x: z.number().int().describe(
|
|
346
|
+
"Number of purchased items required to receive free items."
|
|
347
|
+
).optional(),
|
|
348
|
+
y: z.number().int().describe(
|
|
349
|
+
"Number of items received for free if required number of items were purchased."
|
|
350
|
+
).optional()
|
|
351
|
+
}).describe(
|
|
352
|
+
"Free products when making a purchase. `buyXGetY` is an object that specifies `x` and `y` in the\nfollowing scenario: if a visitor purchases x number of products, they receive y number of products for free. C\nurrently only supported for coupons with a `stores` `namespace`."
|
|
353
|
+
)
|
|
354
|
+
})
|
|
355
|
+
]),
|
|
356
|
+
z.xor([
|
|
357
|
+
z.object({
|
|
358
|
+
scope: z.never().optional(),
|
|
359
|
+
minimumSubtotal: z.never().optional()
|
|
360
|
+
}),
|
|
361
|
+
z.object({
|
|
362
|
+
minimumSubtotal: z.never().optional(),
|
|
363
|
+
scope: z.object({
|
|
364
|
+
name: z.string().describe(
|
|
365
|
+
"Group within a `namespace` for which the coupon is applicable.\n\nIf no group is specified, the coupon applies to all items in the namespace.\n`group` is required in some namespaces. See [Scope Values](https://dev.wix.com/api/rest/coupons/coupons/valid-scope-values)\nfor a list of currently supported groups for each namespace."
|
|
366
|
+
).optional().nullable(),
|
|
367
|
+
entityId: z.string().describe(
|
|
368
|
+
"ID of the specific entity in the group for which the coupon is applicable.\n\nIf no `entityId` is specified, the coupon applies to all entities in the group. In some cases when a group is specified,\nan `entityId` is required. See [Scope Values](https://dev.wix.com/api/rest/coupons/coupons/valid-scope-values)\nfor a list of currently supported entities for each namespace and group."
|
|
369
|
+
).optional().nullable(),
|
|
370
|
+
namespace: z.string().describe(
|
|
371
|
+
'Wix application for which the coupon is applicable.\n\nOne of the following:\n+ `"stores"`\n+ `"bookings"`\n+ `"events"`\n+ `"pricingPlans"`'
|
|
372
|
+
).optional()
|
|
373
|
+
}).describe(
|
|
374
|
+
"Scope of the coupon. When no scope is defined, the coupon applies to all\nitems in all `namespaces` in the site."
|
|
375
|
+
)
|
|
376
|
+
}),
|
|
377
|
+
z.object({
|
|
378
|
+
scope: z.never().optional(),
|
|
379
|
+
minimumSubtotal: z.number().describe(
|
|
380
|
+
"The coupon is only applicable when the order subtotal is over this amount."
|
|
381
|
+
)
|
|
382
|
+
})
|
|
383
|
+
])
|
|
384
|
+
)
|
|
385
|
+
).describe("The information to use when creating the coupon.").optional(),
|
|
386
|
+
deleted: z.boolean().describe("Whether the referenced coupon was deleted.").optional().nullable()
|
|
387
|
+
}).describe(
|
|
388
|
+
"Reference coupon information for the corresponding [coupon](https://dev.wix.com/docs/rest/business-management/marketing/coupons/coupons/coupon-object)\nthat is created along with the loyalty coupon."
|
|
389
|
+
).optional(),
|
|
390
|
+
status: z.enum(["UNKNOWN", "PENDING", "ACTIVE", "APPLIED", "FAILED", "ARCHIVED"]).describe(
|
|
391
|
+
"Loyalty coupon status.\n\nThis status relates to the corresponding coupon that is created\nat the same time as the loyalty coupon and is included in `couponReference`."
|
|
392
|
+
).optional(),
|
|
393
|
+
rewardName: z.string().describe("Name of reward that was redeemed to create this coupon.").min(1).max(50).optional(),
|
|
394
|
+
revision: z.string().regex(/^\d+$/, "Must be a valid UInt64 string").describe(
|
|
395
|
+
"Revision number, which increments by 1 each time the loyalty coupon is updated.\n\nTo prevent conflicting changes, the current `revision` must be passed when updating the loyalty coupon."
|
|
396
|
+
).optional().nullable(),
|
|
397
|
+
_createdDate: z.date().describe("Date and time the loyalty coupon was created.").optional().nullable(),
|
|
398
|
+
_updatedDate: z.date().describe("Date and time the loyalty coupon was last updated.").optional().nullable(),
|
|
399
|
+
refundable: z.boolean().describe(
|
|
400
|
+
'Whether the loyalty coupon was created in a "refundable workflow" i.e. checkout-exchange, and therefore can be deleted in the background. Refundable coupons should not be visible to customers in the UI.'
|
|
401
|
+
).optional().nullable()
|
|
402
|
+
}).describe("Created loyalty coupon.").optional()
|
|
403
|
+
});
|
|
404
|
+
var GetLoyaltyCouponRequest = z.object({
|
|
405
|
+
loyaltyCouponId: z.string().describe("ID of the loyalty coupon to retrieve.").regex(
|
|
406
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
407
|
+
"Must be a valid GUID"
|
|
408
|
+
)
|
|
409
|
+
});
|
|
410
|
+
var GetLoyaltyCouponResponse = z.object({
|
|
411
|
+
_id: z.string().describe("Loyalty coupon ID.").regex(
|
|
412
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
413
|
+
"Must be a valid GUID"
|
|
414
|
+
).optional(),
|
|
415
|
+
accountId: z.string().describe(
|
|
416
|
+
"Loyalty [account ID](https://dev.wix.com/docs/rest/crm/loyalty-program/accounts/account-object) of the customer that redeemed points for a coupon."
|
|
417
|
+
).regex(
|
|
418
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
419
|
+
"Must be a valid GUID"
|
|
420
|
+
).optional(),
|
|
421
|
+
memberIdDeprecated: z.string().describe(
|
|
422
|
+
"Member ID of the customer that redeemed points for a coupon. See the Members API for more information."
|
|
423
|
+
).regex(
|
|
424
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
425
|
+
"Must be a valid GUID"
|
|
426
|
+
).optional(),
|
|
427
|
+
memberId: z.string().describe(
|
|
428
|
+
"Member ID of the customer that redeemed points for a coupon. See the Members API for more information."
|
|
429
|
+
).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
|
+
transactionId: z.string().describe(
|
|
434
|
+
"[Transaction ID](https://dev.wix.com/docs/rest/crm/loyalty-program/transactions/loyalty-transaction-object) for the transaction that created a coupon."
|
|
435
|
+
).regex(
|
|
436
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
437
|
+
"Must be a valid GUID"
|
|
438
|
+
).optional().nullable(),
|
|
439
|
+
couponReference: z.object({
|
|
440
|
+
couponId: z.string().describe("Coupon ID.").regex(
|
|
441
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
442
|
+
"Must be a valid GUID"
|
|
443
|
+
).optional(),
|
|
444
|
+
code: z.string().describe(
|
|
445
|
+
"Coupon code.\n\nUnique code entered by a customer to apply the coupon."
|
|
446
|
+
).max(20).optional(),
|
|
447
|
+
name: z.string().describe("Name of coupon.").max(80).optional().nullable(),
|
|
448
|
+
specification: z.intersection(
|
|
449
|
+
z.object({
|
|
450
|
+
name: z.string().describe("Name of coupon.").optional().nullable(),
|
|
451
|
+
type: z.enum([
|
|
452
|
+
"UNKNOWN",
|
|
453
|
+
"MONEY_OFF_AMOUNT",
|
|
454
|
+
"PERCENT_OFF_RATE",
|
|
455
|
+
"FREE_SHIPPING",
|
|
456
|
+
"FIXED_PRICE_AMOUNT",
|
|
457
|
+
"BUY_X_GET_Y"
|
|
458
|
+
]).optional(),
|
|
459
|
+
limitedToOneItem: z.boolean().describe(
|
|
460
|
+
"Whether the coupon is limited to 1 discount per order. If true and a customer pays for multiple items\nthat the coupon applies to, only the lowest priced item is discounted.\nCoupons with a `bookings` `namespace` are always limited to 1 item."
|
|
461
|
+
).optional().nullable(),
|
|
462
|
+
appliesToSubscriptions: z.boolean().describe("Whether the coupon also applies to subscriptions.").optional().nullable(),
|
|
463
|
+
discountedCycleCount: z.number().int().describe(
|
|
464
|
+
"Specifies the amount of cycles to apply the discount to for a subscription item.\n\nCan only be set when `appliesToSubscriptions` is `TRUE` and `specification.scope.namespace` is `pricingPlans`.\nIf `discountedCycleCount` is empty, the coupon applies to all available cycles.\n\nMin: `1`\n\nMax: `999`"
|
|
465
|
+
).optional().nullable()
|
|
466
|
+
}),
|
|
467
|
+
z.intersection(
|
|
468
|
+
z.xor([
|
|
469
|
+
z.object({
|
|
470
|
+
moneyOffAmount: z.never().optional(),
|
|
471
|
+
percentOffRate: z.never().optional(),
|
|
472
|
+
freeShipping: z.never().optional(),
|
|
473
|
+
fixedPriceAmount: z.never().optional(),
|
|
474
|
+
buyXGetY: z.never().optional()
|
|
475
|
+
}),
|
|
476
|
+
z.object({
|
|
477
|
+
percentOffRate: z.never().optional(),
|
|
478
|
+
freeShipping: z.never().optional(),
|
|
479
|
+
fixedPriceAmount: z.never().optional(),
|
|
480
|
+
buyXGetY: z.never().optional(),
|
|
481
|
+
moneyOffAmount: z.number().describe("Fixed price discount.").min(0.01)
|
|
482
|
+
}),
|
|
483
|
+
z.object({
|
|
484
|
+
moneyOffAmount: z.never().optional(),
|
|
485
|
+
freeShipping: z.never().optional(),
|
|
486
|
+
fixedPriceAmount: z.never().optional(),
|
|
487
|
+
buyXGetY: z.never().optional(),
|
|
488
|
+
percentOffRate: z.number().describe("Discount as a percentage.")
|
|
489
|
+
}),
|
|
490
|
+
z.object({
|
|
491
|
+
moneyOffAmount: z.never().optional(),
|
|
492
|
+
percentOffRate: z.never().optional(),
|
|
493
|
+
fixedPriceAmount: z.never().optional(),
|
|
494
|
+
buyXGetY: z.never().optional(),
|
|
495
|
+
freeShipping: z.boolean().describe(
|
|
496
|
+
"Free shipping. If true, the coupon applies to all items in all `namespaces` on a site."
|
|
497
|
+
)
|
|
498
|
+
}),
|
|
499
|
+
z.object({
|
|
500
|
+
moneyOffAmount: z.never().optional(),
|
|
501
|
+
percentOffRate: z.never().optional(),
|
|
502
|
+
freeShipping: z.never().optional(),
|
|
503
|
+
buyXGetY: z.never().optional(),
|
|
504
|
+
fixedPriceAmount: z.number().describe(
|
|
505
|
+
"Specific sale price. Currently only supported for coupons with a `stores` `namespace`."
|
|
506
|
+
)
|
|
507
|
+
}),
|
|
508
|
+
z.object({
|
|
509
|
+
moneyOffAmount: z.never().optional(),
|
|
510
|
+
percentOffRate: z.never().optional(),
|
|
511
|
+
freeShipping: z.never().optional(),
|
|
512
|
+
fixedPriceAmount: z.never().optional(),
|
|
513
|
+
buyXGetY: z.object({
|
|
514
|
+
x: z.number().int().describe(
|
|
515
|
+
"Number of purchased items required to receive free items."
|
|
516
|
+
).optional(),
|
|
517
|
+
y: z.number().int().describe(
|
|
518
|
+
"Number of items received for free if required number of items were purchased."
|
|
519
|
+
).optional()
|
|
520
|
+
}).describe(
|
|
521
|
+
"Free products when making a purchase. `buyXGetY` is an object that specifies `x` and `y` in the\nfollowing scenario: if a visitor purchases x number of products, they receive y number of products for free. C\nurrently only supported for coupons with a `stores` `namespace`."
|
|
522
|
+
)
|
|
523
|
+
})
|
|
524
|
+
]),
|
|
525
|
+
z.xor([
|
|
526
|
+
z.object({
|
|
527
|
+
scope: z.never().optional(),
|
|
528
|
+
minimumSubtotal: z.never().optional()
|
|
529
|
+
}),
|
|
530
|
+
z.object({
|
|
531
|
+
minimumSubtotal: z.never().optional(),
|
|
532
|
+
scope: z.object({
|
|
533
|
+
name: z.string().describe(
|
|
534
|
+
"Group within a `namespace` for which the coupon is applicable.\n\nIf no group is specified, the coupon applies to all items in the namespace.\n`group` is required in some namespaces. See [Scope Values](https://dev.wix.com/api/rest/coupons/coupons/valid-scope-values)\nfor a list of currently supported groups for each namespace."
|
|
535
|
+
).optional().nullable(),
|
|
536
|
+
entityId: z.string().describe(
|
|
537
|
+
"ID of the specific entity in the group for which the coupon is applicable.\n\nIf no `entityId` is specified, the coupon applies to all entities in the group. In some cases when a group is specified,\nan `entityId` is required. See [Scope Values](https://dev.wix.com/api/rest/coupons/coupons/valid-scope-values)\nfor a list of currently supported entities for each namespace and group."
|
|
538
|
+
).optional().nullable(),
|
|
539
|
+
namespace: z.string().describe(
|
|
540
|
+
'Wix application for which the coupon is applicable.\n\nOne of the following:\n+ `"stores"`\n+ `"bookings"`\n+ `"events"`\n+ `"pricingPlans"`'
|
|
541
|
+
).optional()
|
|
542
|
+
}).describe(
|
|
543
|
+
"Scope of the coupon. When no scope is defined, the coupon applies to all\nitems in all `namespaces` in the site."
|
|
544
|
+
)
|
|
545
|
+
}),
|
|
546
|
+
z.object({
|
|
547
|
+
scope: z.never().optional(),
|
|
548
|
+
minimumSubtotal: z.number().describe(
|
|
549
|
+
"The coupon is only applicable when the order subtotal is over this amount."
|
|
550
|
+
)
|
|
551
|
+
})
|
|
552
|
+
])
|
|
553
|
+
)
|
|
554
|
+
).describe("The information to use when creating the coupon.").optional(),
|
|
555
|
+
deleted: z.boolean().describe("Whether the referenced coupon was deleted.").optional().nullable()
|
|
556
|
+
}).describe(
|
|
557
|
+
"Reference coupon information for the corresponding [coupon](https://dev.wix.com/docs/rest/business-management/marketing/coupons/coupons/coupon-object)\nthat is created along with the loyalty coupon."
|
|
558
|
+
).optional(),
|
|
559
|
+
status: z.enum(["UNKNOWN", "PENDING", "ACTIVE", "APPLIED", "FAILED", "ARCHIVED"]).describe(
|
|
560
|
+
"Loyalty coupon status.\n\nThis status relates to the corresponding coupon that is created\nat the same time as the loyalty coupon and is included in `couponReference`."
|
|
561
|
+
).optional(),
|
|
562
|
+
rewardName: z.string().describe("Name of reward that was redeemed to create this coupon.").min(1).max(50).optional(),
|
|
563
|
+
revision: z.string().regex(/^\d+$/, "Must be a valid UInt64 string").describe(
|
|
564
|
+
"Revision number, which increments by 1 each time the loyalty coupon is updated.\n\nTo prevent conflicting changes, the current `revision` must be passed when updating the loyalty coupon."
|
|
565
|
+
).optional().nullable(),
|
|
566
|
+
_createdDate: z.date().describe("Date and time the loyalty coupon was created.").optional().nullable(),
|
|
567
|
+
_updatedDate: z.date().describe("Date and time the loyalty coupon was last updated.").optional().nullable(),
|
|
568
|
+
refundable: z.boolean().describe(
|
|
569
|
+
'Whether the loyalty coupon was created in a "refundable workflow" i.e. checkout-exchange, and therefore can be deleted in the background. Refundable coupons should not be visible to customers in the UI.'
|
|
570
|
+
).optional().nullable()
|
|
571
|
+
});
|
|
572
|
+
var BulkGetLoyaltyCouponRequest = z.object({
|
|
573
|
+
options: z.object({
|
|
574
|
+
query: z.intersection(
|
|
575
|
+
z.object({
|
|
576
|
+
filter: z.record(z.string(), z.any()).describe(
|
|
577
|
+
"Filter object.\n\nLearn more about [filtering](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#filters)."
|
|
578
|
+
).optional().nullable(),
|
|
579
|
+
sort: z.array(
|
|
580
|
+
z.object({
|
|
581
|
+
fieldName: z.string().describe("Name of the field to sort by.").max(512).optional(),
|
|
582
|
+
order: z.enum(["ASC", "DESC"]).optional()
|
|
583
|
+
})
|
|
584
|
+
).max(5).optional()
|
|
585
|
+
}),
|
|
586
|
+
z.xor([
|
|
587
|
+
z.object({ cursorPaging: z.never().optional() }),
|
|
588
|
+
z.object({
|
|
589
|
+
cursorPaging: z.object({
|
|
590
|
+
limit: z.number().int().describe(
|
|
591
|
+
"Maximum number of items to return in the results."
|
|
592
|
+
).min(0).max(100).optional().nullable(),
|
|
593
|
+
cursor: z.string().describe(
|
|
594
|
+
"Pointer to the next or previous page in the list of results.\n\nPass the relevant cursor token from the `pagingMetadata` object in the previous call's response.\nNot relevant for the first request."
|
|
595
|
+
).max(16e3).optional().nullable()
|
|
596
|
+
}).describe(
|
|
597
|
+
"Cursor paging options.\n\nLearn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging)."
|
|
598
|
+
)
|
|
599
|
+
})
|
|
600
|
+
])
|
|
601
|
+
).describe("Query to filter loyalty coupons.").optional()
|
|
602
|
+
}).optional()
|
|
603
|
+
});
|
|
604
|
+
var BulkGetLoyaltyCouponResponse = z.object({
|
|
605
|
+
couponsInSite: z.array(
|
|
606
|
+
z.object({
|
|
607
|
+
metaSiteId: z.string().describe("Metasite ID.").regex(
|
|
608
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
609
|
+
"Must be a valid GUID"
|
|
610
|
+
).optional(),
|
|
611
|
+
loyaltyCoupons: z.array(
|
|
612
|
+
z.object({
|
|
613
|
+
_id: z.string().describe("Loyalty coupon ID.").regex(
|
|
614
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
615
|
+
"Must be a valid GUID"
|
|
616
|
+
).optional(),
|
|
617
|
+
accountId: z.string().describe(
|
|
618
|
+
"Loyalty [account ID](https://dev.wix.com/docs/rest/crm/loyalty-program/accounts/account-object) of the customer that redeemed points for a coupon."
|
|
619
|
+
).regex(
|
|
620
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
621
|
+
"Must be a valid GUID"
|
|
622
|
+
).optional(),
|
|
623
|
+
memberIdDeprecated: z.string().describe(
|
|
624
|
+
"Member ID of the customer that redeemed points for a coupon. See the Members API for more information."
|
|
625
|
+
).regex(
|
|
626
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
627
|
+
"Must be a valid GUID"
|
|
628
|
+
).optional(),
|
|
629
|
+
memberId: z.string().describe(
|
|
630
|
+
"Member ID of the customer that redeemed points for a coupon. See the Members API for more information."
|
|
631
|
+
).regex(
|
|
632
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
633
|
+
"Must be a valid GUID"
|
|
634
|
+
).optional().nullable(),
|
|
635
|
+
transactionId: z.string().describe(
|
|
636
|
+
"[Transaction ID](https://dev.wix.com/docs/rest/crm/loyalty-program/transactions/loyalty-transaction-object) for the transaction that created a coupon."
|
|
637
|
+
).regex(
|
|
638
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
639
|
+
"Must be a valid GUID"
|
|
640
|
+
).optional().nullable(),
|
|
641
|
+
couponReference: z.object({
|
|
642
|
+
couponId: z.string().describe("Coupon ID.").regex(
|
|
643
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
644
|
+
"Must be a valid GUID"
|
|
645
|
+
).optional(),
|
|
646
|
+
code: z.string().describe(
|
|
647
|
+
"Coupon code.\n\nUnique code entered by a customer to apply the coupon."
|
|
648
|
+
).max(20).optional(),
|
|
649
|
+
name: z.string().describe("Name of coupon.").max(80).optional().nullable(),
|
|
650
|
+
specification: z.intersection(
|
|
651
|
+
z.object({
|
|
652
|
+
name: z.string().describe("Name of coupon.").optional().nullable(),
|
|
653
|
+
type: z.enum([
|
|
654
|
+
"UNKNOWN",
|
|
655
|
+
"MONEY_OFF_AMOUNT",
|
|
656
|
+
"PERCENT_OFF_RATE",
|
|
657
|
+
"FREE_SHIPPING",
|
|
658
|
+
"FIXED_PRICE_AMOUNT",
|
|
659
|
+
"BUY_X_GET_Y"
|
|
660
|
+
]).optional(),
|
|
661
|
+
limitedToOneItem: z.boolean().describe(
|
|
662
|
+
"Whether the coupon is limited to 1 discount per order. If true and a customer pays for multiple items\nthat the coupon applies to, only the lowest priced item is discounted.\nCoupons with a `bookings` `namespace` are always limited to 1 item."
|
|
663
|
+
).optional().nullable(),
|
|
664
|
+
appliesToSubscriptions: z.boolean().describe(
|
|
665
|
+
"Whether the coupon also applies to subscriptions."
|
|
666
|
+
).optional().nullable(),
|
|
667
|
+
discountedCycleCount: z.number().int().describe(
|
|
668
|
+
"Specifies the amount of cycles to apply the discount to for a subscription item.\n\nCan only be set when `appliesToSubscriptions` is `TRUE` and `specification.scope.namespace` is `pricingPlans`.\nIf `discountedCycleCount` is empty, the coupon applies to all available cycles.\n\nMin: `1`\n\nMax: `999`"
|
|
669
|
+
).optional().nullable()
|
|
670
|
+
}),
|
|
671
|
+
z.intersection(
|
|
672
|
+
z.xor([
|
|
673
|
+
z.object({
|
|
674
|
+
moneyOffAmount: z.never().optional(),
|
|
675
|
+
percentOffRate: z.never().optional(),
|
|
676
|
+
freeShipping: z.never().optional(),
|
|
677
|
+
fixedPriceAmount: z.never().optional(),
|
|
678
|
+
buyXGetY: z.never().optional()
|
|
679
|
+
}),
|
|
680
|
+
z.object({
|
|
681
|
+
percentOffRate: z.never().optional(),
|
|
682
|
+
freeShipping: z.never().optional(),
|
|
683
|
+
fixedPriceAmount: z.never().optional(),
|
|
684
|
+
buyXGetY: z.never().optional(),
|
|
685
|
+
moneyOffAmount: z.number().describe("Fixed price discount.").min(0.01)
|
|
686
|
+
}),
|
|
687
|
+
z.object({
|
|
688
|
+
moneyOffAmount: z.never().optional(),
|
|
689
|
+
freeShipping: z.never().optional(),
|
|
690
|
+
fixedPriceAmount: z.never().optional(),
|
|
691
|
+
buyXGetY: z.never().optional(),
|
|
692
|
+
percentOffRate: z.number().describe("Discount as a percentage.")
|
|
693
|
+
}),
|
|
694
|
+
z.object({
|
|
695
|
+
moneyOffAmount: z.never().optional(),
|
|
696
|
+
percentOffRate: z.never().optional(),
|
|
697
|
+
fixedPriceAmount: z.never().optional(),
|
|
698
|
+
buyXGetY: z.never().optional(),
|
|
699
|
+
freeShipping: z.boolean().describe(
|
|
700
|
+
"Free shipping. If true, the coupon applies to all items in all `namespaces` on a site."
|
|
701
|
+
)
|
|
702
|
+
}),
|
|
703
|
+
z.object({
|
|
704
|
+
moneyOffAmount: z.never().optional(),
|
|
705
|
+
percentOffRate: z.never().optional(),
|
|
706
|
+
freeShipping: z.never().optional(),
|
|
707
|
+
buyXGetY: z.never().optional(),
|
|
708
|
+
fixedPriceAmount: z.number().describe(
|
|
709
|
+
"Specific sale price. Currently only supported for coupons with a `stores` `namespace`."
|
|
710
|
+
)
|
|
711
|
+
}),
|
|
712
|
+
z.object({
|
|
713
|
+
moneyOffAmount: z.never().optional(),
|
|
714
|
+
percentOffRate: z.never().optional(),
|
|
715
|
+
freeShipping: z.never().optional(),
|
|
716
|
+
fixedPriceAmount: z.never().optional(),
|
|
717
|
+
buyXGetY: z.object({
|
|
718
|
+
x: z.number().int().describe(
|
|
719
|
+
"Number of purchased items required to receive free items."
|
|
720
|
+
).optional(),
|
|
721
|
+
y: z.number().int().describe(
|
|
722
|
+
"Number of items received for free if required number of items were purchased."
|
|
723
|
+
).optional()
|
|
724
|
+
}).describe(
|
|
725
|
+
"Free products when making a purchase. `buyXGetY` is an object that specifies `x` and `y` in the\nfollowing scenario: if a visitor purchases x number of products, they receive y number of products for free. C\nurrently only supported for coupons with a `stores` `namespace`."
|
|
726
|
+
)
|
|
727
|
+
})
|
|
728
|
+
]),
|
|
729
|
+
z.xor([
|
|
730
|
+
z.object({
|
|
731
|
+
scope: z.never().optional(),
|
|
732
|
+
minimumSubtotal: z.never().optional()
|
|
733
|
+
}),
|
|
734
|
+
z.object({
|
|
735
|
+
minimumSubtotal: z.never().optional(),
|
|
736
|
+
scope: z.object({
|
|
737
|
+
name: z.string().describe(
|
|
738
|
+
"Group within a `namespace` for which the coupon is applicable.\n\nIf no group is specified, the coupon applies to all items in the namespace.\n`group` is required in some namespaces. See [Scope Values](https://dev.wix.com/api/rest/coupons/coupons/valid-scope-values)\nfor a list of currently supported groups for each namespace."
|
|
739
|
+
).optional().nullable(),
|
|
740
|
+
entityId: z.string().describe(
|
|
741
|
+
"ID of the specific entity in the group for which the coupon is applicable.\n\nIf no `entityId` is specified, the coupon applies to all entities in the group. In some cases when a group is specified,\nan `entityId` is required. See [Scope Values](https://dev.wix.com/api/rest/coupons/coupons/valid-scope-values)\nfor a list of currently supported entities for each namespace and group."
|
|
742
|
+
).optional().nullable(),
|
|
743
|
+
namespace: z.string().describe(
|
|
744
|
+
'Wix application for which the coupon is applicable.\n\nOne of the following:\n+ `"stores"`\n+ `"bookings"`\n+ `"events"`\n+ `"pricingPlans"`'
|
|
745
|
+
).optional()
|
|
746
|
+
}).describe(
|
|
747
|
+
"Scope of the coupon. When no scope is defined, the coupon applies to all\nitems in all `namespaces` in the site."
|
|
748
|
+
)
|
|
749
|
+
}),
|
|
750
|
+
z.object({
|
|
751
|
+
scope: z.never().optional(),
|
|
752
|
+
minimumSubtotal: z.number().describe(
|
|
753
|
+
"The coupon is only applicable when the order subtotal is over this amount."
|
|
754
|
+
)
|
|
755
|
+
})
|
|
756
|
+
])
|
|
757
|
+
)
|
|
758
|
+
).describe(
|
|
759
|
+
"The information to use when creating the coupon."
|
|
760
|
+
).optional(),
|
|
761
|
+
deleted: z.boolean().describe("Whether the referenced coupon was deleted.").optional().nullable()
|
|
762
|
+
}).describe(
|
|
763
|
+
"Reference coupon information for the corresponding [coupon](https://dev.wix.com/docs/rest/business-management/marketing/coupons/coupons/coupon-object)\nthat is created along with the loyalty coupon."
|
|
764
|
+
).optional(),
|
|
765
|
+
status: z.enum([
|
|
766
|
+
"UNKNOWN",
|
|
767
|
+
"PENDING",
|
|
768
|
+
"ACTIVE",
|
|
769
|
+
"APPLIED",
|
|
770
|
+
"FAILED",
|
|
771
|
+
"ARCHIVED"
|
|
772
|
+
]).describe(
|
|
773
|
+
"Loyalty coupon status.\n\nThis status relates to the corresponding coupon that is created\nat the same time as the loyalty coupon and is included in `couponReference`."
|
|
774
|
+
).optional(),
|
|
775
|
+
rewardName: z.string().describe(
|
|
776
|
+
"Name of reward that was redeemed to create this coupon."
|
|
777
|
+
).min(1).max(50).optional(),
|
|
778
|
+
revision: z.string().regex(/^\d+$/, "Must be a valid UInt64 string").describe(
|
|
779
|
+
"Revision number, which increments by 1 each time the loyalty coupon is updated.\n\nTo prevent conflicting changes, the current `revision` must be passed when updating the loyalty coupon."
|
|
780
|
+
).optional().nullable(),
|
|
781
|
+
_createdDate: z.date().describe("Date and time the loyalty coupon was created.").optional().nullable(),
|
|
782
|
+
_updatedDate: z.date().describe("Date and time the loyalty coupon was last updated.").optional().nullable(),
|
|
783
|
+
refundable: z.boolean().describe(
|
|
784
|
+
'Whether the loyalty coupon was created in a "refundable workflow" i.e. checkout-exchange, and therefore can be deleted in the background. Refundable coupons should not be visible to customers in the UI.'
|
|
785
|
+
).optional().nullable()
|
|
786
|
+
})
|
|
787
|
+
).max(100).optional()
|
|
788
|
+
})
|
|
789
|
+
).max(100).optional()
|
|
790
|
+
});
|
|
791
|
+
var GetCurrentMemberCouponsRequest = z.object({});
|
|
792
|
+
var GetCurrentMemberCouponsResponse = z.object({
|
|
793
|
+
loyaltyCoupons: z.array(
|
|
794
|
+
z.object({
|
|
795
|
+
_id: z.string().describe("Loyalty coupon ID.").regex(
|
|
796
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
797
|
+
"Must be a valid GUID"
|
|
798
|
+
).optional(),
|
|
799
|
+
accountId: z.string().describe(
|
|
800
|
+
"Loyalty [account ID](https://dev.wix.com/docs/rest/crm/loyalty-program/accounts/account-object) of the customer that redeemed points for a coupon."
|
|
801
|
+
).regex(
|
|
802
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
803
|
+
"Must be a valid GUID"
|
|
804
|
+
).optional(),
|
|
805
|
+
memberIdDeprecated: z.string().describe(
|
|
806
|
+
"Member ID of the customer that redeemed points for a coupon. See the Members API for more information."
|
|
807
|
+
).regex(
|
|
808
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
809
|
+
"Must be a valid GUID"
|
|
810
|
+
).optional(),
|
|
811
|
+
memberId: z.string().describe(
|
|
812
|
+
"Member ID of the customer that redeemed points for a coupon. See the Members API for more information."
|
|
813
|
+
).regex(
|
|
814
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
815
|
+
"Must be a valid GUID"
|
|
816
|
+
).optional().nullable(),
|
|
817
|
+
transactionId: z.string().describe(
|
|
818
|
+
"[Transaction ID](https://dev.wix.com/docs/rest/crm/loyalty-program/transactions/loyalty-transaction-object) for the transaction that created a coupon."
|
|
819
|
+
).regex(
|
|
820
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
821
|
+
"Must be a valid GUID"
|
|
822
|
+
).optional().nullable(),
|
|
823
|
+
couponReference: z.object({
|
|
824
|
+
couponId: z.string().describe("Coupon ID.").regex(
|
|
825
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
826
|
+
"Must be a valid GUID"
|
|
827
|
+
).optional(),
|
|
828
|
+
code: z.string().describe(
|
|
829
|
+
"Coupon code.\n\nUnique code entered by a customer to apply the coupon."
|
|
830
|
+
).max(20).optional(),
|
|
831
|
+
name: z.string().describe("Name of coupon.").max(80).optional().nullable(),
|
|
832
|
+
specification: z.intersection(
|
|
833
|
+
z.object({
|
|
834
|
+
name: z.string().describe("Name of coupon.").optional().nullable(),
|
|
835
|
+
type: z.enum([
|
|
836
|
+
"UNKNOWN",
|
|
837
|
+
"MONEY_OFF_AMOUNT",
|
|
838
|
+
"PERCENT_OFF_RATE",
|
|
839
|
+
"FREE_SHIPPING",
|
|
840
|
+
"FIXED_PRICE_AMOUNT",
|
|
841
|
+
"BUY_X_GET_Y"
|
|
842
|
+
]).optional(),
|
|
843
|
+
limitedToOneItem: z.boolean().describe(
|
|
844
|
+
"Whether the coupon is limited to 1 discount per order. If true and a customer pays for multiple items\nthat the coupon applies to, only the lowest priced item is discounted.\nCoupons with a `bookings` `namespace` are always limited to 1 item."
|
|
845
|
+
).optional().nullable(),
|
|
846
|
+
appliesToSubscriptions: z.boolean().describe(
|
|
847
|
+
"Whether the coupon also applies to subscriptions."
|
|
848
|
+
).optional().nullable(),
|
|
849
|
+
discountedCycleCount: z.number().int().describe(
|
|
850
|
+
"Specifies the amount of cycles to apply the discount to for a subscription item.\n\nCan only be set when `appliesToSubscriptions` is `TRUE` and `specification.scope.namespace` is `pricingPlans`.\nIf `discountedCycleCount` is empty, the coupon applies to all available cycles.\n\nMin: `1`\n\nMax: `999`"
|
|
851
|
+
).optional().nullable()
|
|
852
|
+
}),
|
|
853
|
+
z.intersection(
|
|
854
|
+
z.xor([
|
|
855
|
+
z.object({
|
|
856
|
+
moneyOffAmount: z.never().optional(),
|
|
857
|
+
percentOffRate: z.never().optional(),
|
|
858
|
+
freeShipping: z.never().optional(),
|
|
859
|
+
fixedPriceAmount: z.never().optional(),
|
|
860
|
+
buyXGetY: z.never().optional()
|
|
861
|
+
}),
|
|
862
|
+
z.object({
|
|
863
|
+
percentOffRate: z.never().optional(),
|
|
864
|
+
freeShipping: z.never().optional(),
|
|
865
|
+
fixedPriceAmount: z.never().optional(),
|
|
866
|
+
buyXGetY: z.never().optional(),
|
|
867
|
+
moneyOffAmount: z.number().describe("Fixed price discount.").min(0.01)
|
|
868
|
+
}),
|
|
869
|
+
z.object({
|
|
870
|
+
moneyOffAmount: z.never().optional(),
|
|
871
|
+
freeShipping: z.never().optional(),
|
|
872
|
+
fixedPriceAmount: z.never().optional(),
|
|
873
|
+
buyXGetY: z.never().optional(),
|
|
874
|
+
percentOffRate: z.number().describe("Discount as a percentage.")
|
|
875
|
+
}),
|
|
876
|
+
z.object({
|
|
877
|
+
moneyOffAmount: z.never().optional(),
|
|
878
|
+
percentOffRate: z.never().optional(),
|
|
879
|
+
fixedPriceAmount: z.never().optional(),
|
|
880
|
+
buyXGetY: z.never().optional(),
|
|
881
|
+
freeShipping: z.boolean().describe(
|
|
882
|
+
"Free shipping. If true, the coupon applies to all items in all `namespaces` on a site."
|
|
883
|
+
)
|
|
884
|
+
}),
|
|
885
|
+
z.object({
|
|
886
|
+
moneyOffAmount: z.never().optional(),
|
|
887
|
+
percentOffRate: z.never().optional(),
|
|
888
|
+
freeShipping: z.never().optional(),
|
|
889
|
+
buyXGetY: z.never().optional(),
|
|
890
|
+
fixedPriceAmount: z.number().describe(
|
|
891
|
+
"Specific sale price. Currently only supported for coupons with a `stores` `namespace`."
|
|
892
|
+
)
|
|
893
|
+
}),
|
|
894
|
+
z.object({
|
|
895
|
+
moneyOffAmount: z.never().optional(),
|
|
896
|
+
percentOffRate: z.never().optional(),
|
|
897
|
+
freeShipping: z.never().optional(),
|
|
898
|
+
fixedPriceAmount: z.never().optional(),
|
|
899
|
+
buyXGetY: z.object({
|
|
900
|
+
x: z.number().int().describe(
|
|
901
|
+
"Number of purchased items required to receive free items."
|
|
902
|
+
).optional(),
|
|
903
|
+
y: z.number().int().describe(
|
|
904
|
+
"Number of items received for free if required number of items were purchased."
|
|
905
|
+
).optional()
|
|
906
|
+
}).describe(
|
|
907
|
+
"Free products when making a purchase. `buyXGetY` is an object that specifies `x` and `y` in the\nfollowing scenario: if a visitor purchases x number of products, they receive y number of products for free. C\nurrently only supported for coupons with a `stores` `namespace`."
|
|
908
|
+
)
|
|
909
|
+
})
|
|
910
|
+
]),
|
|
911
|
+
z.xor([
|
|
912
|
+
z.object({
|
|
913
|
+
scope: z.never().optional(),
|
|
914
|
+
minimumSubtotal: z.never().optional()
|
|
915
|
+
}),
|
|
916
|
+
z.object({
|
|
917
|
+
minimumSubtotal: z.never().optional(),
|
|
918
|
+
scope: z.object({
|
|
919
|
+
name: z.string().describe(
|
|
920
|
+
"Group within a `namespace` for which the coupon is applicable.\n\nIf no group is specified, the coupon applies to all items in the namespace.\n`group` is required in some namespaces. See [Scope Values](https://dev.wix.com/api/rest/coupons/coupons/valid-scope-values)\nfor a list of currently supported groups for each namespace."
|
|
921
|
+
).optional().nullable(),
|
|
922
|
+
entityId: z.string().describe(
|
|
923
|
+
"ID of the specific entity in the group for which the coupon is applicable.\n\nIf no `entityId` is specified, the coupon applies to all entities in the group. In some cases when a group is specified,\nan `entityId` is required. See [Scope Values](https://dev.wix.com/api/rest/coupons/coupons/valid-scope-values)\nfor a list of currently supported entities for each namespace and group."
|
|
924
|
+
).optional().nullable(),
|
|
925
|
+
namespace: z.string().describe(
|
|
926
|
+
'Wix application for which the coupon is applicable.\n\nOne of the following:\n+ `"stores"`\n+ `"bookings"`\n+ `"events"`\n+ `"pricingPlans"`'
|
|
927
|
+
).optional()
|
|
928
|
+
}).describe(
|
|
929
|
+
"Scope of the coupon. When no scope is defined, the coupon applies to all\nitems in all `namespaces` in the site."
|
|
930
|
+
)
|
|
931
|
+
}),
|
|
932
|
+
z.object({
|
|
933
|
+
scope: z.never().optional(),
|
|
934
|
+
minimumSubtotal: z.number().describe(
|
|
935
|
+
"The coupon is only applicable when the order subtotal is over this amount."
|
|
936
|
+
)
|
|
937
|
+
})
|
|
938
|
+
])
|
|
939
|
+
)
|
|
940
|
+
).describe("The information to use when creating the coupon.").optional(),
|
|
941
|
+
deleted: z.boolean().describe("Whether the referenced coupon was deleted.").optional().nullable()
|
|
942
|
+
}).describe(
|
|
943
|
+
"Reference coupon information for the corresponding [coupon](https://dev.wix.com/docs/rest/business-management/marketing/coupons/coupons/coupon-object)\nthat is created along with the loyalty coupon."
|
|
944
|
+
).optional(),
|
|
945
|
+
status: z.enum([
|
|
946
|
+
"UNKNOWN",
|
|
947
|
+
"PENDING",
|
|
948
|
+
"ACTIVE",
|
|
949
|
+
"APPLIED",
|
|
950
|
+
"FAILED",
|
|
951
|
+
"ARCHIVED"
|
|
952
|
+
]).describe(
|
|
953
|
+
"Loyalty coupon status.\n\nThis status relates to the corresponding coupon that is created\nat the same time as the loyalty coupon and is included in `couponReference`."
|
|
954
|
+
).optional(),
|
|
955
|
+
rewardName: z.string().describe("Name of reward that was redeemed to create this coupon.").min(1).max(50).optional(),
|
|
956
|
+
revision: z.string().regex(/^\d+$/, "Must be a valid UInt64 string").describe(
|
|
957
|
+
"Revision number, which increments by 1 each time the loyalty coupon is updated.\n\nTo prevent conflicting changes, the current `revision` must be passed when updating the loyalty coupon."
|
|
958
|
+
).optional().nullable(),
|
|
959
|
+
_createdDate: z.date().describe("Date and time the loyalty coupon was created.").optional().nullable(),
|
|
960
|
+
_updatedDate: z.date().describe("Date and time the loyalty coupon was last updated.").optional().nullable(),
|
|
961
|
+
refundable: z.boolean().describe(
|
|
962
|
+
'Whether the loyalty coupon was created in a "refundable workflow" i.e. checkout-exchange, and therefore can be deleted in the background. Refundable coupons should not be visible to customers in the UI.'
|
|
963
|
+
).optional().nullable()
|
|
964
|
+
})
|
|
965
|
+
).optional()
|
|
966
|
+
});
|
|
967
|
+
var QueryLoyaltyCouponsRequest = z.object({
|
|
968
|
+
query: z.object({
|
|
969
|
+
filter: z.object({
|
|
970
|
+
accountId: z.object({
|
|
971
|
+
$eq: z.string(),
|
|
972
|
+
$exists: z.boolean(),
|
|
973
|
+
$gt: z.string(),
|
|
974
|
+
$gte: z.string(),
|
|
975
|
+
$hasAll: z.array(z.string()),
|
|
976
|
+
$hasSome: z.array(z.string()),
|
|
977
|
+
$in: z.array(z.string()),
|
|
978
|
+
$lt: z.string(),
|
|
979
|
+
$lte: z.string(),
|
|
980
|
+
$ne: z.string(),
|
|
981
|
+
$nin: z.array(z.string()),
|
|
982
|
+
$startsWith: z.string()
|
|
983
|
+
}).partial().strict().optional(),
|
|
984
|
+
memberId: z.object({
|
|
985
|
+
$eq: z.string(),
|
|
986
|
+
$exists: z.boolean(),
|
|
987
|
+
$gt: z.string(),
|
|
988
|
+
$gte: z.string(),
|
|
989
|
+
$hasAll: z.array(z.string()),
|
|
990
|
+
$hasSome: z.array(z.string()),
|
|
991
|
+
$in: z.array(z.string()),
|
|
992
|
+
$lt: z.string(),
|
|
993
|
+
$lte: z.string(),
|
|
994
|
+
$ne: z.string(),
|
|
995
|
+
$nin: z.array(z.string()),
|
|
996
|
+
$startsWith: z.string()
|
|
997
|
+
}).partial().strict().optional(),
|
|
998
|
+
transactionId: z.object({
|
|
999
|
+
$eq: z.string(),
|
|
1000
|
+
$exists: z.boolean(),
|
|
1001
|
+
$gt: z.string(),
|
|
1002
|
+
$gte: z.string(),
|
|
1003
|
+
$hasAll: z.array(z.string()),
|
|
1004
|
+
$hasSome: z.array(z.string()),
|
|
1005
|
+
$in: z.array(z.string()),
|
|
1006
|
+
$lt: z.string(),
|
|
1007
|
+
$lte: z.string(),
|
|
1008
|
+
$ne: z.string(),
|
|
1009
|
+
$nin: z.array(z.string()),
|
|
1010
|
+
$startsWith: z.string()
|
|
1011
|
+
}).partial().strict().optional(),
|
|
1012
|
+
couponReference: z.object({
|
|
1013
|
+
$eq: z.any(),
|
|
1014
|
+
$exists: z.boolean(),
|
|
1015
|
+
$gt: z.any(),
|
|
1016
|
+
$gte: z.any(),
|
|
1017
|
+
$hasAll: z.array(z.any()),
|
|
1018
|
+
$hasSome: z.array(z.any()),
|
|
1019
|
+
$in: z.array(z.any()),
|
|
1020
|
+
$lt: z.any(),
|
|
1021
|
+
$lte: z.any(),
|
|
1022
|
+
$ne: z.any(),
|
|
1023
|
+
$nin: z.array(z.any()),
|
|
1024
|
+
$startsWith: z.string()
|
|
1025
|
+
}).partial().strict().optional(),
|
|
1026
|
+
status: z.object({
|
|
1027
|
+
$eq: z.string(),
|
|
1028
|
+
$exists: z.boolean(),
|
|
1029
|
+
$gt: z.string(),
|
|
1030
|
+
$gte: z.string(),
|
|
1031
|
+
$hasAll: z.array(z.string()),
|
|
1032
|
+
$hasSome: z.array(z.string()),
|
|
1033
|
+
$in: z.array(z.string()),
|
|
1034
|
+
$lt: z.string(),
|
|
1035
|
+
$lte: z.string(),
|
|
1036
|
+
$ne: z.string(),
|
|
1037
|
+
$nin: z.array(z.string()),
|
|
1038
|
+
$startsWith: z.string()
|
|
1039
|
+
}).partial().strict().optional(),
|
|
1040
|
+
rewardName: z.object({
|
|
1041
|
+
$eq: z.string(),
|
|
1042
|
+
$exists: z.boolean(),
|
|
1043
|
+
$gt: z.string(),
|
|
1044
|
+
$gte: z.string(),
|
|
1045
|
+
$hasAll: z.array(z.string()),
|
|
1046
|
+
$hasSome: z.array(z.string()),
|
|
1047
|
+
$in: z.array(z.string()),
|
|
1048
|
+
$lt: z.string(),
|
|
1049
|
+
$lte: z.string(),
|
|
1050
|
+
$ne: z.string(),
|
|
1051
|
+
$nin: z.array(z.string()),
|
|
1052
|
+
$startsWith: z.string()
|
|
1053
|
+
}).partial().strict().optional(),
|
|
1054
|
+
_createdDate: z.object({
|
|
1055
|
+
$eq: z.string(),
|
|
1056
|
+
$exists: z.boolean(),
|
|
1057
|
+
$gt: z.string(),
|
|
1058
|
+
$gte: z.string(),
|
|
1059
|
+
$hasAll: z.array(z.string()),
|
|
1060
|
+
$hasSome: z.array(z.string()),
|
|
1061
|
+
$in: z.array(z.string()),
|
|
1062
|
+
$lt: z.string(),
|
|
1063
|
+
$lte: z.string(),
|
|
1064
|
+
$ne: z.string(),
|
|
1065
|
+
$nin: z.array(z.string()),
|
|
1066
|
+
$startsWith: z.string()
|
|
1067
|
+
}).partial().strict().optional(),
|
|
1068
|
+
_updatedDate: z.object({
|
|
1069
|
+
$eq: z.string(),
|
|
1070
|
+
$exists: z.boolean(),
|
|
1071
|
+
$gt: z.string(),
|
|
1072
|
+
$gte: z.string(),
|
|
1073
|
+
$hasAll: z.array(z.string()),
|
|
1074
|
+
$hasSome: z.array(z.string()),
|
|
1075
|
+
$in: z.array(z.string()),
|
|
1076
|
+
$lt: z.string(),
|
|
1077
|
+
$lte: z.string(),
|
|
1078
|
+
$ne: z.string(),
|
|
1079
|
+
$nin: z.array(z.string()),
|
|
1080
|
+
$startsWith: z.string()
|
|
1081
|
+
}).partial().strict().optional(),
|
|
1082
|
+
$and: z.array(z.any()).optional(),
|
|
1083
|
+
$or: z.array(z.any()).optional(),
|
|
1084
|
+
$not: z.any().optional()
|
|
1085
|
+
}).strict().optional(),
|
|
1086
|
+
sort: z.array(
|
|
1087
|
+
z.object({
|
|
1088
|
+
fieldName: z.enum([
|
|
1089
|
+
"accountId",
|
|
1090
|
+
"memberId",
|
|
1091
|
+
"transactionId",
|
|
1092
|
+
"couponReference",
|
|
1093
|
+
"status",
|
|
1094
|
+
"rewardName",
|
|
1095
|
+
"_createdDate",
|
|
1096
|
+
"_updatedDate"
|
|
1097
|
+
]).optional(),
|
|
1098
|
+
order: z.enum(["ASC", "DESC"]).optional()
|
|
1099
|
+
})
|
|
1100
|
+
).optional()
|
|
1101
|
+
}).catchall(z.any()).describe("Query options.")
|
|
1102
|
+
});
|
|
1103
|
+
var QueryLoyaltyCouponsResponse = z.object({
|
|
1104
|
+
loyaltyCoupons: z.array(
|
|
1105
|
+
z.object({
|
|
1106
|
+
_id: z.string().describe("Loyalty coupon ID.").regex(
|
|
1107
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
1108
|
+
"Must be a valid GUID"
|
|
1109
|
+
).optional(),
|
|
1110
|
+
accountId: z.string().describe(
|
|
1111
|
+
"Loyalty [account ID](https://dev.wix.com/docs/rest/crm/loyalty-program/accounts/account-object) of the customer that redeemed points for a coupon."
|
|
1112
|
+
).regex(
|
|
1113
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
1114
|
+
"Must be a valid GUID"
|
|
1115
|
+
).optional(),
|
|
1116
|
+
memberIdDeprecated: z.string().describe(
|
|
1117
|
+
"Member ID of the customer that redeemed points for a coupon. See the Members API for more information."
|
|
1118
|
+
).regex(
|
|
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}$/,
|
|
1120
|
+
"Must be a valid GUID"
|
|
1121
|
+
).optional(),
|
|
1122
|
+
memberId: z.string().describe(
|
|
1123
|
+
"Member ID of the customer that redeemed points for a coupon. See the Members API for more information."
|
|
1124
|
+
).regex(
|
|
1125
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
1126
|
+
"Must be a valid GUID"
|
|
1127
|
+
).optional().nullable(),
|
|
1128
|
+
transactionId: z.string().describe(
|
|
1129
|
+
"[Transaction ID](https://dev.wix.com/docs/rest/crm/loyalty-program/transactions/loyalty-transaction-object) for the transaction that created a coupon."
|
|
1130
|
+
).regex(
|
|
1131
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
1132
|
+
"Must be a valid GUID"
|
|
1133
|
+
).optional().nullable(),
|
|
1134
|
+
couponReference: z.object({
|
|
1135
|
+
couponId: z.string().describe("Coupon ID.").regex(
|
|
1136
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
1137
|
+
"Must be a valid GUID"
|
|
1138
|
+
).optional(),
|
|
1139
|
+
code: z.string().describe(
|
|
1140
|
+
"Coupon code.\n\nUnique code entered by a customer to apply the coupon."
|
|
1141
|
+
).max(20).optional(),
|
|
1142
|
+
name: z.string().describe("Name of coupon.").max(80).optional().nullable(),
|
|
1143
|
+
specification: z.intersection(
|
|
1144
|
+
z.object({
|
|
1145
|
+
name: z.string().describe("Name of coupon.").optional().nullable(),
|
|
1146
|
+
type: z.enum([
|
|
1147
|
+
"UNKNOWN",
|
|
1148
|
+
"MONEY_OFF_AMOUNT",
|
|
1149
|
+
"PERCENT_OFF_RATE",
|
|
1150
|
+
"FREE_SHIPPING",
|
|
1151
|
+
"FIXED_PRICE_AMOUNT",
|
|
1152
|
+
"BUY_X_GET_Y"
|
|
1153
|
+
]).optional(),
|
|
1154
|
+
limitedToOneItem: z.boolean().describe(
|
|
1155
|
+
"Whether the coupon is limited to 1 discount per order. If true and a customer pays for multiple items\nthat the coupon applies to, only the lowest priced item is discounted.\nCoupons with a `bookings` `namespace` are always limited to 1 item."
|
|
1156
|
+
).optional().nullable(),
|
|
1157
|
+
appliesToSubscriptions: z.boolean().describe(
|
|
1158
|
+
"Whether the coupon also applies to subscriptions."
|
|
1159
|
+
).optional().nullable(),
|
|
1160
|
+
discountedCycleCount: z.number().int().describe(
|
|
1161
|
+
"Specifies the amount of cycles to apply the discount to for a subscription item.\n\nCan only be set when `appliesToSubscriptions` is `TRUE` and `specification.scope.namespace` is `pricingPlans`.\nIf `discountedCycleCount` is empty, the coupon applies to all available cycles.\n\nMin: `1`\n\nMax: `999`"
|
|
1162
|
+
).optional().nullable()
|
|
1163
|
+
}),
|
|
1164
|
+
z.intersection(
|
|
1165
|
+
z.xor([
|
|
1166
|
+
z.object({
|
|
1167
|
+
moneyOffAmount: z.never().optional(),
|
|
1168
|
+
percentOffRate: z.never().optional(),
|
|
1169
|
+
freeShipping: z.never().optional(),
|
|
1170
|
+
fixedPriceAmount: z.never().optional(),
|
|
1171
|
+
buyXGetY: z.never().optional()
|
|
1172
|
+
}),
|
|
1173
|
+
z.object({
|
|
1174
|
+
percentOffRate: z.never().optional(),
|
|
1175
|
+
freeShipping: z.never().optional(),
|
|
1176
|
+
fixedPriceAmount: z.never().optional(),
|
|
1177
|
+
buyXGetY: z.never().optional(),
|
|
1178
|
+
moneyOffAmount: z.number().describe("Fixed price discount.").min(0.01)
|
|
1179
|
+
}),
|
|
1180
|
+
z.object({
|
|
1181
|
+
moneyOffAmount: z.never().optional(),
|
|
1182
|
+
freeShipping: z.never().optional(),
|
|
1183
|
+
fixedPriceAmount: z.never().optional(),
|
|
1184
|
+
buyXGetY: z.never().optional(),
|
|
1185
|
+
percentOffRate: z.number().describe("Discount as a percentage.")
|
|
1186
|
+
}),
|
|
1187
|
+
z.object({
|
|
1188
|
+
moneyOffAmount: z.never().optional(),
|
|
1189
|
+
percentOffRate: z.never().optional(),
|
|
1190
|
+
fixedPriceAmount: z.never().optional(),
|
|
1191
|
+
buyXGetY: z.never().optional(),
|
|
1192
|
+
freeShipping: z.boolean().describe(
|
|
1193
|
+
"Free shipping. If true, the coupon applies to all items in all `namespaces` on a site."
|
|
1194
|
+
)
|
|
1195
|
+
}),
|
|
1196
|
+
z.object({
|
|
1197
|
+
moneyOffAmount: z.never().optional(),
|
|
1198
|
+
percentOffRate: z.never().optional(),
|
|
1199
|
+
freeShipping: z.never().optional(),
|
|
1200
|
+
buyXGetY: z.never().optional(),
|
|
1201
|
+
fixedPriceAmount: z.number().describe(
|
|
1202
|
+
"Specific sale price. Currently only supported for coupons with a `stores` `namespace`."
|
|
1203
|
+
)
|
|
1204
|
+
}),
|
|
1205
|
+
z.object({
|
|
1206
|
+
moneyOffAmount: z.never().optional(),
|
|
1207
|
+
percentOffRate: z.never().optional(),
|
|
1208
|
+
freeShipping: z.never().optional(),
|
|
1209
|
+
fixedPriceAmount: z.never().optional(),
|
|
1210
|
+
buyXGetY: z.object({
|
|
1211
|
+
x: z.number().int().describe(
|
|
1212
|
+
"Number of purchased items required to receive free items."
|
|
1213
|
+
).optional(),
|
|
1214
|
+
y: z.number().int().describe(
|
|
1215
|
+
"Number of items received for free if required number of items were purchased."
|
|
1216
|
+
).optional()
|
|
1217
|
+
}).describe(
|
|
1218
|
+
"Free products when making a purchase. `buyXGetY` is an object that specifies `x` and `y` in the\nfollowing scenario: if a visitor purchases x number of products, they receive y number of products for free. C\nurrently only supported for coupons with a `stores` `namespace`."
|
|
1219
|
+
)
|
|
1220
|
+
})
|
|
1221
|
+
]),
|
|
1222
|
+
z.xor([
|
|
1223
|
+
z.object({
|
|
1224
|
+
scope: z.never().optional(),
|
|
1225
|
+
minimumSubtotal: z.never().optional()
|
|
1226
|
+
}),
|
|
1227
|
+
z.object({
|
|
1228
|
+
minimumSubtotal: z.never().optional(),
|
|
1229
|
+
scope: z.object({
|
|
1230
|
+
name: z.string().describe(
|
|
1231
|
+
"Group within a `namespace` for which the coupon is applicable.\n\nIf no group is specified, the coupon applies to all items in the namespace.\n`group` is required in some namespaces. See [Scope Values](https://dev.wix.com/api/rest/coupons/coupons/valid-scope-values)\nfor a list of currently supported groups for each namespace."
|
|
1232
|
+
).optional().nullable(),
|
|
1233
|
+
entityId: z.string().describe(
|
|
1234
|
+
"ID of the specific entity in the group for which the coupon is applicable.\n\nIf no `entityId` is specified, the coupon applies to all entities in the group. In some cases when a group is specified,\nan `entityId` is required. See [Scope Values](https://dev.wix.com/api/rest/coupons/coupons/valid-scope-values)\nfor a list of currently supported entities for each namespace and group."
|
|
1235
|
+
).optional().nullable(),
|
|
1236
|
+
namespace: z.string().describe(
|
|
1237
|
+
'Wix application for which the coupon is applicable.\n\nOne of the following:\n+ `"stores"`\n+ `"bookings"`\n+ `"events"`\n+ `"pricingPlans"`'
|
|
1238
|
+
).optional()
|
|
1239
|
+
}).describe(
|
|
1240
|
+
"Scope of the coupon. When no scope is defined, the coupon applies to all\nitems in all `namespaces` in the site."
|
|
1241
|
+
)
|
|
1242
|
+
}),
|
|
1243
|
+
z.object({
|
|
1244
|
+
scope: z.never().optional(),
|
|
1245
|
+
minimumSubtotal: z.number().describe(
|
|
1246
|
+
"The coupon is only applicable when the order subtotal is over this amount."
|
|
1247
|
+
)
|
|
1248
|
+
})
|
|
1249
|
+
])
|
|
1250
|
+
)
|
|
1251
|
+
).describe("The information to use when creating the coupon.").optional(),
|
|
1252
|
+
deleted: z.boolean().describe("Whether the referenced coupon was deleted.").optional().nullable()
|
|
1253
|
+
}).describe(
|
|
1254
|
+
"Reference coupon information for the corresponding [coupon](https://dev.wix.com/docs/rest/business-management/marketing/coupons/coupons/coupon-object)\nthat is created along with the loyalty coupon."
|
|
1255
|
+
).optional(),
|
|
1256
|
+
status: z.enum([
|
|
1257
|
+
"UNKNOWN",
|
|
1258
|
+
"PENDING",
|
|
1259
|
+
"ACTIVE",
|
|
1260
|
+
"APPLIED",
|
|
1261
|
+
"FAILED",
|
|
1262
|
+
"ARCHIVED"
|
|
1263
|
+
]).describe(
|
|
1264
|
+
"Loyalty coupon status.\n\nThis status relates to the corresponding coupon that is created\nat the same time as the loyalty coupon and is included in `couponReference`."
|
|
1265
|
+
).optional(),
|
|
1266
|
+
rewardName: z.string().describe("Name of reward that was redeemed to create this coupon.").min(1).max(50).optional(),
|
|
1267
|
+
revision: z.string().regex(/^\d+$/, "Must be a valid UInt64 string").describe(
|
|
1268
|
+
"Revision number, which increments by 1 each time the loyalty coupon is updated.\n\nTo prevent conflicting changes, the current `revision` must be passed when updating the loyalty coupon."
|
|
1269
|
+
).optional().nullable(),
|
|
1270
|
+
_createdDate: z.date().describe("Date and time the loyalty coupon was created.").optional().nullable(),
|
|
1271
|
+
_updatedDate: z.date().describe("Date and time the loyalty coupon was last updated.").optional().nullable(),
|
|
1272
|
+
refundable: z.boolean().describe(
|
|
1273
|
+
'Whether the loyalty coupon was created in a "refundable workflow" i.e. checkout-exchange, and therefore can be deleted in the background. Refundable coupons should not be visible to customers in the UI.'
|
|
1274
|
+
).optional().nullable()
|
|
1275
|
+
})
|
|
1276
|
+
).optional(),
|
|
1277
|
+
metadata: z.object({
|
|
1278
|
+
count: z.number().int().describe("Number of items returned in the response.").optional().nullable(),
|
|
1279
|
+
offset: z.number().int().describe("Offset that was requested.").optional().nullable(),
|
|
1280
|
+
total: z.number().int().describe(
|
|
1281
|
+
"Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set."
|
|
1282
|
+
).optional().nullable(),
|
|
1283
|
+
tooManyToCount: z.boolean().describe(
|
|
1284
|
+
"Flag that indicates the server failed to calculate the `total` field."
|
|
1285
|
+
).optional().nullable(),
|
|
1286
|
+
cursors: z.object({
|
|
1287
|
+
next: z.string().describe(
|
|
1288
|
+
"Cursor string pointing to the next page in the list of results."
|
|
1289
|
+
).max(16e3).optional().nullable(),
|
|
1290
|
+
prev: z.string().describe(
|
|
1291
|
+
"Cursor pointing to the previous page in the list of results."
|
|
1292
|
+
).max(16e3).optional().nullable()
|
|
1293
|
+
}).describe(
|
|
1294
|
+
"Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used."
|
|
1295
|
+
).optional()
|
|
1296
|
+
}).describe("Metadata.").optional()
|
|
1297
|
+
});
|
|
1298
|
+
var DeleteLoyaltyCouponRequest = z.object({
|
|
1299
|
+
_id: z.string().describe("ID of the loyalty coupon to delete.").regex(
|
|
1300
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
1301
|
+
"Must be a valid GUID"
|
|
1302
|
+
),
|
|
1303
|
+
revision: z.string().regex(/^\d+$/, "Must be a valid UInt64 string").describe(
|
|
1304
|
+
"Revision number, which increments by 1 each time the loyalty coupon is updated.\n\nTo prevent conflicting changes, the current `revision` must be passed when updating the loyalty coupon."
|
|
1305
|
+
)
|
|
1306
|
+
});
|
|
1307
|
+
var DeleteLoyaltyCouponResponse = z.object({});
|
|
1308
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
1309
|
+
0 && (module.exports = {
|
|
1310
|
+
BulkGetLoyaltyCouponRequest,
|
|
1311
|
+
BulkGetLoyaltyCouponResponse,
|
|
1312
|
+
DeleteLoyaltyCouponRequest,
|
|
1313
|
+
DeleteLoyaltyCouponResponse,
|
|
1314
|
+
GetCurrentMemberCouponsRequest,
|
|
1315
|
+
GetCurrentMemberCouponsResponse,
|
|
1316
|
+
GetLoyaltyCouponRequest,
|
|
1317
|
+
GetLoyaltyCouponResponse,
|
|
1318
|
+
QueryLoyaltyCouponsRequest,
|
|
1319
|
+
QueryLoyaltyCouponsResponse,
|
|
1320
|
+
RedeemCurrentMemberPointsForCouponRequest,
|
|
1321
|
+
RedeemCurrentMemberPointsForCouponResponse,
|
|
1322
|
+
RedeemPointsForCouponRequest,
|
|
1323
|
+
RedeemPointsForCouponResponse
|
|
1324
|
+
});
|
|
1325
|
+
//# sourceMappingURL=schemas.js.map
|