@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.
Files changed (75) hide show
  1. package/dist/ApiLimitsHandler.d.ts +13 -10
  2. package/dist/AsyncActions.d.ts +17 -15
  3. package/dist/Balance.d.ts +15 -12
  4. package/dist/Campaigns.d.ts +66 -58
  5. package/dist/Categories.d.ts +29 -26
  6. package/dist/ClientSide.d.ts +77 -53
  7. package/dist/Consents.d.ts +13 -10
  8. package/dist/Customers.d.ts +75 -72
  9. package/dist/Distributions.d.ts +29 -22
  10. package/dist/Events.d.ts +15 -10
  11. package/dist/Exports.d.ts +25 -22
  12. package/dist/Loyalties.d.ts +171 -159
  13. package/dist/MetadataSchemas.d.ts +17 -14
  14. package/dist/Orders.d.ts +32 -27
  15. package/dist/ProductCollections.d.ts +30 -26
  16. package/dist/Products.d.ts +66 -63
  17. package/dist/PromotionTiers.d.ts +43 -34
  18. package/dist/Promotions.d.ts +30 -18
  19. package/dist/PromotionsStacks.d.ts +34 -30
  20. package/dist/Qualifications.d.ts +24 -10
  21. package/dist/Redemptions.d.ts +53 -35
  22. package/dist/RequestController.d.ts +31 -29
  23. package/dist/Rewards.d.ts +46 -43
  24. package/dist/Segments.d.ts +25 -22
  25. package/dist/ValidationRules.d.ts +47 -43
  26. package/dist/Validations.d.ts +39 -17
  27. package/dist/VoucherifyClientSide.d.ts +112 -86
  28. package/dist/VoucherifyError.d.ts +23 -20
  29. package/dist/VoucherifyServerSide.d.ts +170 -131
  30. package/dist/Vouchers.d.ts +84 -78
  31. package/dist/helpers.d.ts +20 -18
  32. package/dist/index.d.ts +63 -25
  33. package/dist/types/ApplicableTo.d.ts +32 -30
  34. package/dist/types/AsyncActions.d.ts +23 -21
  35. package/dist/types/Balance.d.ts +18 -16
  36. package/dist/types/Campaigns.d.ts +124 -120
  37. package/dist/types/Categories.d.ts +40 -38
  38. package/dist/types/ClientSide.d.ts +145 -134
  39. package/dist/types/Consents.d.ts +34 -33
  40. package/dist/types/Customers.d.ts +363 -361
  41. package/dist/types/DiscountVoucher.d.ts +94 -93
  42. package/dist/types/Distributions.d.ts +148 -144
  43. package/dist/types/Events.d.ts +21 -17
  44. package/dist/types/Exports.d.ts +151 -149
  45. package/dist/types/Gift.d.ts +5 -3
  46. package/dist/types/Loyalties.d.ts +1061 -1057
  47. package/dist/types/MetadataSchemas.d.ts +34 -33
  48. package/dist/types/Orders.d.ts +199 -195
  49. package/dist/types/ProductCollections.d.ts +99 -96
  50. package/dist/types/Products.d.ts +108 -106
  51. package/dist/types/PromotionTiers.d.ts +131 -127
  52. package/dist/types/Promotions.d.ts +113 -108
  53. package/dist/types/PromotionsStacks.d.ts +74 -71
  54. package/dist/types/Qualifications.d.ts +92 -86
  55. package/dist/types/Redemptions.d.ts +215 -205
  56. package/dist/types/Rewards.d.ts +220 -219
  57. package/dist/types/Segments.d.ts +34 -32
  58. package/dist/types/Stackable.d.ts +106 -101
  59. package/dist/types/UtilityTypes.d.ts +5 -3
  60. package/dist/types/ValidateSession.d.ts +19 -17
  61. package/dist/types/ValidationError.d.ts +9 -7
  62. package/dist/types/ValidationRules.d.ts +96 -93
  63. package/dist/types/Validations.d.ts +109 -98
  64. package/dist/types/Vouchers.d.ts +452 -364
  65. package/dist/types/index.d.ts +27 -25
  66. package/dist/voucherifysdk.cjs +2023 -0
  67. package/dist/voucherifysdk.cjs.map +1 -0
  68. package/dist/voucherifysdk.esm.js +981 -1256
  69. package/dist/voucherifysdk.esm.js.map +1 -1
  70. package/package.json +13 -9
  71. package/CHANGELOG.md +0 -663
  72. package/dist/voucherifysdk.umd.development.js +0 -2270
  73. package/dist/voucherifysdk.umd.development.js.map +0 -1
  74. package/dist/voucherifysdk.umd.production.min.js +0 -2
  75. package/dist/voucherifysdk.umd.production.min.js.map +0 -1
@@ -1,1057 +1,1061 @@
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 {};
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 };