@voucherify/sdk 2.9.1 → 2.9.3

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