@compassdigital/sdk.typescript 4.598.0 → 4.599.0

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.
@@ -0,0 +1,1196 @@
1
+ /* eslint-disable */
2
+ // THIS FILE IS AUTOMATICALLY GENERATED, DO NOT MODIFY
3
+
4
+ import { RequestQuery, BaseRequest } from './util';
5
+
6
+ export interface BundleResponseDto {
7
+ id: string;
8
+ createdAt: string;
9
+ updatedAt: string;
10
+ deletedAt?: Record<string, any> | null;
11
+ createdBy: string;
12
+ realm: 'boost' | 'thrive';
13
+ siteId?: Record<string, any> | null;
14
+ name: string;
15
+ description?: Record<string, any> | null;
16
+ }
17
+
18
+ export interface BundlePaginationDto {
19
+ cursor?: Record<string, any> | null;
20
+ hasMore: boolean;
21
+ limit: number;
22
+ }
23
+
24
+ export interface BundleListResponseDto {
25
+ data: BundleResponseDto[];
26
+ pagination: BundlePaginationDto;
27
+ }
28
+
29
+ export interface ErrorDisplayMessage {
30
+ // user message title
31
+ title: string;
32
+ // user message description
33
+ description: string;
34
+ }
35
+
36
+ export interface ErrorData {
37
+ // http status code
38
+ statusCode: number;
39
+ // http status text
40
+ statusText: string;
41
+ timestamp: string;
42
+ // user friendly error message
43
+ displayMessage: ErrorDisplayMessage;
44
+ }
45
+
46
+ export interface Error {
47
+ // business error code
48
+ code: number;
49
+ // business error description
50
+ message: string;
51
+ // additional error data
52
+ data: ErrorData;
53
+ }
54
+
55
+ export interface BundleGroupDto {
56
+ groupName: string;
57
+ minimumQuantity: number;
58
+ itemIds: string[];
59
+ }
60
+
61
+ export interface BundleDetailResponseDto {
62
+ id: string;
63
+ createdAt: string;
64
+ updatedAt: string;
65
+ deletedAt?: Record<string, any> | null;
66
+ createdBy: string;
67
+ realm: 'boost' | 'thrive';
68
+ siteId?: Record<string, any> | null;
69
+ name: string;
70
+ description?: Record<string, any> | null;
71
+ groups: BundleGroupDto[];
72
+ }
73
+
74
+ export interface CreateBundleDto {
75
+ realm: 'boost' | 'thrive';
76
+ siteId?: string;
77
+ name: string;
78
+ description?: string;
79
+ groups: BundleGroupDto[];
80
+ }
81
+
82
+ export interface UpdateBundleDto {
83
+ realm?: 'boost' | 'thrive';
84
+ siteId?: string;
85
+ name?: string;
86
+ description?: string;
87
+ groups?: BundleGroupDto[];
88
+ }
89
+
90
+ export interface CampaignResponseDto {
91
+ id: string;
92
+ createdAt: string;
93
+ updatedAt: string;
94
+ deletedAt?: Record<string, any> | null;
95
+ createdBy: string;
96
+ updatedBy: string;
97
+ realm: 'boost' | 'thrive';
98
+ name: string;
99
+ description?: Record<string, any> | null;
100
+ type: 'promo_code' | 'auto_apply';
101
+ status: 'draft' | 'active' | 'paused' | 'expired' | 'archived';
102
+ discountType: 'AMOUNT_OFF' | 'PERCENT_OFF' | 'FREE_ITEM';
103
+ discountScope: 'order' | 'items';
104
+ discountValueCents?: Record<string, any> | null;
105
+ discountPercent?: Record<string, any> | null;
106
+ appliesToCheapest: boolean;
107
+ maxDiscountCents?: Record<string, any> | null;
108
+ codeType: 'open' | 'personal' | 'auto_applied';
109
+ // YYYY-MM-DD
110
+ startDate?: Record<string, any> | null;
111
+ // YYYY-MM-DD
112
+ endDate?: Record<string, any> | null;
113
+ maxRedemptions?: Record<string, any> | null;
114
+ maxRedemptionsPerCustomer?: Record<string, any> | null;
115
+ maxRedemptionsDaily?: Record<string, any> | null;
116
+ maxRedemptionsPerCustomerDaily?: Record<string, any> | null;
117
+ minOrderValueCents?: Record<string, any> | null;
118
+ maxOrderValueCents?: Record<string, any> | null;
119
+ bundleId?: Record<string, any> | null;
120
+ }
121
+
122
+ export interface CampaignPaginationDto {
123
+ cursor?: Record<string, any> | null;
124
+ hasMore: boolean;
125
+ limit: number;
126
+ }
127
+
128
+ export interface CampaignListResponseDto {
129
+ data: CampaignResponseDto[];
130
+ pagination: CampaignPaginationDto;
131
+ }
132
+
133
+ export interface CampaignDailyScheduleResponseDto {
134
+ id: string;
135
+ campaignId: string;
136
+ dayOfWeek: 'mon' | 'tue' | 'wed' | 'thu' | 'fri' | 'sat' | 'sun';
137
+ active: boolean;
138
+ // HH:MM:SS format
139
+ startTime: string;
140
+ // HH:MM:SS format
141
+ endTime: string;
142
+ }
143
+
144
+ export interface CampaignEligibilityResponseDto {
145
+ id: string;
146
+ campaignId: string;
147
+ eligibilityType: 'everyone' | 'meal_plan' | 'badge_pay' | 'sso_group' | 'segment';
148
+ segmentId?: Record<string, any> | null;
149
+ maxRedemptionsPerCustomer?: Record<string, any> | null;
150
+ maxRedemptionsPerCustomerDaily?: Record<string, any> | null;
151
+ }
152
+
153
+ export interface CampaignSiteScopeResponseDto {
154
+ campaignId: string;
155
+ siteId: string;
156
+ excluded: boolean;
157
+ }
158
+
159
+ export interface CampaignStationScopeResponseDto {
160
+ campaignId: string;
161
+ siteId: string;
162
+ stationId: string;
163
+ excluded: boolean;
164
+ }
165
+
166
+ export interface CampaignItemTargetResponseDto {
167
+ id: string;
168
+ campaignId: string;
169
+ siteId?: Record<string, any> | null;
170
+ stationId?: Record<string, any> | null;
171
+ menuId?: Record<string, any> | null;
172
+ categoryId?: Record<string, any> | null;
173
+ itemId?: Record<string, any> | null;
174
+ maxDiscountCents?: Record<string, any> | null;
175
+ }
176
+
177
+ export interface CampaignDetailResponseDto {
178
+ id: string;
179
+ createdAt: string;
180
+ updatedAt: string;
181
+ deletedAt?: Record<string, any> | null;
182
+ createdBy: string;
183
+ updatedBy: string;
184
+ realm: 'boost' | 'thrive';
185
+ name: string;
186
+ description?: Record<string, any> | null;
187
+ type: 'promo_code' | 'auto_apply';
188
+ status: 'draft' | 'active' | 'paused' | 'expired' | 'archived';
189
+ discountType: 'AMOUNT_OFF' | 'PERCENT_OFF' | 'FREE_ITEM';
190
+ discountScope: 'order' | 'items';
191
+ discountValueCents?: Record<string, any> | null;
192
+ discountPercent?: Record<string, any> | null;
193
+ appliesToCheapest: boolean;
194
+ maxDiscountCents?: Record<string, any> | null;
195
+ codeType: 'open' | 'personal' | 'auto_applied';
196
+ // YYYY-MM-DD
197
+ startDate?: Record<string, any> | null;
198
+ // YYYY-MM-DD
199
+ endDate?: Record<string, any> | null;
200
+ maxRedemptions?: Record<string, any> | null;
201
+ maxRedemptionsPerCustomer?: Record<string, any> | null;
202
+ maxRedemptionsDaily?: Record<string, any> | null;
203
+ maxRedemptionsPerCustomerDaily?: Record<string, any> | null;
204
+ minOrderValueCents?: Record<string, any> | null;
205
+ maxOrderValueCents?: Record<string, any> | null;
206
+ bundleId?: Record<string, any> | null;
207
+ dailySchedule: CampaignDailyScheduleResponseDto[];
208
+ eligibility: CampaignEligibilityResponseDto[];
209
+ siteScopes: CampaignSiteScopeResponseDto[];
210
+ stationScopes: CampaignStationScopeResponseDto[];
211
+ itemTargets: CampaignItemTargetResponseDto[];
212
+ // Sales channels the campaign applies to. Empty means all channels.
213
+ salesChannels: ('mobile' | 'web' | 'kiosk' | 'pos')[];
214
+ // Ordering platforms the campaign applies to. Empty means all platforms.
215
+ originSystems: ('native' | 'volante' | 'nextstep' | 'agilysys')[];
216
+ // Payment methods the campaign applies to. Empty means no restriction.
217
+ paymentRestrictions: ('meal_plan' | 'badge_pay' | 'credit_card' | 'digital_wallet_pay')[];
218
+ }
219
+
220
+ export interface DailyScheduleDto {
221
+ dayOfWeek: 'mon' | 'tue' | 'wed' | 'thu' | 'fri' | 'sat' | 'sun';
222
+ active: boolean;
223
+ // HH:MM:SS format
224
+ startTime: string;
225
+ // HH:MM:SS format
226
+ endTime: string;
227
+ }
228
+
229
+ export interface EligibilityDto {
230
+ eligibilityType: 'everyone' | 'meal_plan' | 'badge_pay' | 'sso_group' | 'segment';
231
+ segmentId?: string;
232
+ maxRedemptionsPerCustomer?: number;
233
+ maxRedemptionsPerCustomerDaily?: number;
234
+ }
235
+
236
+ export interface SiteScopeDto {
237
+ siteId: string;
238
+ excluded?: boolean;
239
+ }
240
+
241
+ export interface StationScopeDto {
242
+ siteId: string;
243
+ stationId: string;
244
+ excluded?: boolean;
245
+ }
246
+
247
+ export interface ItemTargetDto {
248
+ siteId?: string;
249
+ stationId?: string;
250
+ menuId?: string;
251
+ categoryId?: string;
252
+ itemId?: string;
253
+ maxDiscountCents?: number;
254
+ }
255
+
256
+ export interface CreateCampaignDto {
257
+ realm: 'boost' | 'thrive';
258
+ name: string;
259
+ description?: string;
260
+ type: 'promo_code' | 'auto_apply';
261
+ discountType: 'AMOUNT_OFF' | 'PERCENT_OFF' | 'FREE_ITEM';
262
+ discountScope: 'order' | 'items';
263
+ discountValueCents?: number;
264
+ discountPercent?: number;
265
+ appliesToCheapest?: boolean;
266
+ maxDiscountCents?: number;
267
+ codeType: 'open' | 'personal' | 'auto_applied';
268
+ // YYYY-MM-DD
269
+ startDate?: string;
270
+ // YYYY-MM-DD
271
+ endDate?: string;
272
+ maxRedemptions?: number;
273
+ maxRedemptionsPerCustomer?: number;
274
+ maxRedemptionsDaily?: number;
275
+ maxRedemptionsPerCustomerDaily?: number;
276
+ minOrderValueCents?: number;
277
+ maxOrderValueCents?: number;
278
+ dailySchedule?: DailyScheduleDto[];
279
+ eligibility?: EligibilityDto[];
280
+ siteScopes?: SiteScopeDto[];
281
+ stationScopes?: StationScopeDto[];
282
+ itemTargets?: ItemTargetDto[];
283
+ // Reference to a reusable bundle for cart-content conditions
284
+ bundleId?: string;
285
+ // Sales channels the campaign applies to. Empty/omitted means all channels.
286
+ salesChannels?: ('mobile' | 'web' | 'kiosk' | 'pos')[];
287
+ // Ordering platforms the campaign applies to. Empty/omitted means all platforms.
288
+ originSystems?: ('native' | 'volante' | 'nextstep' | 'agilysys')[];
289
+ // Payment methods the campaign applies to. Empty/omitted means no restriction.
290
+ paymentRestrictions?: ('meal_plan' | 'badge_pay' | 'credit_card' | 'digital_wallet_pay')[];
291
+ }
292
+
293
+ export interface UpdateCampaignDto {
294
+ realm?: 'boost' | 'thrive';
295
+ name?: string;
296
+ description?: string;
297
+ type?: 'promo_code' | 'auto_apply';
298
+ discountType?: 'AMOUNT_OFF' | 'PERCENT_OFF' | 'FREE_ITEM';
299
+ discountScope?: 'order' | 'items';
300
+ discountValueCents?: number;
301
+ discountPercent?: number;
302
+ appliesToCheapest?: boolean;
303
+ maxDiscountCents?: number;
304
+ codeType?: 'open' | 'personal' | 'auto_applied';
305
+ // YYYY-MM-DD
306
+ startDate?: string;
307
+ // YYYY-MM-DD
308
+ endDate?: string;
309
+ maxRedemptions?: number;
310
+ maxRedemptionsPerCustomer?: number;
311
+ maxRedemptionsDaily?: number;
312
+ maxRedemptionsPerCustomerDaily?: number;
313
+ minOrderValueCents?: number;
314
+ maxOrderValueCents?: number;
315
+ dailySchedule?: DailyScheduleDto[];
316
+ eligibility?: EligibilityDto[];
317
+ siteScopes?: SiteScopeDto[];
318
+ stationScopes?: StationScopeDto[];
319
+ itemTargets?: ItemTargetDto[];
320
+ // Reference to a reusable bundle for cart-content conditions
321
+ bundleId?: string;
322
+ // Sales channels the campaign applies to. Empty array clears the restriction.
323
+ salesChannels?: ('mobile' | 'web' | 'kiosk' | 'pos')[];
324
+ // Ordering platforms the campaign applies to. Empty array clears the restriction.
325
+ originSystems?: ('native' | 'volante' | 'nextstep' | 'agilysys')[];
326
+ // Payment methods the campaign applies to. Empty array clears the restriction.
327
+ paymentRestrictions?: ('meal_plan' | 'badge_pay' | 'credit_card' | 'digital_wallet_pay')[];
328
+ }
329
+
330
+ export interface UpdateCampaignStatusDto {
331
+ status: 'draft' | 'active' | 'paused' | 'expired' | 'archived';
332
+ reason?: string;
333
+ }
334
+
335
+ export interface VoucherResponseDto {
336
+ id: string;
337
+ createdAt: string;
338
+ updatedAt: string;
339
+ deletedAt?: Record<string, any> | null;
340
+ campaignId: string;
341
+ realm: 'boost' | 'thrive';
342
+ code: string;
343
+ codeType: 'open' | 'personal' | 'auto_applied';
344
+ customerId?: Record<string, any> | null;
345
+ status: string;
346
+ expiresAt?: Record<string, any> | null;
347
+ issuedBy?: Record<string, any> | null;
348
+ issueReason?: Record<string, any> | null;
349
+ revokedAt?: Record<string, any> | null;
350
+ revokedBy?: Record<string, any> | null;
351
+ revokeReason?: Record<string, any> | null;
352
+ source?: string;
353
+ campaignName?: string;
354
+ campaignType?: string;
355
+ redemptionCount?: number;
356
+ }
357
+
358
+ export interface VoucherPaginationDto {
359
+ cursor?: Record<string, any> | null;
360
+ hasMore: boolean;
361
+ limit: number;
362
+ }
363
+
364
+ export interface VoucherListResponseDto {
365
+ data: VoucherResponseDto[];
366
+ pagination: VoucherPaginationDto;
367
+ }
368
+
369
+ export interface CreateVoucherDto {
370
+ campaignId: string;
371
+ code: string;
372
+ // Supports legacy alias "binding"
373
+ codeType: 'open' | 'personal' | 'auto_applied';
374
+ // Required when codeType = personal
375
+ customerId?: string;
376
+ expiresAt?: string;
377
+ issueReason?: string;
378
+ }
379
+
380
+ export interface UpdateVoucherDto {
381
+ expiresAt?: string;
382
+ customerId?: string;
383
+ }
384
+
385
+ export interface RevokeVoucherDto {
386
+ // Reason for revoking the voucher
387
+ reason: string;
388
+ }
389
+
390
+ export interface BatchVoucherDto {
391
+ campaignId: string;
392
+ count: number;
393
+ // Supports legacy alias "binding"
394
+ codeType: 'open' | 'personal';
395
+ // Prefix prepended to generated codes. Reward-reserved prefixes (boore, boorb, thrre, thrrb) are not allowed here — reward vouchers must be issued through the rewards flow.
396
+ prefix?: string;
397
+ expiresAt?: string;
398
+ // Required when codeType = personal; length must match count
399
+ customerIds?: string[];
400
+ }
401
+
402
+ export interface BatchVoucherResponseDto {
403
+ codePoolId: string;
404
+ count: number;
405
+ }
406
+
407
+ export interface RedemptionItemResponseDto {
408
+ id: string;
409
+ itemId: string;
410
+ itemName?: Record<string, any> | null;
411
+ originalPriceCents: number;
412
+ discountAmountCents: number;
413
+ }
414
+
415
+ export interface VoucherDiscountResponseDto {
416
+ type: string;
417
+ amount_off: number;
418
+ percent_off: number;
419
+ }
420
+
421
+ export interface VoucherRedemptionVoucherDto {
422
+ id: string;
423
+ code: string;
424
+ discount: VoucherDiscountResponseDto;
425
+ }
426
+
427
+ export interface RedemptionResponseDto {
428
+ id: string;
429
+ createdAt: string;
430
+ voucherId?: Record<string, any> | null;
431
+ customerId?: Record<string, any> | null;
432
+ orderId?: Record<string, any> | null;
433
+ siteId?: Record<string, any> | null;
434
+ stationId?: Record<string, any> | null;
435
+ realm?: string;
436
+ discountAmountCents?: number;
437
+ orderTotalCents?: number;
438
+ status?: string;
439
+ rolledBackAt?: Record<string, any> | null;
440
+ rollbackReason?: Record<string, any> | null;
441
+ externalRedemptionId?: Record<string, any> | null;
442
+ items?: RedemptionItemResponseDto[];
443
+ date?: string;
444
+ result?: string;
445
+ object?: string;
446
+ app?: string;
447
+ voucher?: VoucherRedemptionVoucherDto;
448
+ }
449
+
450
+ export interface RedemptionListResponseDto {
451
+ data: RedemptionResponseDto[];
452
+ pagination: VoucherPaginationDto;
453
+ }
454
+
455
+ export interface VoucherCustomerDto {
456
+ source_id?: string;
457
+ email?: string;
458
+ }
459
+
460
+ export interface VoucherOrderItemProductMetadataDto {
461
+ item_name?: string;
462
+ }
463
+
464
+ export interface VoucherOrderItemProductDto {
465
+ metadata?: VoucherOrderItemProductMetadataDto;
466
+ }
467
+
468
+ export interface VoucherOrderItemDto {
469
+ source_id?: string;
470
+ product_id?: string;
471
+ quantity?: number;
472
+ price?: number;
473
+ product?: VoucherOrderItemProductDto;
474
+ }
475
+
476
+ export interface VoucherOrderMetadataDto {
477
+ order_id?: string;
478
+ brand_id?: string;
479
+ site_id?: string;
480
+ location_group_id?: string;
481
+ }
482
+
483
+ export interface VoucherOrderDto {
484
+ source_id?: string;
485
+ items?: VoucherOrderItemDto[];
486
+ metadata?: VoucherOrderMetadataDto;
487
+ }
488
+
489
+ export interface VoucherOperationDto {
490
+ codes: string[];
491
+ customer?: VoucherCustomerDto;
492
+ order?: VoucherOrderDto;
493
+ }
494
+
495
+ export interface VoucherErrorResponseDto {
496
+ message: string;
497
+ }
498
+
499
+ export interface VoucherOperationOrderResponseDto {
500
+ total_discount_amount: number;
501
+ total_applied_discount_amount: number;
502
+ }
503
+
504
+ export interface VoucherOperationResultResponseDto {
505
+ discount?: VoucherDiscountResponseDto;
506
+ error?: VoucherErrorResponseDto;
507
+ }
508
+
509
+ export interface VoucherRedeemableResponseDto {
510
+ status: string;
511
+ id: string;
512
+ object: string;
513
+ order: VoucherOperationOrderResponseDto;
514
+ result: VoucherOperationResultResponseDto;
515
+ }
516
+
517
+ export interface VoucherOperationResponseDto {
518
+ code?: string;
519
+ valid?: boolean;
520
+ success?: boolean;
521
+ app?: string;
522
+ discount?: VoucherDiscountResponseDto;
523
+ provider_data?: Record<string, any>;
524
+ error?: VoucherErrorResponseDto;
525
+ redeemables?: VoucherRedeemableResponseDto[];
526
+ redemptions?: RedemptionResponseDto[];
527
+ id?: string;
528
+ date?: string;
529
+ result?: string;
530
+ object?: string;
531
+ voucher?: VoucherRedemptionVoucherDto;
532
+ }
533
+
534
+ export interface SegmentRuleDto {
535
+ // Attribute key to evaluate (e.g. points_balance, enrollment_date)
536
+ attribute: string;
537
+ // Operator key (eq, neq, gt, gte, lt, lte)
538
+ operator: string;
539
+ // Value to compare against
540
+ value: string;
541
+ }
542
+
543
+ export interface SegmentResponseDto {
544
+ id: string;
545
+ createdAt: string;
546
+ updatedAt: string;
547
+ deletedAt?: Record<string, any> | null;
548
+ createdBy: string;
549
+ realm: 'boost' | 'thrive';
550
+ name: string;
551
+ description?: Record<string, any> | null;
552
+ type: 'static_list' | 'attribute_rule' | 'sso';
553
+ ownership: 'system' | 'custom';
554
+ editable: boolean;
555
+ deletable: boolean;
556
+ ruleJson?: SegmentRuleDto;
557
+ memberCount?: number;
558
+ }
559
+
560
+ export interface SegmentPaginationDto {
561
+ cursor?: Record<string, any> | null;
562
+ hasMore: boolean;
563
+ limit: number;
564
+ }
565
+
566
+ export interface SegmentListResponseDto {
567
+ data: SegmentResponseDto[];
568
+ pagination: SegmentPaginationDto;
569
+ }
570
+
571
+ export interface SegmentAttributeResponseDto {
572
+ key: string;
573
+ label: string;
574
+ }
575
+
576
+ export interface SegmentPreviewCountResponseDto {
577
+ count: number;
578
+ }
579
+
580
+ export interface CreateSegmentDto {
581
+ realm: 'boost' | 'thrive';
582
+ name: string;
583
+ description?: string;
584
+ type: 'static_list' | 'attribute_rule' | 'sso';
585
+ // Required when type = attribute_rule
586
+ ruleJson?: SegmentRuleDto;
587
+ // Initial members for static_list segments
588
+ customerIds?: string[];
589
+ }
590
+
591
+ export interface UpdateSegmentDto {
592
+ name?: string;
593
+ description?: string;
594
+ ruleJson?: SegmentRuleDto;
595
+ }
596
+
597
+ export interface SegmentMemberResponseDto {
598
+ customerId: string;
599
+ addedAt: string;
600
+ addedBy: string;
601
+ }
602
+
603
+ export interface SegmentMembersListResponseDto {
604
+ data: SegmentMemberResponseDto[];
605
+ pagination: SegmentPaginationDto;
606
+ }
607
+
608
+ export interface SegmentMembersDto {
609
+ // List of customer IDs
610
+ customerIds: string[];
611
+ }
612
+
613
+ export interface AddSegmentMembersResponseDto {
614
+ added: number;
615
+ }
616
+
617
+ export interface RemoveSegmentMembersResponseDto {
618
+ removed: number;
619
+ }
620
+
621
+ export interface RollbackRedemptionDto {
622
+ // Reason for rolling back the redemption
623
+ reason: string;
624
+ }
625
+
626
+ export interface RewardResponseDto {
627
+ id: string;
628
+ createdAt: string;
629
+ updatedAt: string;
630
+ deletedAt?: Record<string, any> | null;
631
+ createdBy: string;
632
+ realm: 'boost' | 'thrive';
633
+ siteId?: Record<string, any> | null;
634
+ name: string;
635
+ description?: Record<string, any> | null;
636
+ status: 'active' | 'paused' | 'archived';
637
+ earningRuleCount?: number;
638
+ }
639
+
640
+ export interface RewardPaginationDto {
641
+ cursor?: Record<string, any> | null;
642
+ hasMore: boolean;
643
+ limit: number;
644
+ }
645
+
646
+ export interface RewardListResponseDto {
647
+ data: RewardResponseDto[];
648
+ pagination: RewardPaginationDto;
649
+ }
650
+
651
+ export interface BrandExclusionDto {
652
+ siteId: string;
653
+ stationId: string;
654
+ }
655
+
656
+ export interface EarningRuleDto {
657
+ eventType: 'order_placed' | 'item_purchased' | 'amount_spent';
658
+ points: number;
659
+ spendThresholdCents?: number;
660
+ siteId?: string;
661
+ itemId?: string;
662
+ // Stations excluded from earning on this rule
663
+ brandExclusions?: BrandExclusionDto[];
664
+ }
665
+
666
+ export interface MilestoneDto {
667
+ pointsRequired: number;
668
+ campaignId: string;
669
+ resetsAfterMilestone: boolean;
670
+ maxRewardCount?: number;
671
+ }
672
+
673
+ export interface RewardDetailResponseDto {
674
+ id: string;
675
+ createdAt: string;
676
+ updatedAt: string;
677
+ deletedAt?: Record<string, any> | null;
678
+ createdBy: string;
679
+ realm: 'boost' | 'thrive';
680
+ siteId?: Record<string, any> | null;
681
+ name: string;
682
+ description?: Record<string, any> | null;
683
+ status: 'active' | 'paused' | 'archived';
684
+ earningRuleCount?: number;
685
+ earningRules: EarningRuleDto[];
686
+ milestones: MilestoneDto[];
687
+ }
688
+
689
+ export interface CreateRewardDto {
690
+ realm: 'boost' | 'thrive';
691
+ // Optional site scope for the reward. Omit for a realm-global reward.
692
+ siteId?: string;
693
+ name: string;
694
+ description?: string;
695
+ earningRules?: EarningRuleDto[];
696
+ milestones?: MilestoneDto[];
697
+ }
698
+
699
+ export interface UpdateRewardDto {
700
+ realm?: 'boost' | 'thrive';
701
+ // Optional site scope for the reward. Omit for a realm-global reward.
702
+ siteId?: string;
703
+ name?: string;
704
+ description?: string;
705
+ earningRules?: EarningRuleDto[];
706
+ milestones?: MilestoneDto[];
707
+ }
708
+
709
+ export interface UpdateRewardStatusDto {
710
+ status: 'active' | 'paused' | 'archived';
711
+ }
712
+
713
+ export interface RewardCardResponseDto {
714
+ id: string;
715
+ createdAt: string;
716
+ updatedAt: string;
717
+ rewardId: string;
718
+ customerId: string;
719
+ pointsBalance: number;
720
+ lifetimePoints: number;
721
+ status: string;
722
+ }
723
+
724
+ export interface RewardCardListResponseDto {
725
+ data: RewardCardResponseDto[];
726
+ pagination: RewardPaginationDto;
727
+ }
728
+
729
+ export interface RewardEventResponseDto {
730
+ id: string;
731
+ createdAt: string;
732
+ cardId: string;
733
+ eventType: 'order_placed' | 'item_purchased' | 'amount_spent';
734
+ pointsDelta: number;
735
+ orderId?: Record<string, any> | null;
736
+ description?: Record<string, any> | null;
737
+ adjustedBy?: Record<string, any> | null;
738
+ }
739
+
740
+ export interface RewardCardDetailResponseDto {
741
+ id: string;
742
+ createdAt: string;
743
+ updatedAt: string;
744
+ rewardId: string;
745
+ customerId: string;
746
+ pointsBalance: number;
747
+ lifetimePoints: number;
748
+ status: string;
749
+ events: RewardEventResponseDto[];
750
+ }
751
+
752
+ export interface AdjustPointsDto {
753
+ // Positive to add, negative to deduct
754
+ pointsDelta: number;
755
+ description: string;
756
+ }
757
+
758
+ export interface EarnOrderItemDto {
759
+ id: string;
760
+ quantity: number;
761
+ priceCents?: number;
762
+ }
763
+
764
+ export interface EarnOrderDto {
765
+ orderId: string;
766
+ customerId: string;
767
+ realm: 'boost' | 'thrive';
768
+ siteId: string;
769
+ brandId: string;
770
+ amountCents: number;
771
+ items: EarnOrderItemDto[];
772
+ email?: string;
773
+ metadata?: Record<string, any>;
774
+ }
775
+
776
+ export interface EarnOrderResponseDto {
777
+ rewardId?: Record<string, any> | null;
778
+ rewardIds?: string[];
779
+ alreadyProcessed: boolean;
780
+ pointsAwarded: number;
781
+ issuedVoucherCodes: string[];
782
+ }
783
+
784
+ // GET /loyalty/bundles - List bundles with optional filters
785
+
786
+ export interface GetLoyaltyBundlesQuery {
787
+ // Max items to return
788
+ limit?: number;
789
+ // Opaque cursor from previous response
790
+ cursor?: string;
791
+ realm?: 'boost' | 'thrive';
792
+ siteId?: string;
793
+ siteIds?: string[];
794
+ name?: string;
795
+ }
796
+
797
+ export type GetLoyaltyBundlesResponse = BundleListResponseDto;
798
+
799
+ // POST /loyalty/bundles - Create a new bundle
800
+
801
+ export type PostLoyaltyBundleBody = CreateBundleDto;
802
+
803
+ export type PostLoyaltyBundleResponse = BundleDetailResponseDto;
804
+
805
+ // GET /loyalty/bundles/{id} - Get bundle by ID with groups
806
+
807
+ export interface GetLoyaltyBundlePath {
808
+ id: string;
809
+ }
810
+
811
+ export type GetLoyaltyBundleResponse = BundleDetailResponseDto;
812
+
813
+ // PATCH /loyalty/bundles/{id} - Update a bundle
814
+
815
+ export interface PatchLoyaltyBundlePath {
816
+ id: string;
817
+ }
818
+
819
+ export type PatchLoyaltyBundleBody = UpdateBundleDto;
820
+
821
+ export type PatchLoyaltyBundleResponse = BundleDetailResponseDto;
822
+
823
+ // DELETE /loyalty/bundles/{id} - Soft-delete a bundle
824
+
825
+ export interface DeleteLoyaltyBundlePath {
826
+ id: string;
827
+ }
828
+
829
+ export type DeleteLoyaltyBundleResponse = {};
830
+
831
+ // GET /loyalty/campaigns - List campaigns with filters and pagination
832
+
833
+ export interface GetLoyaltyCampaignsQuery {
834
+ // Max items to return
835
+ limit?: number;
836
+ // Opaque cursor from previous response
837
+ cursor?: string;
838
+ realm?: 'boost' | 'thrive';
839
+ status?: 'draft' | 'active' | 'paused' | 'expired' | 'archived';
840
+ type?: 'promo_code' | 'auto_apply';
841
+ // Case-insensitive partial name match
842
+ name?: string;
843
+ // YYYY-MM-DD
844
+ startDateFrom?: string;
845
+ // YYYY-MM-DD
846
+ startDateTo?: string;
847
+ // YYYY-MM-DD
848
+ endDateFrom?: string;
849
+ // YYYY-MM-DD
850
+ endDateTo?: string;
851
+ sortBy?: 'name' | 'createdAt' | 'startDate' | 'status';
852
+ sortOrder?: 'ASC' | 'DESC';
853
+ // When true, only return campaigns linked to non-deleted rewards
854
+ hasRewards?: boolean;
855
+ }
856
+
857
+ export type GetLoyaltyCampaignsResponse = CampaignListResponseDto;
858
+
859
+ // POST /loyalty/campaigns - Create a campaign with nested child entities
860
+
861
+ export type PostLoyaltyCampaignBody = CreateCampaignDto;
862
+
863
+ export type PostLoyaltyCampaignResponse = CampaignDetailResponseDto;
864
+
865
+ // GET /loyalty/campaigns/{id} - Get campaign detail with all child entities
866
+
867
+ export interface GetLoyaltyCampaignPath {
868
+ id: string;
869
+ }
870
+
871
+ export type GetLoyaltyCampaignResponse = CampaignDetailResponseDto;
872
+
873
+ // PUT /loyalty/campaigns/{id} - Update a campaign and its child entities
874
+
875
+ export interface PutLoyaltyCampaignPath {
876
+ id: string;
877
+ }
878
+
879
+ export type PutLoyaltyCampaignBody = UpdateCampaignDto;
880
+
881
+ export type PutLoyaltyCampaignResponse = CampaignDetailResponseDto;
882
+
883
+ // DELETE /loyalty/campaigns/{id} - Soft-delete a campaign
884
+
885
+ export interface DeleteLoyaltyCampaignPath {
886
+ id: string;
887
+ }
888
+
889
+ export type DeleteLoyaltyCampaignResponse = {};
890
+
891
+ // PATCH /loyalty/campaigns/{id}/status - Transition campaign status
892
+
893
+ export interface PatchLoyaltyCampaignStatusPath {
894
+ id: string;
895
+ }
896
+
897
+ export type PatchLoyaltyCampaignStatusBody = UpdateCampaignStatusDto;
898
+
899
+ export type PatchLoyaltyCampaignStatusResponse = CampaignDetailResponseDto;
900
+
901
+ // POST /loyalty/campaigns/{id}/clone - Deep clone a campaign and all child entities
902
+
903
+ export interface PostLoyaltyCampaignClonePath {
904
+ id: string;
905
+ }
906
+
907
+ export type PostLoyaltyCampaignCloneResponse = CampaignDetailResponseDto;
908
+
909
+ // GET /loyalty/vouchers - List vouchers with optional filters
910
+
911
+ export interface GetLoyaltyVouchersQuery {
912
+ // Max items to return
913
+ limit?: number;
914
+ // Opaque cursor from previous response
915
+ cursor?: string;
916
+ campaignId?: string;
917
+ realm?: 'boost' | 'thrive';
918
+ status?: 'active' | 'redeemed' | 'expired' | 'revoked';
919
+ // Exact code match
920
+ code?: string;
921
+ codeType?: 'open' | 'personal' | 'auto_applied';
922
+ customerId?: string;
923
+ }
924
+
925
+ export type GetLoyaltyVouchersResponse = VoucherListResponseDto;
926
+
927
+ // POST /loyalty/vouchers - Create a single voucher
928
+
929
+ export type PostLoyaltyVoucherBody = CreateVoucherDto;
930
+
931
+ export type PostLoyaltyVoucherResponse = VoucherResponseDto;
932
+
933
+ // GET /loyalty/vouchers/{id} - Get voucher by ID with campaign info and redemption count
934
+
935
+ export interface GetLoyaltyVoucherPath {
936
+ id: string;
937
+ }
938
+
939
+ export type GetLoyaltyVoucherResponse = VoucherResponseDto;
940
+
941
+ // PUT /loyalty/vouchers/{id} - Update a voucher
942
+
943
+ export interface PutLoyaltyVoucherPath {
944
+ id: string;
945
+ }
946
+
947
+ export type PutLoyaltyVoucherBody = UpdateVoucherDto;
948
+
949
+ export type PutLoyaltyVoucherResponse = VoucherResponseDto;
950
+
951
+ // DELETE /loyalty/vouchers/{id} - Soft-delete a voucher
952
+
953
+ export interface DeleteLoyaltyVoucherPath {
954
+ id: string;
955
+ }
956
+
957
+ export type DeleteLoyaltyVoucherResponse = {};
958
+
959
+ // POST /loyalty/vouchers/{id}/revoke - Revoke a voucher with a required reason
960
+
961
+ export interface PostLoyaltyVoucherRevokePath {
962
+ id: string;
963
+ }
964
+
965
+ export type PostLoyaltyVoucherRevokeBody = RevokeVoucherDto;
966
+
967
+ export type PostLoyaltyVoucherRevokeResponse = VoucherResponseDto;
968
+
969
+ // POST /loyalty/vouchers/batch - Batch generate voucher codes for a campaign
970
+
971
+ export type PostLoyaltyVouchersBatchBody = BatchVoucherDto;
972
+
973
+ export type PostLoyaltyVouchersBatchResponse = BatchVoucherResponseDto;
974
+
975
+ // GET /loyalty/vouchers/{id}/redemptions - Get redemption history for a voucher
976
+
977
+ export interface GetLoyaltyVoucherRedemptionsPath {
978
+ id: string;
979
+ }
980
+
981
+ export interface GetLoyaltyVoucherRedemptionsQuery {
982
+ // Max items to return
983
+ limit?: number;
984
+ // Opaque cursor from previous response
985
+ cursor?: string;
986
+ }
987
+
988
+ export type GetLoyaltyVoucherRedemptionsResponse = RedemptionListResponseDto;
989
+
990
+ // POST /loyalty/vouchers/validate - Validate one or more voucher codes
991
+
992
+ export type PostLoyaltyVouchersValidateBody = VoucherOperationDto;
993
+
994
+ export type PostLoyaltyVouchersValidateResponse = VoucherOperationResponseDto;
995
+
996
+ // POST /loyalty/vouchers/redeem - Redeem one or more voucher codes
997
+
998
+ export type PostLoyaltyVouchersRedeemBody = VoucherOperationDto;
999
+
1000
+ export type PostLoyaltyVouchersRedeemResponse = VoucherOperationResponseDto;
1001
+
1002
+ // GET /loyalty/segments - List segments with optional filters
1003
+
1004
+ export interface GetLoyaltySegmentsQuery {
1005
+ // Max items to return
1006
+ limit?: number;
1007
+ // Opaque cursor from previous response
1008
+ cursor?: string;
1009
+ realm?: 'boost' | 'thrive';
1010
+ type?: 'static_list' | 'attribute_rule' | 'sso';
1011
+ ownership?: 'system' | 'custom';
1012
+ // Case-insensitive partial name match
1013
+ name?: string;
1014
+ }
1015
+
1016
+ export type GetLoyaltySegmentsResponse = SegmentListResponseDto;
1017
+
1018
+ // POST /loyalty/segments - Create a new segment
1019
+
1020
+ export type PostLoyaltySegmentBody = CreateSegmentDto;
1021
+
1022
+ export type PostLoyaltySegmentResponse = SegmentResponseDto;
1023
+
1024
+ // GET /loyalty/segments/attributes - List available attributes for rule-based segments
1025
+
1026
+ export type GetLoyaltySegmentAttributesResponse = SegmentAttributeResponseDto[];
1027
+
1028
+ // POST /loyalty/segments/preview-count - Preview how many customers match a segment rule
1029
+
1030
+ export type PostLoyaltySegmentPreviewCountBody = SegmentRuleDto;
1031
+
1032
+ export type PostLoyaltySegmentPreviewCountResponse = SegmentPreviewCountResponseDto;
1033
+
1034
+ // GET /loyalty/segments/{id} - Get segment by ID
1035
+
1036
+ export interface GetLoyaltySegmentPath {
1037
+ id: string;
1038
+ }
1039
+
1040
+ export type GetLoyaltySegmentResponse = SegmentResponseDto;
1041
+
1042
+ // PATCH /loyalty/segments/{id} - Update a segment
1043
+
1044
+ export interface PatchLoyaltySegmentPath {
1045
+ id: string;
1046
+ }
1047
+
1048
+ export type PatchLoyaltySegmentBody = UpdateSegmentDto;
1049
+
1050
+ export type PatchLoyaltySegmentResponse = SegmentResponseDto;
1051
+
1052
+ // DELETE /loyalty/segments/{id} - Soft-delete a segment
1053
+
1054
+ export interface DeleteLoyaltySegmentPath {
1055
+ id: string;
1056
+ }
1057
+
1058
+ export type DeleteLoyaltySegmentResponse = {};
1059
+
1060
+ // GET /loyalty/segments/{id}/members - List members of a static_list segment
1061
+
1062
+ export interface GetLoyaltySegmentMembersPath {
1063
+ id: string;
1064
+ }
1065
+
1066
+ export interface GetLoyaltySegmentMembersQuery {
1067
+ // Max items to return
1068
+ limit?: number;
1069
+ // Opaque cursor from previous response
1070
+ cursor?: string;
1071
+ }
1072
+
1073
+ export type GetLoyaltySegmentMembersResponse = SegmentMembersListResponseDto;
1074
+
1075
+ // POST /loyalty/segments/{id}/members - Add members to a segment
1076
+
1077
+ export interface PostLoyaltySegmentMembersPath {
1078
+ id: string;
1079
+ }
1080
+
1081
+ export type PostLoyaltySegmentMembersBody = SegmentMembersDto;
1082
+
1083
+ export type PostLoyaltySegmentMembersResponse = AddSegmentMembersResponseDto;
1084
+
1085
+ // DELETE /loyalty/segments/{id}/members - Remove members from a segment
1086
+
1087
+ export interface DeleteLoyaltySegmentMembersPath {
1088
+ id: string;
1089
+ }
1090
+
1091
+ export type DeleteLoyaltySegmentMembersBody = SegmentMembersDto;
1092
+
1093
+ export type DeleteLoyaltySegmentMembersResponse = RemoveSegmentMembersResponseDto;
1094
+
1095
+ // POST /loyalty/redemptions/{id}/rollback - Roll back a redemption and restore the voucher
1096
+
1097
+ export interface PostLoyaltyRedemptionRollbackPath {
1098
+ id: string;
1099
+ }
1100
+
1101
+ export type PostLoyaltyRedemptionRollbackBody = RollbackRedemptionDto;
1102
+
1103
+ export type PostLoyaltyRedemptionRollbackResponse = RedemptionResponseDto;
1104
+
1105
+ // GET /loyalty/rewards - List rewards with filters and pagination
1106
+
1107
+ export interface GetLoyaltyRewardsQuery {
1108
+ // Max items to return
1109
+ limit?: number;
1110
+ // Opaque cursor from previous response
1111
+ cursor?: string;
1112
+ // Case-insensitive partial match across reward text fields
1113
+ query?: string;
1114
+ realm?: 'boost' | 'thrive';
1115
+ // Exact reward site scope match
1116
+ siteId?: string;
1117
+ // Exact milestone-linked campaign match
1118
+ campaignId?: string;
1119
+ status?: 'active' | 'paused' | 'archived';
1120
+ }
1121
+
1122
+ export type GetLoyaltyRewardsResponse = RewardListResponseDto;
1123
+
1124
+ // POST /loyalty/rewards - Create a reward with earning rules and milestones
1125
+
1126
+ export type PostLoyaltyRewardBody = CreateRewardDto;
1127
+
1128
+ export type PostLoyaltyRewardResponse = RewardDetailResponseDto;
1129
+
1130
+ // GET /loyalty/rewards/{id} - Get reward detail with earning rules and milestones
1131
+
1132
+ export interface GetLoyaltyRewardPath {
1133
+ id: string;
1134
+ }
1135
+
1136
+ export type GetLoyaltyRewardResponse = RewardDetailResponseDto;
1137
+
1138
+ // PUT /loyalty/rewards/{id} - Update a reward and replace its earning rules and milestones
1139
+
1140
+ export interface PutLoyaltyRewardPath {
1141
+ id: string;
1142
+ }
1143
+
1144
+ export type PutLoyaltyRewardBody = UpdateRewardDto;
1145
+
1146
+ export type PutLoyaltyRewardResponse = RewardDetailResponseDto;
1147
+
1148
+ // PATCH /loyalty/rewards/{id}/status - Transition reward status
1149
+
1150
+ export interface PatchLoyaltyRewardStatusPath {
1151
+ id: string;
1152
+ }
1153
+
1154
+ export type PatchLoyaltyRewardStatusBody = UpdateRewardStatusDto;
1155
+
1156
+ export type PatchLoyaltyRewardStatusResponse = RewardDetailResponseDto;
1157
+
1158
+ // GET /loyalty/rewards/{id}/cards - List enrolled customer cards for a reward
1159
+
1160
+ export interface GetLoyaltyRewardCardsPath {
1161
+ id: string;
1162
+ }
1163
+
1164
+ export interface GetLoyaltyRewardCardsQuery {
1165
+ // Max items to return
1166
+ limit?: number;
1167
+ // Opaque cursor from previous response
1168
+ cursor?: string;
1169
+ }
1170
+
1171
+ export type GetLoyaltyRewardCardsResponse = RewardCardListResponseDto;
1172
+
1173
+ // GET /loyalty/rewards/{id}/cards/{customerId} - Get card detail with transaction event history
1174
+
1175
+ export interface GetLoyaltyRewardCardPath {
1176
+ id: string;
1177
+ customerId: string;
1178
+ }
1179
+
1180
+ export type GetLoyaltyRewardCardResponse = RewardCardDetailResponseDto;
1181
+
1182
+ // POST /loyalty/rewards/cards/{cardId}/adjust - Manual point adjustment on a reward card
1183
+
1184
+ export interface PostLoyaltyRewardCardAdjustPath {
1185
+ cardId: string;
1186
+ }
1187
+
1188
+ export type PostLoyaltyRewardCardAdjustBody = AdjustPointsDto;
1189
+
1190
+ export type PostLoyaltyRewardCardAdjustResponse = RewardCardDetailResponseDto;
1191
+
1192
+ // POST /loyalty/rewards/orders/earn - Evaluate an order against active reward rules and award points idempotently
1193
+
1194
+ export type PostLoyaltyRewardOrderEarnBody = EarnOrderDto;
1195
+
1196
+ export type PostLoyaltyRewardOrderEarnResponse = EarnOrderResponseDto;