@voucherify/sdk 2.9.2 → 2.9.4
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/dist/ApiLimitsHandler.d.ts +13 -10
- package/dist/AsyncActions.d.ts +17 -15
- package/dist/Balance.d.ts +15 -12
- package/dist/Campaigns.d.ts +66 -58
- package/dist/Categories.d.ts +29 -26
- package/dist/ClientSide.d.ts +77 -53
- package/dist/Consents.d.ts +13 -10
- package/dist/Customers.d.ts +75 -72
- package/dist/Distributions.d.ts +29 -22
- package/dist/Events.d.ts +15 -10
- package/dist/Exports.d.ts +25 -22
- package/dist/Loyalties.d.ts +171 -159
- package/dist/MetadataSchemas.d.ts +17 -14
- package/dist/Orders.d.ts +32 -27
- package/dist/ProductCollections.d.ts +30 -26
- package/dist/Products.d.ts +66 -63
- package/dist/PromotionTiers.d.ts +43 -34
- package/dist/Promotions.d.ts +30 -18
- package/dist/PromotionsStacks.d.ts +34 -30
- package/dist/Qualifications.d.ts +24 -10
- package/dist/Redemptions.d.ts +53 -35
- package/dist/RequestController.d.ts +31 -29
- package/dist/Rewards.d.ts +46 -43
- package/dist/Segments.d.ts +25 -22
- package/dist/ValidationRules.d.ts +47 -43
- package/dist/Validations.d.ts +39 -17
- package/dist/VoucherifyClientSide.d.ts +112 -86
- package/dist/VoucherifyError.d.ts +23 -20
- package/dist/VoucherifyServerSide.d.ts +170 -131
- package/dist/Vouchers.d.ts +84 -78
- package/dist/helpers.d.ts +20 -18
- package/dist/index.d.ts +63 -25
- package/dist/types/ApplicableTo.d.ts +32 -30
- package/dist/types/AsyncActions.d.ts +23 -21
- package/dist/types/Balance.d.ts +18 -16
- package/dist/types/Campaigns.d.ts +124 -120
- package/dist/types/Categories.d.ts +40 -38
- package/dist/types/ClientSide.d.ts +145 -134
- package/dist/types/Consents.d.ts +34 -33
- package/dist/types/Customers.d.ts +363 -361
- package/dist/types/DiscountVoucher.d.ts +94 -93
- package/dist/types/Distributions.d.ts +148 -144
- package/dist/types/Events.d.ts +21 -17
- package/dist/types/Exports.d.ts +151 -149
- package/dist/types/Gift.d.ts +5 -3
- package/dist/types/Loyalties.d.ts +1061 -1057
- package/dist/types/MetadataSchemas.d.ts +34 -33
- package/dist/types/Orders.d.ts +199 -195
- package/dist/types/ProductCollections.d.ts +99 -96
- package/dist/types/Products.d.ts +108 -106
- package/dist/types/PromotionTiers.d.ts +131 -127
- package/dist/types/Promotions.d.ts +113 -108
- package/dist/types/PromotionsStacks.d.ts +74 -71
- package/dist/types/Qualifications.d.ts +92 -86
- package/dist/types/Redemptions.d.ts +215 -205
- package/dist/types/Rewards.d.ts +220 -219
- package/dist/types/Segments.d.ts +34 -32
- package/dist/types/Stackable.d.ts +106 -101
- package/dist/types/UtilityTypes.d.ts +5 -3
- package/dist/types/ValidateSession.d.ts +19 -17
- package/dist/types/ValidationError.d.ts +9 -7
- package/dist/types/ValidationRules.d.ts +96 -93
- package/dist/types/Validations.d.ts +109 -98
- package/dist/types/Vouchers.d.ts +452 -364
- package/dist/types/index.d.ts +27 -25
- package/dist/voucherifysdk.cjs +2023 -0
- package/dist/voucherifysdk.cjs.map +1 -0
- package/dist/voucherifysdk.esm.js +981 -1256
- package/dist/voucherifysdk.esm.js.map +1 -1
- package/package.json +13 -9
- package/CHANGELOG.md +0 -663
- package/dist/voucherifysdk.umd.development.js +0 -2270
- package/dist/voucherifysdk.umd.development.js.map +0 -1
- package/dist/voucherifysdk.umd.production.min.js +0 -2
- package/dist/voucherifysdk.umd.production.min.js.map +0 -1
|
@@ -1,1057 +1,1061 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ProductsCreateResponse, ProductsCreateSkuResponse } from './Products';
|
|
3
|
-
import { SimpleCustomer } from './Customers';
|
|
4
|
-
import { ValidationRulesCreateAssignmentResponse } from './ValidationRules';
|
|
5
|
-
import { VouchersExportTransactionsRequestBody, VouchersExportTransactionsResponseBody
|
|
6
|
-
import { Reward, RewardAssignment } from './Rewards';
|
|
7
|
-
import { Category } from './Categories';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
};
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
};
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
};
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
};
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
points: number;
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
id
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
}
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
}
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
}
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
}
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
};
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
};
|
|
830
|
-
|
|
831
|
-
id: string;
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
};
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
};
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
}
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1
|
+
import { OrdersItem, OrdersCreateResponse } from './Orders.js';
|
|
2
|
+
import { ProductsCreateResponse, ProductsCreateSkuResponse } from './Products.js';
|
|
3
|
+
import { SimpleCustomer } from './Customers.js';
|
|
4
|
+
import { ValidationRulesCreateAssignmentResponse } from './ValidationRules.js';
|
|
5
|
+
import { VouchersResponse, VouchersExportTransactionsRequestBody, VouchersExportTransactionsResponseBody } from './Vouchers.js';
|
|
6
|
+
import { Reward, RewardAssignment } from './Rewards.js';
|
|
7
|
+
import { Category } from './Categories.js';
|
|
8
|
+
import './DiscountVoucher.js';
|
|
9
|
+
import './ApplicableTo.js';
|
|
10
|
+
|
|
11
|
+
interface LoyaltiesVoucher {
|
|
12
|
+
code_config?: {
|
|
13
|
+
length?: number;
|
|
14
|
+
charset?: string;
|
|
15
|
+
pattern?: string;
|
|
16
|
+
prefix?: string;
|
|
17
|
+
suffix?: string;
|
|
18
|
+
};
|
|
19
|
+
type?: string;
|
|
20
|
+
is_referral_code?: boolean;
|
|
21
|
+
loyalty_card?: {
|
|
22
|
+
points: number;
|
|
23
|
+
balance: number;
|
|
24
|
+
};
|
|
25
|
+
redemption?: {
|
|
26
|
+
quantity?: number;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
interface LoyaltiesListParams {
|
|
30
|
+
limit?: number;
|
|
31
|
+
page?: number;
|
|
32
|
+
}
|
|
33
|
+
interface LoyaltiesListResponse {
|
|
34
|
+
object: 'list';
|
|
35
|
+
total: number;
|
|
36
|
+
data_ref: 'campaigns';
|
|
37
|
+
campaigns?: LoyaltiesCreateCampaignResponse[];
|
|
38
|
+
}
|
|
39
|
+
interface LoyaltiesCreateCampaign {
|
|
40
|
+
name: string;
|
|
41
|
+
start_date?: string;
|
|
42
|
+
expiration_date?: string;
|
|
43
|
+
type?: 'AUTO_UPDATE' | 'STATIC';
|
|
44
|
+
vouchers_count?: number;
|
|
45
|
+
voucher: {
|
|
46
|
+
type: 'LOYALTY_CARD';
|
|
47
|
+
redemption?: {
|
|
48
|
+
quantity: number;
|
|
49
|
+
};
|
|
50
|
+
loyalty_card: {
|
|
51
|
+
points: number;
|
|
52
|
+
balance?: number;
|
|
53
|
+
};
|
|
54
|
+
code_config?: {
|
|
55
|
+
length?: number;
|
|
56
|
+
charset?: string;
|
|
57
|
+
pattern?: string;
|
|
58
|
+
prefix?: string;
|
|
59
|
+
suffix?: string;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
metadata?: Record<string, any>;
|
|
63
|
+
}
|
|
64
|
+
interface LoyaltiesCreateCampaignResponse {
|
|
65
|
+
id: string;
|
|
66
|
+
name: string;
|
|
67
|
+
campaign_type?: 'LOYALTY_PROGRAM';
|
|
68
|
+
type: 'AUTO_UPDATE' | 'STATIC';
|
|
69
|
+
category?: string;
|
|
70
|
+
auto_join?: boolean;
|
|
71
|
+
join_once?: boolean;
|
|
72
|
+
description?: string;
|
|
73
|
+
start_date?: string;
|
|
74
|
+
validation_rules_assignments?: {
|
|
75
|
+
data?: ValidationRulesCreateAssignmentResponse[];
|
|
76
|
+
object: 'list';
|
|
77
|
+
total: number;
|
|
78
|
+
data_ref: 'data';
|
|
79
|
+
};
|
|
80
|
+
expiration_date?: string;
|
|
81
|
+
activity_duration_after_publishing?: string;
|
|
82
|
+
validity_timeframe?: {
|
|
83
|
+
interval?: string;
|
|
84
|
+
duration?: string;
|
|
85
|
+
};
|
|
86
|
+
validity_day_of_week?: number[];
|
|
87
|
+
metadata?: Record<string, any>;
|
|
88
|
+
created_at: string;
|
|
89
|
+
vouchers_generation_status: 'IN_PROGRESS' | 'DONE' | 'FAILED' | 'DRAFT';
|
|
90
|
+
active: boolean;
|
|
91
|
+
voucher?: LoyaltiesVoucher;
|
|
92
|
+
referral_program?: boolean;
|
|
93
|
+
use_voucher_metadata_schema?: boolean;
|
|
94
|
+
protected?: boolean;
|
|
95
|
+
vouchers_count?: number;
|
|
96
|
+
object: 'campaign';
|
|
97
|
+
}
|
|
98
|
+
type LoyaltiesGetCampaignResponse = LoyaltiesCreateCampaignResponse;
|
|
99
|
+
interface LoyaltiesUpdateCampaign {
|
|
100
|
+
id: string;
|
|
101
|
+
start_date?: string;
|
|
102
|
+
expiration_date?: string;
|
|
103
|
+
metadata?: Record<string, any>;
|
|
104
|
+
description?: string;
|
|
105
|
+
type?: 'AUTO_UPDATE' | 'STATIC';
|
|
106
|
+
}
|
|
107
|
+
type LoyaltiesUpdateCampaignResponse = LoyaltiesCreateCampaignResponse;
|
|
108
|
+
interface LoyaltiesDeleteCampaignParams {
|
|
109
|
+
force?: boolean;
|
|
110
|
+
}
|
|
111
|
+
interface LoyaltiesListRewardAssignmentsParams {
|
|
112
|
+
limit?: number;
|
|
113
|
+
page?: number;
|
|
114
|
+
}
|
|
115
|
+
interface LoyaltiesListRewardAssignmentsResponse {
|
|
116
|
+
object: 'list';
|
|
117
|
+
total: number;
|
|
118
|
+
data_ref: 'data';
|
|
119
|
+
data: LoyaltiesCreateRewardAssignmentResponse[];
|
|
120
|
+
}
|
|
121
|
+
interface LoyaltiesCreateRewardAssignments {
|
|
122
|
+
reward: string;
|
|
123
|
+
parameters: {
|
|
124
|
+
loyalty: {
|
|
125
|
+
points: number;
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
interface LoyaltiesCreateRewardAssignmentResponse {
|
|
130
|
+
id: string;
|
|
131
|
+
reward_id: string;
|
|
132
|
+
related_object_id?: string;
|
|
133
|
+
related_object_type?: string;
|
|
134
|
+
parameters?: {
|
|
135
|
+
loyalty: {
|
|
136
|
+
points: number;
|
|
137
|
+
};
|
|
138
|
+
};
|
|
139
|
+
created_at: string;
|
|
140
|
+
updated_at?: string;
|
|
141
|
+
object: 'reward_assignment';
|
|
142
|
+
}
|
|
143
|
+
interface LoyaltiesUpdateRewardAssignment {
|
|
144
|
+
id: string;
|
|
145
|
+
parameters: {
|
|
146
|
+
loyalty: {
|
|
147
|
+
points: number;
|
|
148
|
+
};
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
type LoyaltiesUpdateRewardAssignmentResponse = LoyaltiesCreateRewardAssignmentResponse;
|
|
152
|
+
interface LoyaltiesListEarningRulesParams {
|
|
153
|
+
limit?: number;
|
|
154
|
+
page?: number;
|
|
155
|
+
}
|
|
156
|
+
interface LoyaltyFixed {
|
|
157
|
+
type: 'FIXED';
|
|
158
|
+
points: number;
|
|
159
|
+
}
|
|
160
|
+
interface LoyaltyProportional {
|
|
161
|
+
type: 'PROPORTIONAL';
|
|
162
|
+
calculation_type?: 'ORDER_AMOUNT' | 'ORDER_TOTAL_AMOUNT' | 'ORDER_METADATA' | 'ORDER_ITEMS_QUANTITY' | 'ORDER_ITEMS_AMOUNT' | 'ORDER_ITEMS_SUBTOTAL_AMOUNT' | 'CUSTOMER_METADATA' | 'CUSTOM_EVENT_METADATA';
|
|
163
|
+
order?: {
|
|
164
|
+
amount: {
|
|
165
|
+
every: number;
|
|
166
|
+
points: number;
|
|
167
|
+
};
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
interface LoyaltiesEarningRulesResponse {
|
|
171
|
+
id: string;
|
|
172
|
+
created_at: string;
|
|
173
|
+
updated_at?: string;
|
|
174
|
+
validation_rule_id?: string;
|
|
175
|
+
loyalty: LoyaltyFixed | LoyaltyProportional;
|
|
176
|
+
segment?: {
|
|
177
|
+
id: string;
|
|
178
|
+
};
|
|
179
|
+
event: 'customer.segment.entered' | 'order.paid' | string;
|
|
180
|
+
source?: {
|
|
181
|
+
banner?: string;
|
|
182
|
+
object_id?: string;
|
|
183
|
+
object_type?: string;
|
|
184
|
+
};
|
|
185
|
+
object: 'earning_rule';
|
|
186
|
+
automation_id: string;
|
|
187
|
+
}
|
|
188
|
+
interface LoyaltiesListEarningRulesResponse {
|
|
189
|
+
object: 'list';
|
|
190
|
+
total: number;
|
|
191
|
+
data_ref: string;
|
|
192
|
+
data: LoyaltiesEarningRulesResponse[];
|
|
193
|
+
}
|
|
194
|
+
interface LoyaltiesCreateEarningRule {
|
|
195
|
+
event: 'order.paid' | 'customer.segment.entered' | string;
|
|
196
|
+
validation_rule_id?: string;
|
|
197
|
+
loyalty: LoyaltyProportional | LoyaltyFixed;
|
|
198
|
+
source?: {
|
|
199
|
+
banner?: string;
|
|
200
|
+
};
|
|
201
|
+
custom_event?: {
|
|
202
|
+
schema_id?: string;
|
|
203
|
+
};
|
|
204
|
+
segment?: {
|
|
205
|
+
id?: string;
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
type LoyaltiesCreateEarningRuleResponse = LoyaltiesEarningRulesResponse;
|
|
209
|
+
interface LoyaltiesUpdateEarningRule {
|
|
210
|
+
id: string;
|
|
211
|
+
validation_rule_id?: string;
|
|
212
|
+
source?: {
|
|
213
|
+
banner: string;
|
|
214
|
+
};
|
|
215
|
+
loyalty?: {
|
|
216
|
+
points: number;
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
type LoyaltiesUpdateEarningRuleResponse = LoyaltiesEarningRulesResponse;
|
|
220
|
+
interface LoyaltiesListMembersParams {
|
|
221
|
+
limit?: number;
|
|
222
|
+
page?: number;
|
|
223
|
+
created_at?: {
|
|
224
|
+
before?: string;
|
|
225
|
+
after?: string;
|
|
226
|
+
};
|
|
227
|
+
updated_at?: {
|
|
228
|
+
before?: string;
|
|
229
|
+
after?: string;
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
interface LoyaltiesVoucherResponse {
|
|
233
|
+
id: string;
|
|
234
|
+
code: string;
|
|
235
|
+
campaign: string;
|
|
236
|
+
campaign_id: string;
|
|
237
|
+
category?: string;
|
|
238
|
+
type: 'LOYALTY_CARD';
|
|
239
|
+
loyalty_card: {
|
|
240
|
+
points: number;
|
|
241
|
+
balance: number;
|
|
242
|
+
next_expiration_date?: string;
|
|
243
|
+
next_expiration_points?: number;
|
|
244
|
+
};
|
|
245
|
+
start_date?: string;
|
|
246
|
+
expiration_date?: string;
|
|
247
|
+
validity_timeframe?: {
|
|
248
|
+
interval?: string;
|
|
249
|
+
duration?: string;
|
|
250
|
+
};
|
|
251
|
+
validity_day_of_week?: number[];
|
|
252
|
+
publish?: {
|
|
253
|
+
count?: number;
|
|
254
|
+
entries?: string[];
|
|
255
|
+
};
|
|
256
|
+
redemption?: {
|
|
257
|
+
quantity?: number;
|
|
258
|
+
redeemed_points?: number;
|
|
259
|
+
redeemed_quantity?: number;
|
|
260
|
+
redemption_entries?: string[];
|
|
261
|
+
};
|
|
262
|
+
active?: boolean;
|
|
263
|
+
additional_info?: string;
|
|
264
|
+
metadata?: Record<string, any>;
|
|
265
|
+
is_referral_code?: boolean;
|
|
266
|
+
holder_id?: string;
|
|
267
|
+
updated_at?: string;
|
|
268
|
+
}
|
|
269
|
+
interface LoyaltiesListMembersResponse {
|
|
270
|
+
object: 'list';
|
|
271
|
+
total: number;
|
|
272
|
+
data_ref: 'vouchers';
|
|
273
|
+
vouchers: LoyaltiesVoucherResponse[];
|
|
274
|
+
}
|
|
275
|
+
interface LoyaltiesCreateMember {
|
|
276
|
+
voucher?: string;
|
|
277
|
+
channel?: string;
|
|
278
|
+
customer: {
|
|
279
|
+
id?: string;
|
|
280
|
+
name?: string;
|
|
281
|
+
email?: string;
|
|
282
|
+
metadata?: Record<string, any>;
|
|
283
|
+
description?: string;
|
|
284
|
+
source_id?: string;
|
|
285
|
+
};
|
|
286
|
+
metadata?: Record<string, any>;
|
|
287
|
+
}
|
|
288
|
+
type LoyaltiesCreateMemberResponse = LoyaltiesVoucherResponse;
|
|
289
|
+
type LoyaltiesGetMemberResponse = LoyaltiesCreateMemberResponse;
|
|
290
|
+
type LoyaltiesListMemberActivityParams = {
|
|
291
|
+
order?: 'created_at' | '-created_at';
|
|
292
|
+
starting_after_id?: string;
|
|
293
|
+
limit?: number;
|
|
294
|
+
};
|
|
295
|
+
type LoyaltiesListMemberActivityResponse = {
|
|
296
|
+
object: 'list';
|
|
297
|
+
data_ref: 'data';
|
|
298
|
+
data: {
|
|
299
|
+
id: string;
|
|
300
|
+
type: string;
|
|
301
|
+
data: any;
|
|
302
|
+
created_at: string;
|
|
303
|
+
group_id: string;
|
|
304
|
+
}[];
|
|
305
|
+
has_more: boolean;
|
|
306
|
+
more_starting_after?: string;
|
|
307
|
+
};
|
|
308
|
+
interface LoyaltiesGetMemberActivitiesResponse {
|
|
309
|
+
object: 'list';
|
|
310
|
+
data_ref: 'activities';
|
|
311
|
+
total: number;
|
|
312
|
+
activities: {
|
|
313
|
+
id: string;
|
|
314
|
+
type: string;
|
|
315
|
+
object: string;
|
|
316
|
+
created_at: string;
|
|
317
|
+
data: any;
|
|
318
|
+
}[];
|
|
319
|
+
}
|
|
320
|
+
interface LoyaltiesAddPoints {
|
|
321
|
+
points: number;
|
|
322
|
+
}
|
|
323
|
+
interface LoyaltiesAddPointsResponse {
|
|
324
|
+
points: number;
|
|
325
|
+
total: number;
|
|
326
|
+
balance: number;
|
|
327
|
+
type: string;
|
|
328
|
+
object: 'balance';
|
|
329
|
+
related_object?: {
|
|
330
|
+
type?: string;
|
|
331
|
+
id?: string;
|
|
332
|
+
};
|
|
333
|
+
}
|
|
334
|
+
interface LoyaltiesRedeemRewardParams {
|
|
335
|
+
reward: {
|
|
336
|
+
id: string;
|
|
337
|
+
};
|
|
338
|
+
order?: {
|
|
339
|
+
id?: string;
|
|
340
|
+
source_id?: string;
|
|
341
|
+
amount: number;
|
|
342
|
+
items?: OrdersItem[];
|
|
343
|
+
metadata?: Record<string, any>;
|
|
344
|
+
};
|
|
345
|
+
metadata?: Record<string, any>;
|
|
346
|
+
}
|
|
347
|
+
interface CoinReward {
|
|
348
|
+
assignment_id: string;
|
|
349
|
+
loyalty_tier_id: string;
|
|
350
|
+
id: string;
|
|
351
|
+
name: string;
|
|
352
|
+
created_at: string;
|
|
353
|
+
updated_at?: string;
|
|
354
|
+
parameters: {
|
|
355
|
+
automation_id?: string;
|
|
356
|
+
coin: {
|
|
357
|
+
exchange_ratio: number;
|
|
358
|
+
points_ratio: number;
|
|
359
|
+
};
|
|
360
|
+
};
|
|
361
|
+
type: 'COIN';
|
|
362
|
+
object: 'reward';
|
|
363
|
+
}
|
|
364
|
+
interface MaterialReward {
|
|
365
|
+
assignment_id: string;
|
|
366
|
+
loyalty_tier_id: string;
|
|
367
|
+
product: ProductsCreateResponse & ProductsCreateSkuResponse;
|
|
368
|
+
id: string;
|
|
369
|
+
name: string;
|
|
370
|
+
created_at: string;
|
|
371
|
+
updated_at?: string;
|
|
372
|
+
parameters: {
|
|
373
|
+
automation_id?: string;
|
|
374
|
+
product?: {
|
|
375
|
+
id: string;
|
|
376
|
+
};
|
|
377
|
+
};
|
|
378
|
+
type: 'MATERIAL';
|
|
379
|
+
object: 'reward';
|
|
380
|
+
}
|
|
381
|
+
interface CampaignReward {
|
|
382
|
+
assignment_id: string;
|
|
383
|
+
loyalty_tier_id: string;
|
|
384
|
+
voucher: VouchersResponse;
|
|
385
|
+
id: string;
|
|
386
|
+
name: string;
|
|
387
|
+
created_at: string;
|
|
388
|
+
updated_at?: string;
|
|
389
|
+
parameters: {
|
|
390
|
+
automation_id?: string;
|
|
391
|
+
campaign?: {
|
|
392
|
+
id: string;
|
|
393
|
+
};
|
|
394
|
+
};
|
|
395
|
+
type: 'CAMPAIGN';
|
|
396
|
+
object: 'reward';
|
|
397
|
+
}
|
|
398
|
+
interface LoyaltiesRedeemRewardResponse {
|
|
399
|
+
id: string;
|
|
400
|
+
object: 'redemption';
|
|
401
|
+
date: string;
|
|
402
|
+
customer_id: string;
|
|
403
|
+
amount: number;
|
|
404
|
+
order?: Omit<OrdersCreateResponse, 'customer'> & {
|
|
405
|
+
total_discount_amount: number;
|
|
406
|
+
total_amount: number;
|
|
407
|
+
customer: {
|
|
408
|
+
id: string;
|
|
409
|
+
object: 'customer';
|
|
410
|
+
referrals: {
|
|
411
|
+
campaigns: any[];
|
|
412
|
+
total: number;
|
|
413
|
+
};
|
|
414
|
+
};
|
|
415
|
+
};
|
|
416
|
+
customer: SimpleCustomer;
|
|
417
|
+
reward: MaterialReward | CampaignReward | CoinReward;
|
|
418
|
+
result: 'SUCCESS' | 'FAILURE';
|
|
419
|
+
tracking_id?: string;
|
|
420
|
+
voucher: {
|
|
421
|
+
id: string;
|
|
422
|
+
code?: string;
|
|
423
|
+
campaign?: string;
|
|
424
|
+
campaign_id?: string;
|
|
425
|
+
category?: string;
|
|
426
|
+
type: 'LOYALTY_CARD';
|
|
427
|
+
loyalty_card?: {
|
|
428
|
+
points: number;
|
|
429
|
+
balance: number;
|
|
430
|
+
};
|
|
431
|
+
start_date?: string;
|
|
432
|
+
expiration_date?: string;
|
|
433
|
+
validity_timeframe?: {
|
|
434
|
+
interval?: string;
|
|
435
|
+
duration?: string;
|
|
436
|
+
};
|
|
437
|
+
validity_day_of_week?: number[];
|
|
438
|
+
publish: {
|
|
439
|
+
object: 'list';
|
|
440
|
+
count: number;
|
|
441
|
+
url: string;
|
|
442
|
+
};
|
|
443
|
+
redemption: {
|
|
444
|
+
object: 'list';
|
|
445
|
+
quantity: number;
|
|
446
|
+
redeemed_quantity: number;
|
|
447
|
+
url: string;
|
|
448
|
+
redeemed_points: number;
|
|
449
|
+
};
|
|
450
|
+
active: true;
|
|
451
|
+
additional_info?: string;
|
|
452
|
+
assets?: {
|
|
453
|
+
qr?: {
|
|
454
|
+
id: string;
|
|
455
|
+
url: string;
|
|
456
|
+
};
|
|
457
|
+
barcode?: {
|
|
458
|
+
id: string;
|
|
459
|
+
url: string;
|
|
460
|
+
};
|
|
461
|
+
};
|
|
462
|
+
is_referral_code: boolean;
|
|
463
|
+
referrer_id: string;
|
|
464
|
+
holder_id: string;
|
|
465
|
+
created_at: string;
|
|
466
|
+
updated_at: string;
|
|
467
|
+
holder: {
|
|
468
|
+
id: string;
|
|
469
|
+
source_id: string;
|
|
470
|
+
metadata?: Record<string, any>;
|
|
471
|
+
object: 'customer';
|
|
472
|
+
};
|
|
473
|
+
object?: 'voucher';
|
|
474
|
+
validation_rules_assignments: {
|
|
475
|
+
object: 'list';
|
|
476
|
+
total: number;
|
|
477
|
+
data_ref: 'data';
|
|
478
|
+
data?: {
|
|
479
|
+
id: string;
|
|
480
|
+
rule_id?: string;
|
|
481
|
+
related_object_id?: string;
|
|
482
|
+
related_object_type?: string;
|
|
483
|
+
created_at: string;
|
|
484
|
+
object: 'validation_rules_assignment';
|
|
485
|
+
}[];
|
|
486
|
+
};
|
|
487
|
+
};
|
|
488
|
+
}
|
|
489
|
+
interface LoyaltyPointsTransfer {
|
|
490
|
+
code: string;
|
|
491
|
+
points: number;
|
|
492
|
+
}
|
|
493
|
+
type LoyaltiesTransferPointsResponseBody = {
|
|
494
|
+
id: string;
|
|
495
|
+
code: string;
|
|
496
|
+
campaign: string;
|
|
497
|
+
campaign_id: string;
|
|
498
|
+
category: string | null;
|
|
499
|
+
category_id: string | null;
|
|
500
|
+
categories: Category[];
|
|
501
|
+
type: 'LOYALTY_CARD';
|
|
502
|
+
loyalty_card: {
|
|
503
|
+
points: number;
|
|
504
|
+
balance: number;
|
|
505
|
+
next_expiration_date?: string;
|
|
506
|
+
next_expiration_points?: number;
|
|
507
|
+
};
|
|
508
|
+
start_date: string | null;
|
|
509
|
+
expiration_date: string | null;
|
|
510
|
+
validity_timeframe: {
|
|
511
|
+
interval?: string;
|
|
512
|
+
duration?: string;
|
|
513
|
+
} | null;
|
|
514
|
+
validity_day_of_week: number[] | null;
|
|
515
|
+
publish?: {
|
|
516
|
+
object: 'list';
|
|
517
|
+
count?: number;
|
|
518
|
+
entries?: string[];
|
|
519
|
+
url?: string;
|
|
520
|
+
};
|
|
521
|
+
redemption?: {
|
|
522
|
+
quantity: number | null;
|
|
523
|
+
redeemed_points?: number;
|
|
524
|
+
redeemed_quantity?: number;
|
|
525
|
+
redemption_entries?: string[];
|
|
526
|
+
object?: 'list';
|
|
527
|
+
url?: string;
|
|
528
|
+
};
|
|
529
|
+
active: boolean;
|
|
530
|
+
additional_info: string | null;
|
|
531
|
+
metadata: Record<string, unknown>;
|
|
532
|
+
is_referral_code: boolean;
|
|
533
|
+
holder_id?: string;
|
|
534
|
+
updated_at?: string;
|
|
535
|
+
created_at: string;
|
|
536
|
+
};
|
|
537
|
+
type LoyaltiesTransferPointsRequestBody = LoyaltiesTransferPoints[];
|
|
538
|
+
interface LoyaltiesListCardTransactionsRequestQuery {
|
|
539
|
+
limit?: number;
|
|
540
|
+
starting_after_id?: string;
|
|
541
|
+
order?: 'id' | '-id';
|
|
542
|
+
/**
|
|
543
|
+
* @deprecated Use starting_after_id
|
|
544
|
+
*/
|
|
545
|
+
page?: number;
|
|
546
|
+
}
|
|
547
|
+
interface LoyaltiesListCardTransactionsResponseBody {
|
|
548
|
+
object: 'list';
|
|
549
|
+
data_ref: 'data';
|
|
550
|
+
data: LoyaltyCardTransaction[];
|
|
551
|
+
has_more: boolean;
|
|
552
|
+
more_starting_after?: string;
|
|
553
|
+
}
|
|
554
|
+
type LoyaltiesExportCardTransactionsRequestBody = VouchersExportTransactionsRequestBody;
|
|
555
|
+
type LoyaltiesCreateTiersRequestBody = (LoyaltyTierBase & {
|
|
556
|
+
metadata?: Record<string, unknown>;
|
|
557
|
+
})[];
|
|
558
|
+
type LoyaltiesCreateTiersResponseBody = LoyaltyTier[];
|
|
559
|
+
type LoyaltiesGetRewardDetailsResponseBody = Reward;
|
|
560
|
+
interface LoyaltiesListTiersRequestQuery {
|
|
561
|
+
limit?: number;
|
|
562
|
+
page?: number;
|
|
563
|
+
order?: 'created_at' | '-created_at' | 'updated_at' | '-updated_at';
|
|
564
|
+
}
|
|
565
|
+
interface LoyaltiesListLoyaltyTierEarningRulesRequestQuery {
|
|
566
|
+
limit?: number;
|
|
567
|
+
page?: number;
|
|
568
|
+
}
|
|
569
|
+
type LoyaltiesGetTierResponseBody = LoyaltyTier;
|
|
570
|
+
interface LoyaltiesListTiersResponseBody {
|
|
571
|
+
object: 'list';
|
|
572
|
+
data_ref: 'data';
|
|
573
|
+
data: LoyaltyTier[];
|
|
574
|
+
total: number;
|
|
575
|
+
}
|
|
576
|
+
interface LoyaltiesListMemberLoyaltyTiersResponseBody {
|
|
577
|
+
object: 'list';
|
|
578
|
+
data_ref: 'data';
|
|
579
|
+
data: LoyaltyTier[];
|
|
580
|
+
total: number;
|
|
581
|
+
}
|
|
582
|
+
interface LoyaltiesListMemberRewardsRequestQuery {
|
|
583
|
+
affordable_only?: boolean;
|
|
584
|
+
limit?: number;
|
|
585
|
+
page?: number;
|
|
586
|
+
}
|
|
587
|
+
interface LoyaltiesListMemberRewardsRequestQuery {
|
|
588
|
+
affordable_only?: boolean;
|
|
589
|
+
limit?: number;
|
|
590
|
+
page?: number;
|
|
591
|
+
}
|
|
592
|
+
interface LoyaltiesListMemberRewardsResponseBody {
|
|
593
|
+
object: 'list';
|
|
594
|
+
data_ref: 'data';
|
|
595
|
+
data: {
|
|
596
|
+
reward: Reward;
|
|
597
|
+
assignment: RewardAssignment;
|
|
598
|
+
object: 'loyalty_reward';
|
|
599
|
+
}[];
|
|
600
|
+
total: number;
|
|
601
|
+
}
|
|
602
|
+
interface LoyaltiesListMemberRewardsResponseBody {
|
|
603
|
+
object: 'list';
|
|
604
|
+
data_ref: 'data';
|
|
605
|
+
data: {
|
|
606
|
+
reward: Reward;
|
|
607
|
+
assignment: RewardAssignment;
|
|
608
|
+
object: 'loyalty_reward';
|
|
609
|
+
}[];
|
|
610
|
+
total: number;
|
|
611
|
+
}
|
|
612
|
+
interface LoyaltiesGetPointsExpirationRequestQuery {
|
|
613
|
+
limit?: number;
|
|
614
|
+
page?: number;
|
|
615
|
+
}
|
|
616
|
+
interface LoyaltiesGetPointsExpirationRequestQuery {
|
|
617
|
+
limit?: number;
|
|
618
|
+
page?: number;
|
|
619
|
+
}
|
|
620
|
+
interface LoyaltiesGetPointsExpirationResponseBody {
|
|
621
|
+
object: 'list';
|
|
622
|
+
data_ref: 'data';
|
|
623
|
+
data: {
|
|
624
|
+
id: string;
|
|
625
|
+
voucher_id: string;
|
|
626
|
+
campaign_id: string;
|
|
627
|
+
bucket: {
|
|
628
|
+
total_points: number;
|
|
629
|
+
};
|
|
630
|
+
created_at: string;
|
|
631
|
+
status: string;
|
|
632
|
+
expires_at: string;
|
|
633
|
+
updated_at?: string;
|
|
634
|
+
object: 'loyalty_points_bucket';
|
|
635
|
+
}[];
|
|
636
|
+
total: number;
|
|
637
|
+
}
|
|
638
|
+
interface LoyaltiesGetPointsExpirationResponseBody {
|
|
639
|
+
object: 'list';
|
|
640
|
+
data_ref: 'data';
|
|
641
|
+
data: {
|
|
642
|
+
id: string;
|
|
643
|
+
voucher_id: string;
|
|
644
|
+
campaign_id: string;
|
|
645
|
+
bucket: {
|
|
646
|
+
total_points: number;
|
|
647
|
+
};
|
|
648
|
+
created_at: string;
|
|
649
|
+
status: string;
|
|
650
|
+
expires_at: string;
|
|
651
|
+
updated_at?: string;
|
|
652
|
+
object: 'loyalty_points_bucket';
|
|
653
|
+
}[];
|
|
654
|
+
total: number;
|
|
655
|
+
}
|
|
656
|
+
type LoyaltiesExportCardTransactionsResponseBody = VouchersExportTransactionsResponseBody;
|
|
657
|
+
interface LoyaltiesAddOrRemoveCardBalanceRequestBody {
|
|
658
|
+
points: number;
|
|
659
|
+
expiration_date?: string;
|
|
660
|
+
expiration_type?: PointsExpirationTypes;
|
|
661
|
+
reason?: string;
|
|
662
|
+
source_id?: string;
|
|
663
|
+
}
|
|
664
|
+
interface LoyaltiesAddOrRemoveCardBalanceRequestBody {
|
|
665
|
+
points: number;
|
|
666
|
+
expiration_date?: string;
|
|
667
|
+
expiration_type?: PointsExpirationTypes;
|
|
668
|
+
reason?: string;
|
|
669
|
+
source_id?: string;
|
|
670
|
+
}
|
|
671
|
+
interface LoyaltiesAddOrRemoveCardBalanceResponseBody {
|
|
672
|
+
points?: number;
|
|
673
|
+
amount?: number;
|
|
674
|
+
total: number;
|
|
675
|
+
balance: number;
|
|
676
|
+
type: 'LOYALTY_CARD' | 'GIFT_VOUCHER';
|
|
677
|
+
object: 'balance';
|
|
678
|
+
related_object: {
|
|
679
|
+
type: 'voucher';
|
|
680
|
+
id: string;
|
|
681
|
+
};
|
|
682
|
+
operation_type?: 'MANUAL' | 'AUTOMATIC';
|
|
683
|
+
}
|
|
684
|
+
interface LoyaltiesAddOrRemoveCardBalanceResponseBody {
|
|
685
|
+
points?: number;
|
|
686
|
+
amount?: number;
|
|
687
|
+
total: number;
|
|
688
|
+
balance: number;
|
|
689
|
+
type: 'LOYALTY_CARD' | 'GIFT_VOUCHER';
|
|
690
|
+
object: 'balance';
|
|
691
|
+
related_object: {
|
|
692
|
+
type: 'voucher';
|
|
693
|
+
id: string;
|
|
694
|
+
};
|
|
695
|
+
operation_type?: 'MANUAL' | 'AUTOMATIC';
|
|
696
|
+
}
|
|
697
|
+
type LoyaltiesGetEarningRuleResponseBody = EarningRule;
|
|
698
|
+
type LoyaltiesEnableEarningRulesResponseBody = EarningRuleBase & {
|
|
699
|
+
updated_at: string | null;
|
|
700
|
+
active: true;
|
|
701
|
+
};
|
|
702
|
+
type LoyaltiesDisableEarningRulesResponseBody = EarningRuleBase & {
|
|
703
|
+
updated_at: string | null;
|
|
704
|
+
active: false;
|
|
705
|
+
};
|
|
706
|
+
type LoyaltiesListLoyaltyTierEarningRulesResponseBody = {
|
|
707
|
+
object: 'list';
|
|
708
|
+
data_ref: 'data';
|
|
709
|
+
data: EarningRule[];
|
|
710
|
+
total: number;
|
|
711
|
+
};
|
|
712
|
+
type LoyaltiesGetRewardAssignmentResponseBody = RewardAssignment;
|
|
713
|
+
interface LoyaltiesListLoyaltyTierRewardsResponseBody {
|
|
714
|
+
object: 'list';
|
|
715
|
+
data_ref: 'data';
|
|
716
|
+
total: number;
|
|
717
|
+
data: {
|
|
718
|
+
reward: {
|
|
719
|
+
id: string;
|
|
720
|
+
name: string;
|
|
721
|
+
stock: number | null;
|
|
722
|
+
redeemed: number | null;
|
|
723
|
+
attributes?: {
|
|
724
|
+
image_url?: string;
|
|
725
|
+
description?: string;
|
|
726
|
+
};
|
|
727
|
+
metadata: Record<string, undefined>;
|
|
728
|
+
created_at: string;
|
|
729
|
+
updated_at: string | null;
|
|
730
|
+
object: 'reward';
|
|
731
|
+
} & LoyaltyTierRewardItemParameters;
|
|
732
|
+
assignment: RewardAssignment;
|
|
733
|
+
object: 'loyalty_tier_reward';
|
|
734
|
+
}[];
|
|
735
|
+
}
|
|
736
|
+
interface LoyaltyTierBase {
|
|
737
|
+
name: string;
|
|
738
|
+
earning_rules?: Record<string, MappingMultiply | MappingFixed>;
|
|
739
|
+
rewards?: Record<string, MappingMultiply | MappingFixed>;
|
|
740
|
+
points: {
|
|
741
|
+
from?: number;
|
|
742
|
+
to?: number;
|
|
743
|
+
};
|
|
744
|
+
}
|
|
745
|
+
type LoyaltyTier = LoyaltyTierBase & {
|
|
746
|
+
id: string;
|
|
747
|
+
campaign_id: string;
|
|
748
|
+
metadata: Record<string, unknown> | null;
|
|
749
|
+
created_at: string;
|
|
750
|
+
updated_at?: string | null;
|
|
751
|
+
config: {
|
|
752
|
+
points: {
|
|
753
|
+
from?: number;
|
|
754
|
+
to?: number;
|
|
755
|
+
};
|
|
756
|
+
};
|
|
757
|
+
expiration?: {
|
|
758
|
+
customer_id: string;
|
|
759
|
+
campaign_id: string;
|
|
760
|
+
tier_id: string;
|
|
761
|
+
start_date?: string;
|
|
762
|
+
expiration_date?: string;
|
|
763
|
+
created_at: string;
|
|
764
|
+
updated_at?: string;
|
|
765
|
+
};
|
|
766
|
+
object: 'loyalty_tier';
|
|
767
|
+
};
|
|
768
|
+
interface MappingMultiply {
|
|
769
|
+
type: 'MULTIPLY';
|
|
770
|
+
multiplier: number;
|
|
771
|
+
}
|
|
772
|
+
interface MappingFixed {
|
|
773
|
+
type: 'CUSTOM';
|
|
774
|
+
points: number;
|
|
775
|
+
}
|
|
776
|
+
type LoyaltyCardTransactionsFields = 'id' | 'campaign_id' | 'voucher_id' | 'type' | 'source_id' | 'reason' | 'source' | 'balance' | 'amount' | 'related_transaction_id' | 'created_at' | 'details';
|
|
777
|
+
type LoyaltyCardTransactionsType = 'POINTS_ACCRUAL' | 'POINTS_CANCELLATION' | 'POINTS_REDEMPTION' | 'POINTS_REFUND' | 'POINTS_ADDITION' | 'POINTS_REMOVAL' | 'POINTS_EXPIRATION' | 'POINTS_TRANSFER_IN' | 'POINTS_TRANSFER_OUT';
|
|
778
|
+
type EarningRule = EarningRuleBase & {
|
|
779
|
+
validation_rule_id: string | null;
|
|
780
|
+
updated_at: string | null;
|
|
781
|
+
active: boolean;
|
|
782
|
+
};
|
|
783
|
+
type PointsExpirationTypes = 'PROGRAM_RULES' | 'CUSTOM_DATE' | 'NON_EXPIRING';
|
|
784
|
+
interface LoyaltyCardTransaction {
|
|
785
|
+
id: string;
|
|
786
|
+
source_id: string | null;
|
|
787
|
+
voucher_id: string;
|
|
788
|
+
campaign_id: string;
|
|
789
|
+
source: string | null;
|
|
790
|
+
reason: string | null;
|
|
791
|
+
type: LoyaltyCardTransactionsType;
|
|
792
|
+
details: {
|
|
793
|
+
balance: {
|
|
794
|
+
type: 'loyalty_card';
|
|
795
|
+
total: number;
|
|
796
|
+
object: 'balance';
|
|
797
|
+
operation_type: 'MANUAL' | 'AUTOMATIC';
|
|
798
|
+
points: number;
|
|
799
|
+
balance: number;
|
|
800
|
+
related_object: {
|
|
801
|
+
id: string;
|
|
802
|
+
type: 'voucher';
|
|
803
|
+
};
|
|
804
|
+
};
|
|
805
|
+
order?: {
|
|
806
|
+
id: string;
|
|
807
|
+
source_id: string;
|
|
808
|
+
};
|
|
809
|
+
event?: {
|
|
810
|
+
id: string;
|
|
811
|
+
type: string;
|
|
812
|
+
};
|
|
813
|
+
earning_rule?: {
|
|
814
|
+
id: string;
|
|
815
|
+
source: {
|
|
816
|
+
banner: string;
|
|
817
|
+
};
|
|
818
|
+
};
|
|
819
|
+
segment?: {
|
|
820
|
+
id: string;
|
|
821
|
+
name: string;
|
|
822
|
+
};
|
|
823
|
+
loyalty_tier?: {
|
|
824
|
+
id: string;
|
|
825
|
+
name: string;
|
|
826
|
+
};
|
|
827
|
+
redemption?: {
|
|
828
|
+
id: string;
|
|
829
|
+
};
|
|
830
|
+
rollback?: {
|
|
831
|
+
id: string;
|
|
832
|
+
};
|
|
833
|
+
reward?: {
|
|
834
|
+
id: string;
|
|
835
|
+
name: string;
|
|
836
|
+
};
|
|
837
|
+
custom_event?: {
|
|
838
|
+
id: string;
|
|
839
|
+
type: string;
|
|
840
|
+
};
|
|
841
|
+
event_schema?: {
|
|
842
|
+
id: string;
|
|
843
|
+
name: string;
|
|
844
|
+
};
|
|
845
|
+
source_voucher?: SimpleLoyaltyVoucher;
|
|
846
|
+
destination_voucher?: SimpleLoyaltyVoucher;
|
|
847
|
+
};
|
|
848
|
+
related_transaction_id: string | null;
|
|
849
|
+
created_at: string;
|
|
850
|
+
}
|
|
851
|
+
interface SimpleLoyaltyVoucher {
|
|
852
|
+
id: string;
|
|
853
|
+
code: string;
|
|
854
|
+
loyalty_card: {
|
|
855
|
+
points: number;
|
|
856
|
+
balance: number;
|
|
857
|
+
next_expiration_date?: string;
|
|
858
|
+
next_expiration_points?: string;
|
|
859
|
+
};
|
|
860
|
+
type: 'LOYALTY_CARD';
|
|
861
|
+
campaign: string;
|
|
862
|
+
campaign_id: string;
|
|
863
|
+
is_referral_code?: boolean;
|
|
864
|
+
holder_id?: string;
|
|
865
|
+
referrer_id?: string;
|
|
866
|
+
created_at?: string;
|
|
867
|
+
object: 'voucher';
|
|
868
|
+
}
|
|
869
|
+
interface SimpleLoyaltyVoucher {
|
|
870
|
+
id: string;
|
|
871
|
+
code: string;
|
|
872
|
+
loyalty_card: {
|
|
873
|
+
points: number;
|
|
874
|
+
balance: number;
|
|
875
|
+
next_expiration_date?: string;
|
|
876
|
+
next_expiration_points?: string;
|
|
877
|
+
};
|
|
878
|
+
type: 'LOYALTY_CARD';
|
|
879
|
+
campaign: string;
|
|
880
|
+
campaign_id: string;
|
|
881
|
+
is_referral_code?: boolean;
|
|
882
|
+
holder_id?: string;
|
|
883
|
+
referrer_id?: string;
|
|
884
|
+
created_at?: string;
|
|
885
|
+
object: 'voucher';
|
|
886
|
+
}
|
|
887
|
+
interface LoyaltiesTransferPoints {
|
|
888
|
+
code: string;
|
|
889
|
+
points: number;
|
|
890
|
+
reason?: string;
|
|
891
|
+
source_id: string;
|
|
892
|
+
}
|
|
893
|
+
interface LoyaltiesTransferPoints {
|
|
894
|
+
code: string;
|
|
895
|
+
points: number;
|
|
896
|
+
reason?: string;
|
|
897
|
+
source_id: string;
|
|
898
|
+
}
|
|
899
|
+
interface EarningRuleBase {
|
|
900
|
+
id: string;
|
|
901
|
+
created_at: string;
|
|
902
|
+
loyalty: EarningRuleFixed | EarningRuleProportional;
|
|
903
|
+
event?: EarningRuleEvent;
|
|
904
|
+
custom_event?: {
|
|
905
|
+
schema_id: string;
|
|
906
|
+
};
|
|
907
|
+
segment?: {
|
|
908
|
+
id: string;
|
|
909
|
+
};
|
|
910
|
+
source: {
|
|
911
|
+
banner?: string;
|
|
912
|
+
object_id: string;
|
|
913
|
+
object_type: 'campaign';
|
|
914
|
+
};
|
|
915
|
+
loyalty_tier?: {
|
|
916
|
+
id: string;
|
|
917
|
+
};
|
|
918
|
+
object: 'earning_rule';
|
|
919
|
+
automation_id: string;
|
|
920
|
+
start_date?: string;
|
|
921
|
+
expiration_date?: string;
|
|
922
|
+
validity_timeframe?: {
|
|
923
|
+
duration: string;
|
|
924
|
+
interval: string;
|
|
925
|
+
};
|
|
926
|
+
validity_day_of_week?: number[];
|
|
927
|
+
metadata: Record<string, unknown>;
|
|
928
|
+
}
|
|
929
|
+
type EarningRuleEvent = 'order.paid' | 'customer.segment.entered' | 'custom_event' | 'customer.loyalty.tier.upgraded' | 'customer.loyalty.tier.downgraded' | 'customer.loyalty.tier.prolonged' | 'customer.loyalty.tier.joined' | 'customer.loyalty.tier.left';
|
|
930
|
+
interface EarningRuleFixed {
|
|
931
|
+
type: 'FIXED';
|
|
932
|
+
points: number;
|
|
933
|
+
}
|
|
934
|
+
type EarningRuleProportionalOrder = EarningRuleProportionalOrderAmount | EarningRuleProportionalOrderTotalAmount | EarningRuleProportionalOrderMetadata;
|
|
935
|
+
interface EarningRuleProportionalOrderAmount {
|
|
936
|
+
type: 'PROPORTIONAL';
|
|
937
|
+
calculation_type: 'ORDER_AMOUNT';
|
|
938
|
+
order: {
|
|
939
|
+
amount: {
|
|
940
|
+
every: number;
|
|
941
|
+
points: number;
|
|
942
|
+
};
|
|
943
|
+
};
|
|
944
|
+
}
|
|
945
|
+
interface EarningRuleProportionalOrderTotalAmount {
|
|
946
|
+
type: 'PROPORTIONAL';
|
|
947
|
+
calculation_type: 'ORDER_TOTAL_AMOUNT';
|
|
948
|
+
order: {
|
|
949
|
+
total_amount: {
|
|
950
|
+
every: number;
|
|
951
|
+
points: number;
|
|
952
|
+
};
|
|
953
|
+
};
|
|
954
|
+
}
|
|
955
|
+
interface EarningRuleProportionalOrderMetadata {
|
|
956
|
+
type: 'PROPORTIONAL';
|
|
957
|
+
calculation_type: 'ORDER_METADATA';
|
|
958
|
+
order: {
|
|
959
|
+
metadata: {
|
|
960
|
+
every: number;
|
|
961
|
+
points: number;
|
|
962
|
+
property: string;
|
|
963
|
+
};
|
|
964
|
+
};
|
|
965
|
+
}
|
|
966
|
+
type EarningRuleProportional = EarningRuleProportionalOrder | EarningRuleProportionalOrderItems | EarningRuleProportionalCustomerMetadata | EarningRuleProportionalCustomEvent;
|
|
967
|
+
type EarningRuleProportionalOrderItems = EarningRuleProportionalOrderItemsQuantity | EarningRuleProportionalOrderItemsAmount | EarningRuleProportionalOrderItemsSubtotalAmount;
|
|
968
|
+
interface EarningRuleProportionalOrderItemsQuantity {
|
|
969
|
+
type: 'PROPORTIONAL';
|
|
970
|
+
calculation_type: 'ORDER_ITEMS_QUANTITY';
|
|
971
|
+
order_items: {
|
|
972
|
+
quantity: {
|
|
973
|
+
every: number;
|
|
974
|
+
points: number;
|
|
975
|
+
object: `products_collection` | `product` | `sku`;
|
|
976
|
+
id: string;
|
|
977
|
+
};
|
|
978
|
+
};
|
|
979
|
+
}
|
|
980
|
+
interface EarningRuleProportionalOrderItemsAmount {
|
|
981
|
+
type: 'PROPORTIONAL';
|
|
982
|
+
calculation_type: 'ORDER_ITEMS_AMOUNT';
|
|
983
|
+
order_items: {
|
|
984
|
+
amount: {
|
|
985
|
+
every: number;
|
|
986
|
+
points: number;
|
|
987
|
+
object: `products_collection` | `product` | `sku`;
|
|
988
|
+
id: string;
|
|
989
|
+
};
|
|
990
|
+
};
|
|
991
|
+
}
|
|
992
|
+
interface EarningRuleProportionalOrderItemsSubtotalAmount {
|
|
993
|
+
type: 'PROPORTIONAL';
|
|
994
|
+
calculation_type: 'ORDER_ITEMS_SUBTOTAL_AMOUNT';
|
|
995
|
+
order_items: {
|
|
996
|
+
subtotal_amount: {
|
|
997
|
+
every: number;
|
|
998
|
+
points: number;
|
|
999
|
+
object: `products_collection` | `product` | `sku`;
|
|
1000
|
+
id: string;
|
|
1001
|
+
};
|
|
1002
|
+
};
|
|
1003
|
+
}
|
|
1004
|
+
interface EarningRuleProportionalCustomerMetadata {
|
|
1005
|
+
type: 'PROPORTIONAL';
|
|
1006
|
+
calculation_type: 'CUSTOMER_METADATA';
|
|
1007
|
+
customer: {
|
|
1008
|
+
metadata: {
|
|
1009
|
+
every: number;
|
|
1010
|
+
points: number;
|
|
1011
|
+
property: string;
|
|
1012
|
+
};
|
|
1013
|
+
};
|
|
1014
|
+
}
|
|
1015
|
+
interface EarningRuleProportionalCustomEvent {
|
|
1016
|
+
type: 'PROPORTIONAL';
|
|
1017
|
+
calculation_type: 'CUSTOM_EVENT_METADATA';
|
|
1018
|
+
custom_event: {
|
|
1019
|
+
metadata: {
|
|
1020
|
+
every: number;
|
|
1021
|
+
points: number;
|
|
1022
|
+
property: string;
|
|
1023
|
+
};
|
|
1024
|
+
};
|
|
1025
|
+
}
|
|
1026
|
+
type LoyaltyTierRewardItemParameters = LoyaltyTierRewardItemCampaignParameters | LoyaltyTierRewardItemCoinParameters | LoyaltyTierRewardItemMaterialParameters;
|
|
1027
|
+
interface LoyaltyTierRewardItemCampaignParameters {
|
|
1028
|
+
type: 'CAMPAIGN';
|
|
1029
|
+
parameters: {
|
|
1030
|
+
campaign: LoyaltyTierRewardItemCampaignDiscountCoupons | LoyaltyTierRewardItemCampaignGiftVouchersAndLoyaltyProgram;
|
|
1031
|
+
};
|
|
1032
|
+
}
|
|
1033
|
+
interface LoyaltyTierRewardItemCoinParameters {
|
|
1034
|
+
type: 'COIN';
|
|
1035
|
+
parameters: {
|
|
1036
|
+
coin: {
|
|
1037
|
+
exchange_ratio: number;
|
|
1038
|
+
points_ratio: number;
|
|
1039
|
+
};
|
|
1040
|
+
};
|
|
1041
|
+
}
|
|
1042
|
+
interface LoyaltyTierRewardItemMaterialParameters {
|
|
1043
|
+
type: 'MATERIAL';
|
|
1044
|
+
parameters: {
|
|
1045
|
+
product: {
|
|
1046
|
+
id: string;
|
|
1047
|
+
sku_id: string | null;
|
|
1048
|
+
};
|
|
1049
|
+
};
|
|
1050
|
+
}
|
|
1051
|
+
interface LoyaltyTierRewardItemCampaignDiscountCoupons {
|
|
1052
|
+
id: string;
|
|
1053
|
+
type: string;
|
|
1054
|
+
}
|
|
1055
|
+
interface LoyaltyTierRewardItemCampaignGiftVouchersAndLoyaltyProgram {
|
|
1056
|
+
id: string;
|
|
1057
|
+
balance: number;
|
|
1058
|
+
type: string;
|
|
1059
|
+
}
|
|
1060
|
+
|
|
1061
|
+
export type { EarningRule, EarningRuleBase, EarningRuleEvent, EarningRuleFixed, EarningRuleProportional, EarningRuleProportionalCustomEvent, EarningRuleProportionalCustomerMetadata, EarningRuleProportionalOrder, EarningRuleProportionalOrderAmount, EarningRuleProportionalOrderItems, EarningRuleProportionalOrderItemsAmount, EarningRuleProportionalOrderItemsQuantity, EarningRuleProportionalOrderItemsSubtotalAmount, EarningRuleProportionalOrderMetadata, EarningRuleProportionalOrderTotalAmount, LoyaltiesAddOrRemoveCardBalanceRequestBody, LoyaltiesAddOrRemoveCardBalanceResponseBody, LoyaltiesAddPoints, LoyaltiesAddPointsResponse, LoyaltiesCreateCampaign, LoyaltiesCreateCampaignResponse, LoyaltiesCreateEarningRule, LoyaltiesCreateEarningRuleResponse, LoyaltiesCreateMember, LoyaltiesCreateMemberResponse, LoyaltiesCreateRewardAssignmentResponse, LoyaltiesCreateRewardAssignments, LoyaltiesCreateTiersRequestBody, LoyaltiesCreateTiersResponseBody, LoyaltiesDeleteCampaignParams, LoyaltiesDisableEarningRulesResponseBody, LoyaltiesEarningRulesResponse, LoyaltiesEnableEarningRulesResponseBody, LoyaltiesExportCardTransactionsRequestBody, LoyaltiesExportCardTransactionsResponseBody, LoyaltiesGetCampaignResponse, LoyaltiesGetEarningRuleResponseBody, LoyaltiesGetMemberActivitiesResponse, LoyaltiesGetMemberResponse, LoyaltiesGetPointsExpirationRequestQuery, LoyaltiesGetPointsExpirationResponseBody, LoyaltiesGetRewardAssignmentResponseBody, LoyaltiesGetRewardDetailsResponseBody, LoyaltiesGetTierResponseBody, LoyaltiesListCardTransactionsRequestQuery, LoyaltiesListCardTransactionsResponseBody, LoyaltiesListEarningRulesParams, LoyaltiesListEarningRulesResponse, LoyaltiesListLoyaltyTierEarningRulesRequestQuery, LoyaltiesListLoyaltyTierEarningRulesResponseBody, LoyaltiesListLoyaltyTierRewardsResponseBody, LoyaltiesListMemberActivityParams, LoyaltiesListMemberActivityResponse, LoyaltiesListMemberLoyaltyTiersResponseBody, LoyaltiesListMemberRewardsRequestQuery, LoyaltiesListMemberRewardsResponseBody, LoyaltiesListMembersParams, LoyaltiesListMembersResponse, LoyaltiesListParams, LoyaltiesListResponse, LoyaltiesListRewardAssignmentsParams, LoyaltiesListRewardAssignmentsResponse, LoyaltiesListTiersRequestQuery, LoyaltiesListTiersResponseBody, LoyaltiesRedeemRewardParams, LoyaltiesRedeemRewardResponse, LoyaltiesTransferPoints, LoyaltiesTransferPointsRequestBody, LoyaltiesTransferPointsResponseBody, LoyaltiesUpdateCampaign, LoyaltiesUpdateCampaignResponse, LoyaltiesUpdateEarningRule, LoyaltiesUpdateEarningRuleResponse, LoyaltiesUpdateRewardAssignment, LoyaltiesUpdateRewardAssignmentResponse, LoyaltiesVoucherResponse, LoyaltyCardTransaction, LoyaltyCardTransactionsFields, LoyaltyCardTransactionsType, LoyaltyFixed, LoyaltyPointsTransfer, LoyaltyProportional, LoyaltyTier, LoyaltyTierBase, LoyaltyTierRewardItemCampaignDiscountCoupons, LoyaltyTierRewardItemCampaignGiftVouchersAndLoyaltyProgram, LoyaltyTierRewardItemCampaignParameters, LoyaltyTierRewardItemCoinParameters, LoyaltyTierRewardItemMaterialParameters, LoyaltyTierRewardItemParameters, PointsExpirationTypes, SimpleLoyaltyVoucher };
|