@epcc-sdk/rule-promotions 0.0.1
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/LICENSE +21 -0
- package/README.md +244 -0
- package/dist/client/index.d.ts +2 -0
- package/dist/client/index.js +3 -0
- package/dist/client/sdk.gen.d.ts +263 -0
- package/dist/client/sdk.gen.js +356 -0
- package/dist/client/transformers.gen.d.ts +11 -0
- package/dist/client/transformers.gen.js +191 -0
- package/dist/client/types.gen.d.ts +1017 -0
- package/dist/client/types.gen.js +2 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/package.json +38 -0
|
@@ -0,0 +1,1017 @@
|
|
|
1
|
+
export type Type = "rule_promotion";
|
|
2
|
+
/**
|
|
3
|
+
* Specifies the strategy for determining which items to discount based on their individual prices.
|
|
4
|
+
*/
|
|
5
|
+
export type PriceStrategy = "cheapest" | "expensive";
|
|
6
|
+
export type RulePromotionRequest = {
|
|
7
|
+
data?: {
|
|
8
|
+
type?: "rule_promotion";
|
|
9
|
+
/**
|
|
10
|
+
* Specifies a name for the promotion.
|
|
11
|
+
*/
|
|
12
|
+
name?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Specifies a description for the rule promotion.
|
|
15
|
+
*/
|
|
16
|
+
description?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Specifies the priority order of a promotion, with larger numbers indicating higher priorities.
|
|
19
|
+
*/
|
|
20
|
+
priority?: number;
|
|
21
|
+
/**
|
|
22
|
+
* Specifies whether the promotion is enabled. The options are true or false, and the default setting is false.
|
|
23
|
+
*/
|
|
24
|
+
enabled?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Specifies whether the promotion is applied automatically to the cart or a code is required to apply the promotion. The default setting is false. When this value is set to true, a code is autogenerated. If this value is set to false, you must create the code manually.
|
|
27
|
+
*/
|
|
28
|
+
automatic?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Specifies whether this promotion can stack with other promotions.
|
|
31
|
+
*/
|
|
32
|
+
stackable?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Enables a promotion to be stacked with an otherwise non-stackable promotion.
|
|
35
|
+
*/
|
|
36
|
+
override_stacking?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Specifies the start date and time of the promotion or the start date of the promotion. You can provide a specific time in the HH:MM format. If no time is specified, the default start and end time is set to 00:00.
|
|
39
|
+
*/
|
|
40
|
+
start?: Date;
|
|
41
|
+
/**
|
|
42
|
+
* Specifies the end date and time of the promotion or the end date of the promotion.
|
|
43
|
+
*/
|
|
44
|
+
end?: Date;
|
|
45
|
+
rule_set?: {
|
|
46
|
+
/**
|
|
47
|
+
* Specifies the catalogs that are eligible for the promotion. By default, the promotion applies to all items, including custom items. However, when catalog_ids is defined, the promotion is only applied to items within the specified catalogs. If catalog IDs are specified, custom items cannot be applied as part of the promotion.
|
|
48
|
+
*/
|
|
49
|
+
catalog_ids?: Array<string>;
|
|
50
|
+
/**
|
|
51
|
+
* Specifies currencies that are applied for the promotion.
|
|
52
|
+
*/
|
|
53
|
+
currencies?: Array<string>;
|
|
54
|
+
rules?: {
|
|
55
|
+
/**
|
|
56
|
+
* Specifies a given strategy for the rule. Strategies determine how rules are applied. Supported strategies value include `cart_total`, `cart_custom_attribute`, `item_price`, `item_sku`, `item_product_id`, `item_quantity`, `item_category`, `item_attribute`, `item_identifier`, `and` and `or`.
|
|
57
|
+
*/
|
|
58
|
+
strategy?: string;
|
|
59
|
+
/**
|
|
60
|
+
* Specifies the operators used for the rule strategy.
|
|
61
|
+
*/
|
|
62
|
+
operator?: string;
|
|
63
|
+
/**
|
|
64
|
+
* Represents the condition value associated with each rule within the rule set. It requires at least three arguments.
|
|
65
|
+
*/
|
|
66
|
+
args?: Array<string>;
|
|
67
|
+
children?: Array<{
|
|
68
|
+
strategy?: string;
|
|
69
|
+
operator?: string;
|
|
70
|
+
args?: Array<string>;
|
|
71
|
+
}>;
|
|
72
|
+
};
|
|
73
|
+
actions?: Array<{
|
|
74
|
+
/**
|
|
75
|
+
* Specifies the strategy for the promotion action.
|
|
76
|
+
*/
|
|
77
|
+
strategy?: string;
|
|
78
|
+
args?: Array<string>;
|
|
79
|
+
condition?: {
|
|
80
|
+
strategy?: string;
|
|
81
|
+
children?: Array<{
|
|
82
|
+
strategy?: string;
|
|
83
|
+
operator?: string;
|
|
84
|
+
args?: Array<string>;
|
|
85
|
+
}>;
|
|
86
|
+
};
|
|
87
|
+
limitations?: {
|
|
88
|
+
/**
|
|
89
|
+
* Specifies the maximum amount of discount applied to the shopping cart.
|
|
90
|
+
*/
|
|
91
|
+
max_discount?: number;
|
|
92
|
+
/**
|
|
93
|
+
* Specifies the maximum quantity of each eligible item to which the promotion is applied.
|
|
94
|
+
*/
|
|
95
|
+
max_quantity?: number;
|
|
96
|
+
items?: {
|
|
97
|
+
/**
|
|
98
|
+
* Specifies the maximum number of items eligible for the discount.
|
|
99
|
+
*/
|
|
100
|
+
max_items?: number;
|
|
101
|
+
/**
|
|
102
|
+
* Specifies the strategy for determining which items to discount based on their individual prices.
|
|
103
|
+
*/
|
|
104
|
+
price_strategy?: "cheapest" | "expensive";
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
}>;
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
export type RulePromotionResponse = {
|
|
112
|
+
data?: {
|
|
113
|
+
type?: "rule_promotion";
|
|
114
|
+
id?: string;
|
|
115
|
+
store_id?: string;
|
|
116
|
+
name?: string;
|
|
117
|
+
description?: string;
|
|
118
|
+
priority?: number;
|
|
119
|
+
enabled?: boolean;
|
|
120
|
+
automatic?: boolean;
|
|
121
|
+
stackable?: boolean;
|
|
122
|
+
override_stacking?: boolean;
|
|
123
|
+
rule_set?: {
|
|
124
|
+
catalog_ids?: Array<string>;
|
|
125
|
+
currencies?: Array<string>;
|
|
126
|
+
rules?: {
|
|
127
|
+
strategy?: string;
|
|
128
|
+
operator?: string;
|
|
129
|
+
args?: Array<string>;
|
|
130
|
+
children?: Array<{
|
|
131
|
+
strategy?: string;
|
|
132
|
+
operator?: string;
|
|
133
|
+
args?: Array<string>;
|
|
134
|
+
}>;
|
|
135
|
+
};
|
|
136
|
+
actions?: Array<{
|
|
137
|
+
strategy?: string;
|
|
138
|
+
args?: Array<string>;
|
|
139
|
+
condition?: {
|
|
140
|
+
strategy?: string;
|
|
141
|
+
children?: Array<{
|
|
142
|
+
strategy?: string;
|
|
143
|
+
operator?: string;
|
|
144
|
+
args?: Array<string>;
|
|
145
|
+
}>;
|
|
146
|
+
};
|
|
147
|
+
limitations?: {
|
|
148
|
+
max_discount?: number;
|
|
149
|
+
max_quantity?: number;
|
|
150
|
+
items?: {
|
|
151
|
+
max_items?: number;
|
|
152
|
+
price_strategy?: "cheapest" | "expensive";
|
|
153
|
+
};
|
|
154
|
+
};
|
|
155
|
+
}>;
|
|
156
|
+
};
|
|
157
|
+
start?: Date;
|
|
158
|
+
end?: Date;
|
|
159
|
+
meta?: {
|
|
160
|
+
timestamps?: {
|
|
161
|
+
created_at?: Date;
|
|
162
|
+
updated_at?: Date;
|
|
163
|
+
};
|
|
164
|
+
};
|
|
165
|
+
};
|
|
166
|
+
};
|
|
167
|
+
/**
|
|
168
|
+
* Object for setting max uses per shopper. Only include this object, when you want to set limit per shopper.
|
|
169
|
+
*/
|
|
170
|
+
export type MaxUsesPerShopper = {
|
|
171
|
+
/**
|
|
172
|
+
* Sets max number of times the code can be used by a shopper. NOTE - This cannot be set with `per_application` consume unit.
|
|
173
|
+
*/
|
|
174
|
+
max_uses?: number;
|
|
175
|
+
/**
|
|
176
|
+
* The flag to include guest shoppers for the discount with max use restriction. **If this field is provided, the max_uses value is required.** When set to `true`, guest shoppers must have an email associated with the cart to use the code. A guest cart without an email cannot use the code. When set to `false`, guest shoppers cannot use the promo code, even if the cart has an associated guest email.
|
|
177
|
+
*/
|
|
178
|
+
includes_guests?: boolean;
|
|
179
|
+
};
|
|
180
|
+
/**
|
|
181
|
+
* Specifies whether the code is consumed per application or per checkout. With `per_checkout`, the code is used once for each checkout, regardless of the number of items in the cart. When set to `per_application`, the code is used per application. For cart discounts, each application counts as one usage. For item discounts, each application to either a single quantity or a bundle is counted as one usage. For example, in a store that offers 50% off on SKU1, SKU2, and SKU3, and limits the maximum usage of the promotion code to two, a shopper can apply the promotion up to two quantities. If the cart contains two or more quantities of SKU1, the promotion is applied 2 times to SKU1, and other quantities and items are at the regular price. If the cart contains one quantity of SKU1, one quantity of SKU2, and one quantity of SKU3, the promotion is applied once to SKU1 and once to SKU2. The code usage is applied at checkout and the code is considered consumed at that point.
|
|
182
|
+
*
|
|
183
|
+
*/
|
|
184
|
+
export type ConsumeUnit = "per_application" | "per_checkout";
|
|
185
|
+
export type PromotionCodesRequest = {
|
|
186
|
+
data?: {
|
|
187
|
+
type?: "promotion_codes";
|
|
188
|
+
/**
|
|
189
|
+
* Specifies the code details in an array of objects.
|
|
190
|
+
*/
|
|
191
|
+
codes?: Array<{
|
|
192
|
+
/**
|
|
193
|
+
* Specifies the string to use as a code for the promotion.
|
|
194
|
+
*/
|
|
195
|
+
code?: string;
|
|
196
|
+
/**
|
|
197
|
+
* Specifies the number of times the code can be used. If no value is set, the customer can use the code any number of times.
|
|
198
|
+
*/
|
|
199
|
+
uses?: number;
|
|
200
|
+
/**
|
|
201
|
+
* Specifies the customer ID of the shopper who can use the code. For more information, see the [Create a customer](/docs/customer-management/customer-management-api/create-a-customer) section.
|
|
202
|
+
*/
|
|
203
|
+
user?: string;
|
|
204
|
+
/**
|
|
205
|
+
* Specifies whether the code is consumed per application or per checkout. With `per_checkout`, the code is used once for each checkout, regardless of the number of items in the cart. When set to `per_application`, the code is used per application. For cart discounts, each application counts as one usage. For item discounts, each application to either a single quantity or a bundle is counted as one usage. For example, in a store that offers 50% off on SKU1, SKU2, and SKU3, and limits the maximum usage of the promotion code to two, a shopper can apply the promotion up to two quantities. If the cart contains two or more quantities of SKU1, the promotion is applied 2 times to SKU1, and other quantities and items are at the regular price. If the cart contains one quantity of SKU1, one quantity of SKU2, and one quantity of SKU3, the promotion is applied once to SKU1 and once to SKU2. The code usage is applied at checkout and the code is considered consumed at that point.
|
|
206
|
+
*
|
|
207
|
+
*/
|
|
208
|
+
consume_unit?: "per_application" | "per_checkout";
|
|
209
|
+
max_users_per_shopper?: MaxUsesPerShopper;
|
|
210
|
+
/**
|
|
211
|
+
* A flag indicating whether the coupon is for first-time shoppers. If set to `true`, the discount will only apply if the shopper has never made a payment on any order in the store. If set to `false` or left unset, it will be a regular discount that applies to all shoppers. When this flag is set to `true`, the coupon cannot have usage limitations or be assigned to specific users.
|
|
212
|
+
*/
|
|
213
|
+
is_for_new_shopper?: boolean;
|
|
214
|
+
}>;
|
|
215
|
+
};
|
|
216
|
+
};
|
|
217
|
+
export type GetPromotionCodeResponse = {
|
|
218
|
+
type?: "promotion_codes";
|
|
219
|
+
code?: string;
|
|
220
|
+
uses?: number;
|
|
221
|
+
user?: string;
|
|
222
|
+
/**
|
|
223
|
+
* Specifies whether the code is consumed per application or per checkout. With `per_checkout`, the code is used once for each checkout, regardless of the number of items in the cart. When set to `per_application`, the code is used per application. For cart discounts, each application counts as one usage. For item discounts, each application to either a single quantity or a bundle is counted as one usage. For example, in a store that offers 50% off on SKU1, SKU2, and SKU3, and limits the maximum usage of the promotion code to two, a shopper can apply the promotion up to two quantities. If the cart contains two or more quantities of SKU1, the promotion is applied 2 times to SKU1, and other quantities and items are at the regular price. If the cart contains one quantity of SKU1, one quantity of SKU2, and one quantity of SKU3, the promotion is applied once to SKU1 and once to SKU2. The code usage is applied at checkout and the code is considered consumed at that point.
|
|
224
|
+
*
|
|
225
|
+
*/
|
|
226
|
+
consume_unit?: "per_application" | "per_checkout";
|
|
227
|
+
max_uses?: number;
|
|
228
|
+
max_users_per_shopper?: MaxUsesPerShopper;
|
|
229
|
+
is_for_new_shopper?: boolean;
|
|
230
|
+
created_by?: string;
|
|
231
|
+
meta?: {
|
|
232
|
+
timestamps?: {
|
|
233
|
+
created_at?: Date;
|
|
234
|
+
};
|
|
235
|
+
};
|
|
236
|
+
};
|
|
237
|
+
export type CreatePromotionCodeResponse = {
|
|
238
|
+
type?: "promotion_codes";
|
|
239
|
+
code?: string;
|
|
240
|
+
uses?: number;
|
|
241
|
+
user?: string;
|
|
242
|
+
consume_unit?: "per_application" | "per_checkout";
|
|
243
|
+
max_uses?: number;
|
|
244
|
+
max_users_per_shopper?: MaxUsesPerShopper;
|
|
245
|
+
is_for_new_shopper?: boolean;
|
|
246
|
+
};
|
|
247
|
+
export type GetPromotionCodesResponse = {
|
|
248
|
+
data?: Array<GetPromotionCodeResponse>;
|
|
249
|
+
};
|
|
250
|
+
export type CreatePromotionCodesResponse = {
|
|
251
|
+
data?: Array<CreatePromotionCodeResponse>;
|
|
252
|
+
messages?: Array<PromotionCodeMessage>;
|
|
253
|
+
};
|
|
254
|
+
/**
|
|
255
|
+
* Represents the result of a promotion job, including the number of generated and deleted promotion codes.
|
|
256
|
+
*
|
|
257
|
+
* - `generated`: Total number of successfully generated codes.
|
|
258
|
+
* - `deleted`: Number of codes that were deleted during job cancellation, if applicable.
|
|
259
|
+
*
|
|
260
|
+
*/
|
|
261
|
+
export type GenerateResult = {
|
|
262
|
+
/**
|
|
263
|
+
* Number of successfully generated promotion codes.
|
|
264
|
+
*/
|
|
265
|
+
generated?: number;
|
|
266
|
+
/**
|
|
267
|
+
* Number of codes deleted due to job cancellation.
|
|
268
|
+
*/
|
|
269
|
+
deleted?: number;
|
|
270
|
+
};
|
|
271
|
+
export type PromotionJob = {
|
|
272
|
+
/**
|
|
273
|
+
* A unique ID generated when a job is created.
|
|
274
|
+
*/
|
|
275
|
+
id?: string;
|
|
276
|
+
/**
|
|
277
|
+
* Always `promotion_job`.
|
|
278
|
+
*/
|
|
279
|
+
type?: "promotion_job";
|
|
280
|
+
/**
|
|
281
|
+
* A unique ID of a promotion.
|
|
282
|
+
*/
|
|
283
|
+
rule_promotion_id?: string;
|
|
284
|
+
/**
|
|
285
|
+
* The type of job you want to run. For example, `code_generate` to generate codes or `code_export` to export codes.
|
|
286
|
+
*/
|
|
287
|
+
job_type?: string;
|
|
288
|
+
/**
|
|
289
|
+
* The name of the job. The maximum length allowed is 50 characters.
|
|
290
|
+
*/
|
|
291
|
+
name?: string;
|
|
292
|
+
parameters?: {
|
|
293
|
+
[key: string]: unknown;
|
|
294
|
+
};
|
|
295
|
+
/**
|
|
296
|
+
* The status of the job. Please see [Overview](/docs/api/promotions/promotion-jobs).
|
|
297
|
+
*/
|
|
298
|
+
status?: string;
|
|
299
|
+
/**
|
|
300
|
+
* The error encountered during job execution, if applicable.
|
|
301
|
+
*/
|
|
302
|
+
error?: string;
|
|
303
|
+
meta?: {
|
|
304
|
+
timestamps?: {
|
|
305
|
+
/**
|
|
306
|
+
* The creation date of the job.
|
|
307
|
+
*/
|
|
308
|
+
created_at?: Date;
|
|
309
|
+
/**
|
|
310
|
+
* The last updated date of the job.
|
|
311
|
+
*/
|
|
312
|
+
updated_at?: Date;
|
|
313
|
+
};
|
|
314
|
+
};
|
|
315
|
+
generate_result?: GenerateResult;
|
|
316
|
+
};
|
|
317
|
+
/**
|
|
318
|
+
* Successful response
|
|
319
|
+
*/
|
|
320
|
+
export type PromotionJobsListResponse = unknown;
|
|
321
|
+
/**
|
|
322
|
+
* Promotion job created
|
|
323
|
+
*/
|
|
324
|
+
export type PromotionJobCreatedResponse = unknown;
|
|
325
|
+
/**
|
|
326
|
+
* Job canceled successfully
|
|
327
|
+
*/
|
|
328
|
+
export type PromotionJobCanceledResponse = unknown;
|
|
329
|
+
/**
|
|
330
|
+
* Successful response
|
|
331
|
+
*/
|
|
332
|
+
export type PromotionCodeExportedFileResponse = unknown;
|
|
333
|
+
/**
|
|
334
|
+
* Represents a single rule promotion usage record.
|
|
335
|
+
*/
|
|
336
|
+
export type RulePromotionUsage = {
|
|
337
|
+
/**
|
|
338
|
+
* The unique identifier of the usage record.
|
|
339
|
+
*/
|
|
340
|
+
id?: string;
|
|
341
|
+
/**
|
|
342
|
+
* The associated order ID, if applicable.
|
|
343
|
+
*/
|
|
344
|
+
order_id?: string;
|
|
345
|
+
/**
|
|
346
|
+
* The unique identifier of the promotion code.
|
|
347
|
+
*/
|
|
348
|
+
code_id?: string;
|
|
349
|
+
/**
|
|
350
|
+
* The promotion code used.
|
|
351
|
+
*/
|
|
352
|
+
code?: string;
|
|
353
|
+
/**
|
|
354
|
+
* The number of times the promotion code has been used.
|
|
355
|
+
*/
|
|
356
|
+
times_used?: number;
|
|
357
|
+
/**
|
|
358
|
+
* The timestamp when the promotion was applied.
|
|
359
|
+
*/
|
|
360
|
+
used_on?: Date;
|
|
361
|
+
/**
|
|
362
|
+
* The customer identifier who used the promotion, if applicable.
|
|
363
|
+
*/
|
|
364
|
+
customer_id?: string;
|
|
365
|
+
/**
|
|
366
|
+
* The email of the customer who used the promotion, if applicable.
|
|
367
|
+
*/
|
|
368
|
+
customer_email?: string;
|
|
369
|
+
meta?: {
|
|
370
|
+
timestamps?: {
|
|
371
|
+
/**
|
|
372
|
+
* The timestamp when the usage record was last updated.
|
|
373
|
+
*/
|
|
374
|
+
updated_at?: Date;
|
|
375
|
+
};
|
|
376
|
+
};
|
|
377
|
+
/**
|
|
378
|
+
* Identifier of the user or system that last updated the record.
|
|
379
|
+
*/
|
|
380
|
+
updated_by?: string;
|
|
381
|
+
/**
|
|
382
|
+
* Indicates whether the usage record has been anonymized.
|
|
383
|
+
*/
|
|
384
|
+
anonymized?: boolean;
|
|
385
|
+
};
|
|
386
|
+
export type ResponsePaginationMeta = {
|
|
387
|
+
pagination?: {
|
|
388
|
+
/**
|
|
389
|
+
* Total number of available records.
|
|
390
|
+
*/
|
|
391
|
+
total?: number;
|
|
392
|
+
/**
|
|
393
|
+
* Number of records returned per page.
|
|
394
|
+
*/
|
|
395
|
+
limit?: number;
|
|
396
|
+
/**
|
|
397
|
+
* Number of records skipped.
|
|
398
|
+
*/
|
|
399
|
+
offset?: number;
|
|
400
|
+
/**
|
|
401
|
+
* Current page number.
|
|
402
|
+
*/
|
|
403
|
+
current?: number;
|
|
404
|
+
};
|
|
405
|
+
};
|
|
406
|
+
export type ResponseError = {
|
|
407
|
+
errors?: Array<{
|
|
408
|
+
/**
|
|
409
|
+
* HTTP status code.
|
|
410
|
+
*/
|
|
411
|
+
status?: number;
|
|
412
|
+
/**
|
|
413
|
+
* Error title.
|
|
414
|
+
*/
|
|
415
|
+
title?: string;
|
|
416
|
+
/**
|
|
417
|
+
* Error details.
|
|
418
|
+
*/
|
|
419
|
+
detail?: string;
|
|
420
|
+
}>;
|
|
421
|
+
};
|
|
422
|
+
export type PromotionCodeMessage = {
|
|
423
|
+
/**
|
|
424
|
+
* Information about the affected promotion codes.
|
|
425
|
+
*/
|
|
426
|
+
source?: {
|
|
427
|
+
/**
|
|
428
|
+
* Indicates that the affected entity is a promotion code.
|
|
429
|
+
*/
|
|
430
|
+
type?: "promotion_codes";
|
|
431
|
+
/**
|
|
432
|
+
* A list of promotion codes that triggered the message.
|
|
433
|
+
*/
|
|
434
|
+
codes?: Array<string>;
|
|
435
|
+
};
|
|
436
|
+
/**
|
|
437
|
+
* A brief title summarizing the message.
|
|
438
|
+
*/
|
|
439
|
+
title?: string;
|
|
440
|
+
/**
|
|
441
|
+
* A detailed explanation of the message.
|
|
442
|
+
*/
|
|
443
|
+
description?: string;
|
|
444
|
+
};
|
|
445
|
+
/**
|
|
446
|
+
* The Bearer token required to get access to the API.
|
|
447
|
+
*/
|
|
448
|
+
export type Authorization = string;
|
|
449
|
+
export type GetRulePromotionsData = {
|
|
450
|
+
body?: never;
|
|
451
|
+
headers: {
|
|
452
|
+
/**
|
|
453
|
+
* The Bearer token required to get access to the API.
|
|
454
|
+
*/
|
|
455
|
+
Authorization: string;
|
|
456
|
+
};
|
|
457
|
+
path?: never;
|
|
458
|
+
query?: {
|
|
459
|
+
/**
|
|
460
|
+
* This parameter accepts a filtering expression that uses specific operators and attributes.
|
|
461
|
+
*
|
|
462
|
+
* The following operators and attributes are available when filtering on this endpoint. See [Supported Filtering Characters](/guides/Getting-Started/filtering#supported-characters).
|
|
463
|
+
*
|
|
464
|
+
* | Attribute | Type | Operator | Example |
|
|
465
|
+
* |:--------- |:---------|:------------|:---------------|
|
|
466
|
+
* | `code` | `string`, `number` | `eq` | `eq(code,summer2024)` |
|
|
467
|
+
* | `name` | `string` | `like`,`ilike` | `ilike(name, 'Summer *')` |
|
|
468
|
+
* | `enabled` | `boolean` | `eq` | `eq(enabled, true)` |
|
|
469
|
+
* | `stackable` | `boolean` | `eq` | `eq(stackable, true)` |
|
|
470
|
+
* | `override_stacking` | `boolean` | `eq` | `eq(override_stacking, true)` |
|
|
471
|
+
* | `start` | `date` | `lt`, `le`, `eq`, `gt`, `ge` | `gt(start, 2025-01-01T00:00:00.000Z)` |
|
|
472
|
+
* | `end` | `date` | `lt`, `le`, `eq`, `gt`, `ge` | `lt(end, 2025-01-01T00:00:00.000Z)` |
|
|
473
|
+
*
|
|
474
|
+
* Please note: promotion codes are case-insensitive. You can search for codes using only `numbers` or codes containing both `string` and `numbers`.
|
|
475
|
+
*
|
|
476
|
+
*/
|
|
477
|
+
filter?: string;
|
|
478
|
+
};
|
|
479
|
+
url: "/v2/rule-promotions";
|
|
480
|
+
};
|
|
481
|
+
export type GetRulePromotionsResponses = {
|
|
482
|
+
/**
|
|
483
|
+
* OK
|
|
484
|
+
*/
|
|
485
|
+
200: Array<RulePromotionResponse>;
|
|
486
|
+
};
|
|
487
|
+
export type GetRulePromotionsResponse = GetRulePromotionsResponses[keyof GetRulePromotionsResponses];
|
|
488
|
+
export type CreateRulePromotionData = {
|
|
489
|
+
body: RulePromotionRequest;
|
|
490
|
+
headers: {
|
|
491
|
+
/**
|
|
492
|
+
* The Bearer token required to get access to the API.
|
|
493
|
+
*/
|
|
494
|
+
Authorization: string;
|
|
495
|
+
};
|
|
496
|
+
path?: never;
|
|
497
|
+
query?: never;
|
|
498
|
+
url: "/v2/rule-promotions";
|
|
499
|
+
};
|
|
500
|
+
export type CreateRulePromotionResponses = {
|
|
501
|
+
/**
|
|
502
|
+
* Created
|
|
503
|
+
*/
|
|
504
|
+
201: RulePromotionResponse;
|
|
505
|
+
};
|
|
506
|
+
export type CreateRulePromotionResponse = CreateRulePromotionResponses[keyof CreateRulePromotionResponses];
|
|
507
|
+
export type DeleteRulePromotionData = {
|
|
508
|
+
body?: never;
|
|
509
|
+
headers: {
|
|
510
|
+
/**
|
|
511
|
+
* The Bearer token required to get access to the API.
|
|
512
|
+
*/
|
|
513
|
+
Authorization: string;
|
|
514
|
+
};
|
|
515
|
+
path: {
|
|
516
|
+
/**
|
|
517
|
+
* The unique identifier of the promotion.
|
|
518
|
+
*/
|
|
519
|
+
promotionID: string;
|
|
520
|
+
};
|
|
521
|
+
query?: never;
|
|
522
|
+
url: "/v2/rule-promotions/{promotionID}";
|
|
523
|
+
};
|
|
524
|
+
export type DeleteRulePromotionResponses = {
|
|
525
|
+
/**
|
|
526
|
+
* No Content
|
|
527
|
+
*/
|
|
528
|
+
204: void;
|
|
529
|
+
};
|
|
530
|
+
export type DeleteRulePromotionResponse = DeleteRulePromotionResponses[keyof DeleteRulePromotionResponses];
|
|
531
|
+
export type GetRulePromotionByIdData = {
|
|
532
|
+
body?: never;
|
|
533
|
+
headers: {
|
|
534
|
+
/**
|
|
535
|
+
* The Bearer token required to get access to the API.
|
|
536
|
+
*/
|
|
537
|
+
Authorization: string;
|
|
538
|
+
};
|
|
539
|
+
path: {
|
|
540
|
+
/**
|
|
541
|
+
* The unique identifier of the rule promotion.
|
|
542
|
+
*/
|
|
543
|
+
promotionID: string;
|
|
544
|
+
};
|
|
545
|
+
query?: never;
|
|
546
|
+
url: "/v2/rule-promotions/{promotionID}";
|
|
547
|
+
};
|
|
548
|
+
export type GetRulePromotionByIdResponses = {
|
|
549
|
+
/**
|
|
550
|
+
* OK
|
|
551
|
+
*/
|
|
552
|
+
200: RulePromotionResponse;
|
|
553
|
+
};
|
|
554
|
+
export type GetRulePromotionByIdResponse = GetRulePromotionByIdResponses[keyof GetRulePromotionByIdResponses];
|
|
555
|
+
export type UpdateRulePromotionData = {
|
|
556
|
+
body: RulePromotionRequest;
|
|
557
|
+
headers: {
|
|
558
|
+
/**
|
|
559
|
+
* The Bearer token required to get access to the API.
|
|
560
|
+
*/
|
|
561
|
+
Authorization: string;
|
|
562
|
+
};
|
|
563
|
+
path: {
|
|
564
|
+
/**
|
|
565
|
+
* The unique identifier of the promotion to be updated.
|
|
566
|
+
*/
|
|
567
|
+
promotionID: string;
|
|
568
|
+
};
|
|
569
|
+
query?: never;
|
|
570
|
+
url: "/v2/rule-promotions/{promotionID}";
|
|
571
|
+
};
|
|
572
|
+
export type UpdateRulePromotionResponses = {
|
|
573
|
+
/**
|
|
574
|
+
* OK
|
|
575
|
+
*/
|
|
576
|
+
200: RulePromotionResponse;
|
|
577
|
+
};
|
|
578
|
+
export type UpdateRulePromotionResponse = UpdateRulePromotionResponses[keyof UpdateRulePromotionResponses];
|
|
579
|
+
export type DeleteRulePromotionCodesData = {
|
|
580
|
+
body: PromotionCodesRequest;
|
|
581
|
+
headers: {
|
|
582
|
+
/**
|
|
583
|
+
* The Bearer token required to get access to the API.
|
|
584
|
+
*/
|
|
585
|
+
Authorization: string;
|
|
586
|
+
};
|
|
587
|
+
path: {
|
|
588
|
+
/**
|
|
589
|
+
* The unique identifier of the rule promotion.
|
|
590
|
+
*/
|
|
591
|
+
promotionID: string;
|
|
592
|
+
};
|
|
593
|
+
query?: never;
|
|
594
|
+
url: "/v2/rule-promotions/{promotionID}/codes";
|
|
595
|
+
};
|
|
596
|
+
export type DeleteRulePromotionCodesResponses = {
|
|
597
|
+
/**
|
|
598
|
+
* No Content
|
|
599
|
+
*/
|
|
600
|
+
204: void;
|
|
601
|
+
};
|
|
602
|
+
export type DeleteRulePromotionCodesResponse = DeleteRulePromotionCodesResponses[keyof DeleteRulePromotionCodesResponses];
|
|
603
|
+
export type GetRulePromotionCodesData = {
|
|
604
|
+
body?: never;
|
|
605
|
+
headers: {
|
|
606
|
+
/**
|
|
607
|
+
* The Bearer token required to get access to the API.
|
|
608
|
+
*/
|
|
609
|
+
Authorization: string;
|
|
610
|
+
};
|
|
611
|
+
path: {
|
|
612
|
+
/**
|
|
613
|
+
* The unique identifier of the rule promotion.
|
|
614
|
+
*/
|
|
615
|
+
promotionID: string;
|
|
616
|
+
};
|
|
617
|
+
query?: never;
|
|
618
|
+
url: "/v2/rule-promotions/{promotionID}/codes";
|
|
619
|
+
};
|
|
620
|
+
export type GetRulePromotionCodesResponses = {
|
|
621
|
+
/**
|
|
622
|
+
* OK
|
|
623
|
+
*/
|
|
624
|
+
200: GetPromotionCodesResponse;
|
|
625
|
+
};
|
|
626
|
+
export type GetRulePromotionCodesResponse = GetRulePromotionCodesResponses[keyof GetRulePromotionCodesResponses];
|
|
627
|
+
export type CreateRulePromotionCodesData = {
|
|
628
|
+
body: PromotionCodesRequest;
|
|
629
|
+
headers: {
|
|
630
|
+
/**
|
|
631
|
+
* The Bearer token required to get access to the API.
|
|
632
|
+
*/
|
|
633
|
+
Authorization: string;
|
|
634
|
+
};
|
|
635
|
+
path: {
|
|
636
|
+
/**
|
|
637
|
+
* The unique identifier of the rule promotion.
|
|
638
|
+
*/
|
|
639
|
+
promotionID: string;
|
|
640
|
+
};
|
|
641
|
+
query?: never;
|
|
642
|
+
url: "/v2/rule-promotions/{promotionID}/codes";
|
|
643
|
+
};
|
|
644
|
+
export type CreateRulePromotionCodesErrors = {
|
|
645
|
+
/**
|
|
646
|
+
* Bad Request
|
|
647
|
+
*/
|
|
648
|
+
400: {
|
|
649
|
+
errors?: Array<{
|
|
650
|
+
status?: number;
|
|
651
|
+
source?: string;
|
|
652
|
+
title?: string;
|
|
653
|
+
detail?: string;
|
|
654
|
+
}>;
|
|
655
|
+
};
|
|
656
|
+
/**
|
|
657
|
+
* Unprocessable Entity
|
|
658
|
+
*/
|
|
659
|
+
422: {
|
|
660
|
+
errors?: Array<{
|
|
661
|
+
status?: number;
|
|
662
|
+
source?: string;
|
|
663
|
+
title?: string;
|
|
664
|
+
detail?: string;
|
|
665
|
+
}>;
|
|
666
|
+
};
|
|
667
|
+
};
|
|
668
|
+
export type CreateRulePromotionCodesError = CreateRulePromotionCodesErrors[keyof CreateRulePromotionCodesErrors];
|
|
669
|
+
export type CreateRulePromotionCodesResponses = {
|
|
670
|
+
/**
|
|
671
|
+
* Created
|
|
672
|
+
*/
|
|
673
|
+
201: CreatePromotionCodesResponse;
|
|
674
|
+
};
|
|
675
|
+
export type CreateRulePromotionCodesResponse = CreateRulePromotionCodesResponses[keyof CreateRulePromotionCodesResponses];
|
|
676
|
+
export type DeleteSingleRulePromotionCodeData = {
|
|
677
|
+
body?: never;
|
|
678
|
+
headers: {
|
|
679
|
+
/**
|
|
680
|
+
* The Bearer token required to get access to the API.
|
|
681
|
+
*/
|
|
682
|
+
Authorization: string;
|
|
683
|
+
};
|
|
684
|
+
path: {
|
|
685
|
+
/**
|
|
686
|
+
* The unique identifier of the rule promotion.
|
|
687
|
+
*/
|
|
688
|
+
promotionID: string;
|
|
689
|
+
/**
|
|
690
|
+
* The unique identifier of the rule promotion code.
|
|
691
|
+
*/
|
|
692
|
+
codeID: string;
|
|
693
|
+
};
|
|
694
|
+
query?: never;
|
|
695
|
+
url: "/v2/rule-promotions/{promotionID}/codes/{codeID}";
|
|
696
|
+
};
|
|
697
|
+
export type DeleteSingleRulePromotionCodeResponses = {
|
|
698
|
+
/**
|
|
699
|
+
* No Content
|
|
700
|
+
*/
|
|
701
|
+
204: void;
|
|
702
|
+
};
|
|
703
|
+
export type DeleteSingleRulePromotionCodeResponse = DeleteSingleRulePromotionCodeResponses[keyof DeleteSingleRulePromotionCodeResponses];
|
|
704
|
+
export type GetV2RulePromotionsByUuidJobsData = {
|
|
705
|
+
body?: never;
|
|
706
|
+
path: {
|
|
707
|
+
/**
|
|
708
|
+
* The unique identifier of a rule promotion.
|
|
709
|
+
*/
|
|
710
|
+
uuid: string;
|
|
711
|
+
};
|
|
712
|
+
query?: {
|
|
713
|
+
/**
|
|
714
|
+
* Specifies filter attributes.
|
|
715
|
+
*/
|
|
716
|
+
filter?: string;
|
|
717
|
+
};
|
|
718
|
+
url: "/v2/rule-promotions/{uuid}/jobs";
|
|
719
|
+
};
|
|
720
|
+
export type GetV2RulePromotionsByUuidJobsResponses = {
|
|
721
|
+
/**
|
|
722
|
+
* Successful response
|
|
723
|
+
*/
|
|
724
|
+
200: {
|
|
725
|
+
data?: Array<PromotionJob>;
|
|
726
|
+
};
|
|
727
|
+
};
|
|
728
|
+
export type GetV2RulePromotionsByUuidJobsResponse = GetV2RulePromotionsByUuidJobsResponses[keyof GetV2RulePromotionsByUuidJobsResponses];
|
|
729
|
+
/**
|
|
730
|
+
* Specifies the type of task to run.
|
|
731
|
+
*
|
|
732
|
+
*/
|
|
733
|
+
export type JobType = "code_generate" | "code_export";
|
|
734
|
+
export type PostV2RulePromotionsByUuidJobsData = {
|
|
735
|
+
body: {
|
|
736
|
+
/**
|
|
737
|
+
* Must be set to `promotion_job`.
|
|
738
|
+
*/
|
|
739
|
+
type?: "promotion_job";
|
|
740
|
+
/**
|
|
741
|
+
* Specifies the type of task to run.
|
|
742
|
+
*
|
|
743
|
+
*/
|
|
744
|
+
job_type?: "code_generate" | "code_export";
|
|
745
|
+
/**
|
|
746
|
+
* Represents the name of the job. The maximum allowed length is 50 characters.
|
|
747
|
+
*/
|
|
748
|
+
name?: string;
|
|
749
|
+
parameters?: {
|
|
750
|
+
/**
|
|
751
|
+
* Specifies the number of codes to be generated.
|
|
752
|
+
*/
|
|
753
|
+
number_of_codes?: number;
|
|
754
|
+
/**
|
|
755
|
+
* Specifies the maximum number of usages per code. If set to zero, you cannot use this promotion. If no value is set, it can be used unlimited times.
|
|
756
|
+
*/
|
|
757
|
+
max_uses_per_code?: number;
|
|
758
|
+
/**
|
|
759
|
+
* Specifies whether the code is consumed per application or per checkout. With `per_checkout`, the code is used once for each checkout, regardless of the number of items in the cart. When set to `per_application`, the code is used per application. For cart discounts, each application counts as one usage. For item discounts, each application to either a single quantity or a bundle is counted as one usage. For example, in a store that offers 50% off on SKU1, SKU2, and SKU3, and limits the maximum usage of the promotion code to two, a shopper can apply the promotion up to two quantities. If the cart contains two or more quantities of SKU1, the promotion is applied 2 times to SKU1, and other quantities and items are at the regular price. If the cart contains one quantity of SKU1, one quantity of SKU2, and one quantity of SKU3, the promotion is applied once to SKU1 and once to SKU2. The code usage is applied at checkout and the code is considered consumed at that point.
|
|
760
|
+
*
|
|
761
|
+
*/
|
|
762
|
+
consume_unit?: "per_application" | "per_checkout";
|
|
763
|
+
/**
|
|
764
|
+
* Prefix for generated promotion codes (e.g., `SUMMER-`).
|
|
765
|
+
*/
|
|
766
|
+
code_prefix?: string;
|
|
767
|
+
/**
|
|
768
|
+
* Code length.
|
|
769
|
+
*/
|
|
770
|
+
code_length?: number;
|
|
771
|
+
};
|
|
772
|
+
};
|
|
773
|
+
path: {
|
|
774
|
+
/**
|
|
775
|
+
* The unique identifier of the rule promotion.
|
|
776
|
+
*/
|
|
777
|
+
uuid: string;
|
|
778
|
+
};
|
|
779
|
+
query?: never;
|
|
780
|
+
url: "/v2/rule-promotions/{uuid}/jobs";
|
|
781
|
+
};
|
|
782
|
+
export type PostV2RulePromotionsByUuidJobsErrors = {
|
|
783
|
+
/**
|
|
784
|
+
* Bad Request
|
|
785
|
+
*/
|
|
786
|
+
400: {
|
|
787
|
+
errors?: Array<{
|
|
788
|
+
status?: string;
|
|
789
|
+
title?: string;
|
|
790
|
+
detail?: string;
|
|
791
|
+
}>;
|
|
792
|
+
};
|
|
793
|
+
};
|
|
794
|
+
export type PostV2RulePromotionsByUuidJobsError = PostV2RulePromotionsByUuidJobsErrors[keyof PostV2RulePromotionsByUuidJobsErrors];
|
|
795
|
+
export type PostV2RulePromotionsByUuidJobsResponses = {
|
|
796
|
+
/**
|
|
797
|
+
* Promotion job created
|
|
798
|
+
*/
|
|
799
|
+
201: {
|
|
800
|
+
data?: PromotionJob;
|
|
801
|
+
};
|
|
802
|
+
};
|
|
803
|
+
export type PostV2RulePromotionsByUuidJobsResponse = PostV2RulePromotionsByUuidJobsResponses[keyof PostV2RulePromotionsByUuidJobsResponses];
|
|
804
|
+
export type GetV2RulePromotionsByUuidJobsByJobUuidFileData = {
|
|
805
|
+
body?: never;
|
|
806
|
+
path: {
|
|
807
|
+
/**
|
|
808
|
+
* The unique identifier of the rule promotion.
|
|
809
|
+
*/
|
|
810
|
+
uuid: string;
|
|
811
|
+
/**
|
|
812
|
+
* The unique identifier of the job associated with the file.
|
|
813
|
+
*/
|
|
814
|
+
"job-uuid": string;
|
|
815
|
+
};
|
|
816
|
+
query?: never;
|
|
817
|
+
url: "/v2/rule-promotions/{uuid}/jobs/{job-uuid}/file";
|
|
818
|
+
};
|
|
819
|
+
export type GetV2RulePromotionsByUuidJobsByJobUuidFileResponses = {
|
|
820
|
+
/**
|
|
821
|
+
* Successful response
|
|
822
|
+
*/
|
|
823
|
+
200: {
|
|
824
|
+
/**
|
|
825
|
+
* URL to download the CSV file.
|
|
826
|
+
*/
|
|
827
|
+
href?: string;
|
|
828
|
+
};
|
|
829
|
+
};
|
|
830
|
+
export type GetV2RulePromotionsByUuidJobsByJobUuidFileResponse = GetV2RulePromotionsByUuidJobsByJobUuidFileResponses[keyof GetV2RulePromotionsByUuidJobsByJobUuidFileResponses];
|
|
831
|
+
export type PostV2RulePromotionsByUuidJobsByJobUuidCancelData = {
|
|
832
|
+
body?: never;
|
|
833
|
+
path: {
|
|
834
|
+
/**
|
|
835
|
+
* The unique identifier of the rule promotion.
|
|
836
|
+
*/
|
|
837
|
+
uuid: string;
|
|
838
|
+
/**
|
|
839
|
+
* The unique identifier of the job to be canceled.
|
|
840
|
+
*/
|
|
841
|
+
"job-uuid": string;
|
|
842
|
+
};
|
|
843
|
+
query?: never;
|
|
844
|
+
url: "/v2/rule-promotions/{uuid}/jobs/{job-uuid}/cancel";
|
|
845
|
+
};
|
|
846
|
+
export type PostV2RulePromotionsByUuidJobsByJobUuidCancelErrors = {
|
|
847
|
+
/**
|
|
848
|
+
* Unprocessable Entity
|
|
849
|
+
*/
|
|
850
|
+
422: {
|
|
851
|
+
errors?: Array<{
|
|
852
|
+
status?: string;
|
|
853
|
+
title?: string;
|
|
854
|
+
detail?: string;
|
|
855
|
+
}>;
|
|
856
|
+
};
|
|
857
|
+
};
|
|
858
|
+
export type PostV2RulePromotionsByUuidJobsByJobUuidCancelError = PostV2RulePromotionsByUuidJobsByJobUuidCancelErrors[keyof PostV2RulePromotionsByUuidJobsByJobUuidCancelErrors];
|
|
859
|
+
export type PostV2RulePromotionsByUuidJobsByJobUuidCancelResponses = {
|
|
860
|
+
/**
|
|
861
|
+
* Successfully Canceled the Rule Promotion Job
|
|
862
|
+
*/
|
|
863
|
+
200: PromotionJobCanceledResponse;
|
|
864
|
+
};
|
|
865
|
+
export type PostV2RulePromotionsByUuidJobsByJobUuidCancelResponse = PostV2RulePromotionsByUuidJobsByJobUuidCancelResponses[keyof PostV2RulePromotionsByUuidJobsByJobUuidCancelResponses];
|
|
866
|
+
export type AnonymizeRulePromotionUsagesData = {
|
|
867
|
+
body: {
|
|
868
|
+
data: {
|
|
869
|
+
/**
|
|
870
|
+
* The unique identifiers of the usages to be anonymized.
|
|
871
|
+
* Multiple usage IDs can be provided to anonymize in bulk.
|
|
872
|
+
*
|
|
873
|
+
*/
|
|
874
|
+
usage_ids?: Array<string>;
|
|
875
|
+
};
|
|
876
|
+
};
|
|
877
|
+
path?: never;
|
|
878
|
+
query?: never;
|
|
879
|
+
url: "/v2/rule-promotions/usages/anonymize";
|
|
880
|
+
};
|
|
881
|
+
export type AnonymizeRulePromotionUsagesErrors = {
|
|
882
|
+
/**
|
|
883
|
+
* Bad Request
|
|
884
|
+
*/
|
|
885
|
+
400: ResponseError;
|
|
886
|
+
/**
|
|
887
|
+
* Unauthorized
|
|
888
|
+
*/
|
|
889
|
+
401: ResponseError;
|
|
890
|
+
/**
|
|
891
|
+
* Not Found
|
|
892
|
+
*/
|
|
893
|
+
404: ResponseError;
|
|
894
|
+
};
|
|
895
|
+
export type AnonymizeRulePromotionUsagesError = AnonymizeRulePromotionUsagesErrors[keyof AnonymizeRulePromotionUsagesErrors];
|
|
896
|
+
export type AnonymizeRulePromotionUsagesResponses = {
|
|
897
|
+
/**
|
|
898
|
+
* OK
|
|
899
|
+
*/
|
|
900
|
+
200: {
|
|
901
|
+
data?: Array<RulePromotionUsage>;
|
|
902
|
+
};
|
|
903
|
+
};
|
|
904
|
+
export type AnonymizeRulePromotionUsagesResponse = AnonymizeRulePromotionUsagesResponses[keyof AnonymizeRulePromotionUsagesResponses];
|
|
905
|
+
export type GetRulePromotionUsagesData = {
|
|
906
|
+
body?: never;
|
|
907
|
+
headers: {
|
|
908
|
+
/**
|
|
909
|
+
* The Bearer token required to get access to the API.
|
|
910
|
+
*/
|
|
911
|
+
Authorization: string;
|
|
912
|
+
};
|
|
913
|
+
path: {
|
|
914
|
+
/**
|
|
915
|
+
* The unique identifier of the rule promotion.
|
|
916
|
+
*/
|
|
917
|
+
promotionID: string;
|
|
918
|
+
};
|
|
919
|
+
query?: {
|
|
920
|
+
/**
|
|
921
|
+
* Filter attributes to refine the usage records. Supported attributes:
|
|
922
|
+
* - `id`: Filter by usage ID.
|
|
923
|
+
* - `code`: Filter by promotion code.
|
|
924
|
+
* - `used_on`: Filter by usage date with operators `gt`, `ge`, `le`, `lt`.
|
|
925
|
+
*
|
|
926
|
+
*/
|
|
927
|
+
filter?: string;
|
|
928
|
+
/**
|
|
929
|
+
* The number of records per page.
|
|
930
|
+
*/
|
|
931
|
+
"page[limit]"?: number;
|
|
932
|
+
/**
|
|
933
|
+
* The number of records to offset the results by.
|
|
934
|
+
*/
|
|
935
|
+
"page[offset]"?: number;
|
|
936
|
+
};
|
|
937
|
+
url: "/v2/rule-promotions/{promotionID}/usages";
|
|
938
|
+
};
|
|
939
|
+
export type GetRulePromotionUsagesErrors = {
|
|
940
|
+
/**
|
|
941
|
+
* Unauthorized
|
|
942
|
+
*/
|
|
943
|
+
401: ResponseError;
|
|
944
|
+
/**
|
|
945
|
+
* Not Found
|
|
946
|
+
*/
|
|
947
|
+
404: ResponseError;
|
|
948
|
+
};
|
|
949
|
+
export type GetRulePromotionUsagesError = GetRulePromotionUsagesErrors[keyof GetRulePromotionUsagesErrors];
|
|
950
|
+
export type GetRulePromotionUsagesResponses = {
|
|
951
|
+
/**
|
|
952
|
+
* Successful response
|
|
953
|
+
*/
|
|
954
|
+
200: {
|
|
955
|
+
data?: Array<RulePromotionUsage>;
|
|
956
|
+
meta?: ResponsePaginationMeta;
|
|
957
|
+
};
|
|
958
|
+
};
|
|
959
|
+
export type GetRulePromotionUsagesResponse = GetRulePromotionUsagesResponses[keyof GetRulePromotionUsagesResponses];
|
|
960
|
+
export type GetRulePromotionCodeUsagesData = {
|
|
961
|
+
body?: never;
|
|
962
|
+
headers: {
|
|
963
|
+
/**
|
|
964
|
+
* The Bearer token required to get access to the API.
|
|
965
|
+
*/
|
|
966
|
+
Authorization: string;
|
|
967
|
+
};
|
|
968
|
+
path: {
|
|
969
|
+
/**
|
|
970
|
+
* The unique identifier of the rule promotion.
|
|
971
|
+
*/
|
|
972
|
+
promotionID: string;
|
|
973
|
+
/**
|
|
974
|
+
* The specific promotion code for which to retrieve usage records.
|
|
975
|
+
*/
|
|
976
|
+
code: string;
|
|
977
|
+
};
|
|
978
|
+
query?: {
|
|
979
|
+
/**
|
|
980
|
+
* Filter attributes to refine the results. Supported attributes:
|
|
981
|
+
* - `id`: Filter by usage ID.
|
|
982
|
+
* - `used_on`: Filter by date with operators `gt`, `ge`, `le`, `lt`.
|
|
983
|
+
*
|
|
984
|
+
*/
|
|
985
|
+
filter?: string;
|
|
986
|
+
/**
|
|
987
|
+
* The number of records per page.
|
|
988
|
+
*/
|
|
989
|
+
"page[limit]"?: number;
|
|
990
|
+
/**
|
|
991
|
+
* The number of records to offset the results by.
|
|
992
|
+
*/
|
|
993
|
+
"page[offset]"?: number;
|
|
994
|
+
};
|
|
995
|
+
url: "/v2/rule-promotions/{promotionID}/codes/{code}/usages";
|
|
996
|
+
};
|
|
997
|
+
export type GetRulePromotionCodeUsagesErrors = {
|
|
998
|
+
/**
|
|
999
|
+
* Unauthorized
|
|
1000
|
+
*/
|
|
1001
|
+
401: ResponseError;
|
|
1002
|
+
/**
|
|
1003
|
+
* Not Found
|
|
1004
|
+
*/
|
|
1005
|
+
404: ResponseError;
|
|
1006
|
+
};
|
|
1007
|
+
export type GetRulePromotionCodeUsagesError = GetRulePromotionCodeUsagesErrors[keyof GetRulePromotionCodeUsagesErrors];
|
|
1008
|
+
export type GetRulePromotionCodeUsagesResponses = {
|
|
1009
|
+
/**
|
|
1010
|
+
* Successful response
|
|
1011
|
+
*/
|
|
1012
|
+
200: {
|
|
1013
|
+
data?: Array<RulePromotionUsage>;
|
|
1014
|
+
meta?: ResponsePaginationMeta;
|
|
1015
|
+
};
|
|
1016
|
+
};
|
|
1017
|
+
export type GetRulePromotionCodeUsagesResponse = GetRulePromotionCodeUsagesResponses[keyof GetRulePromotionCodeUsagesResponses];
|