@compassdigital/sdk.typescript 4.598.0 → 4.600.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.
- package/lib/index.d.ts +318 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +385 -0
- package/lib/index.js.map +1 -1
- package/lib/interface/loyalty.d.ts +853 -0
- package/lib/interface/loyalty.d.ts.map +1 -0
- package/lib/interface/loyalty.js +5 -0
- package/lib/interface/loyalty.js.map +1 -0
- package/manifest.json +7 -0
- package/package.json +1 -1
- package/src/index.ts +945 -0
- package/src/interface/loyalty.ts +1198 -0
- package/test/client.test.ts +23 -0
|
@@ -0,0 +1,1198 @@
|
|
|
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?: string | null;
|
|
11
|
+
createdBy: string;
|
|
12
|
+
realm: 'boost' | 'thrive';
|
|
13
|
+
siteId?: string | null;
|
|
14
|
+
name: string;
|
|
15
|
+
description?: string | null;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface BundlePaginationDto {
|
|
19
|
+
cursor?: string | 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?: string | null;
|
|
66
|
+
createdBy: string;
|
|
67
|
+
realm: 'boost' | 'thrive';
|
|
68
|
+
siteId?: string | null;
|
|
69
|
+
name: string;
|
|
70
|
+
description?: string | 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?: string | null;
|
|
95
|
+
createdBy: string;
|
|
96
|
+
updatedBy: string;
|
|
97
|
+
realm: 'boost' | 'thrive';
|
|
98
|
+
name: string;
|
|
99
|
+
description?: string | 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?: number | null;
|
|
105
|
+
discountPercent?: number | null;
|
|
106
|
+
appliesToCheapest: boolean;
|
|
107
|
+
maxDiscountCents?: number | null;
|
|
108
|
+
codeType: 'open' | 'personal' | 'auto_applied';
|
|
109
|
+
// YYYY-MM-DD
|
|
110
|
+
startDate?: string | null;
|
|
111
|
+
// YYYY-MM-DD
|
|
112
|
+
endDate?: string | null;
|
|
113
|
+
maxRedemptions?: number | null;
|
|
114
|
+
maxRedemptionsPerCustomer?: number | null;
|
|
115
|
+
maxRedemptionsDaily?: number | null;
|
|
116
|
+
maxRedemptionsPerCustomerDaily?: number | null;
|
|
117
|
+
minOrderValueCents?: number | null;
|
|
118
|
+
maxOrderValueCents?: number | null;
|
|
119
|
+
bundleId?: string | null;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export interface CampaignPaginationDto {
|
|
123
|
+
cursor?: string | 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?: string | null;
|
|
149
|
+
maxRedemptionsPerCustomer?: number | null;
|
|
150
|
+
maxRedemptionsPerCustomerDaily?: number | 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?: string | null;
|
|
170
|
+
stationId?: string | null;
|
|
171
|
+
menuId?: string | null;
|
|
172
|
+
categoryId?: string | null;
|
|
173
|
+
itemId?: string | null;
|
|
174
|
+
maxDiscountCents?: number | null;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export interface CampaignDetailResponseDto {
|
|
178
|
+
id: string;
|
|
179
|
+
createdAt: string;
|
|
180
|
+
updatedAt: string;
|
|
181
|
+
deletedAt?: string | null;
|
|
182
|
+
createdBy: string;
|
|
183
|
+
updatedBy: string;
|
|
184
|
+
realm: 'boost' | 'thrive';
|
|
185
|
+
name: string;
|
|
186
|
+
description?: string | 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?: number | null;
|
|
192
|
+
discountPercent?: number | null;
|
|
193
|
+
appliesToCheapest: boolean;
|
|
194
|
+
maxDiscountCents?: number | null;
|
|
195
|
+
codeType: 'open' | 'personal' | 'auto_applied';
|
|
196
|
+
// YYYY-MM-DD
|
|
197
|
+
startDate?: string | null;
|
|
198
|
+
// YYYY-MM-DD
|
|
199
|
+
endDate?: string | null;
|
|
200
|
+
maxRedemptions?: number | null;
|
|
201
|
+
maxRedemptionsPerCustomer?: number | null;
|
|
202
|
+
maxRedemptionsDaily?: number | null;
|
|
203
|
+
maxRedemptionsPerCustomerDaily?: number | null;
|
|
204
|
+
minOrderValueCents?: number | null;
|
|
205
|
+
maxOrderValueCents?: number | null;
|
|
206
|
+
bundleId?: string | 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?: string | null;
|
|
340
|
+
campaignId: string;
|
|
341
|
+
realm: 'boost' | 'thrive';
|
|
342
|
+
code: string;
|
|
343
|
+
codeType: 'open' | 'personal' | 'auto_applied';
|
|
344
|
+
customerId?: string | null;
|
|
345
|
+
status: string;
|
|
346
|
+
expiresAt?: string | null;
|
|
347
|
+
issuedBy?: string | null;
|
|
348
|
+
issueReason?: string | null;
|
|
349
|
+
revokedAt?: string | null;
|
|
350
|
+
revokedBy?: string | null;
|
|
351
|
+
revokeReason?: string | null;
|
|
352
|
+
source?: string;
|
|
353
|
+
campaignName?: string;
|
|
354
|
+
campaignType?: string;
|
|
355
|
+
redemptionCount?: number;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
export interface VoucherPaginationDto {
|
|
359
|
+
cursor?: string | 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 (max 25)
|
|
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?: string | 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?: string | null;
|
|
431
|
+
customerId?: string | null;
|
|
432
|
+
orderId?: string | null;
|
|
433
|
+
siteId?: string | null;
|
|
434
|
+
stationId?: string | null;
|
|
435
|
+
realm?: string;
|
|
436
|
+
discountAmountCents?: number;
|
|
437
|
+
orderTotalCents?: number;
|
|
438
|
+
status?: string;
|
|
439
|
+
rolledBackAt?: string | null;
|
|
440
|
+
rollbackReason?: string | null;
|
|
441
|
+
externalRedemptionId?: string | 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
|
+
// IANA timezone of the site (e.g. America/Toronto)
|
|
482
|
+
tz?: string;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
export interface VoucherOrderDto {
|
|
486
|
+
source_id?: string;
|
|
487
|
+
items?: VoucherOrderItemDto[];
|
|
488
|
+
metadata?: VoucherOrderMetadataDto;
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
export interface VoucherOperationDto {
|
|
492
|
+
codes: string[];
|
|
493
|
+
customer?: VoucherCustomerDto;
|
|
494
|
+
order?: VoucherOrderDto;
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
export interface VoucherErrorResponseDto {
|
|
498
|
+
message: string;
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
export interface VoucherOperationOrderResponseDto {
|
|
502
|
+
total_discount_amount: number;
|
|
503
|
+
total_applied_discount_amount: number;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
export interface VoucherOperationResultResponseDto {
|
|
507
|
+
discount?: VoucherDiscountResponseDto;
|
|
508
|
+
error?: VoucherErrorResponseDto;
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
export interface VoucherRedeemableResponseDto {
|
|
512
|
+
status: string;
|
|
513
|
+
id: string;
|
|
514
|
+
object: string;
|
|
515
|
+
order: VoucherOperationOrderResponseDto;
|
|
516
|
+
result: VoucherOperationResultResponseDto;
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
export interface VoucherOperationResponseDto {
|
|
520
|
+
code?: string;
|
|
521
|
+
valid?: boolean;
|
|
522
|
+
success?: boolean;
|
|
523
|
+
app?: string;
|
|
524
|
+
discount?: VoucherDiscountResponseDto;
|
|
525
|
+
provider_data?: Record<string, any>;
|
|
526
|
+
error?: VoucherErrorResponseDto;
|
|
527
|
+
redeemables?: VoucherRedeemableResponseDto[];
|
|
528
|
+
redemptions?: RedemptionResponseDto[];
|
|
529
|
+
id?: string;
|
|
530
|
+
date?: string;
|
|
531
|
+
result?: string;
|
|
532
|
+
object?: string;
|
|
533
|
+
voucher?: VoucherRedemptionVoucherDto;
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
export interface SegmentRuleDto {
|
|
537
|
+
// Attribute key to evaluate (e.g. points_balance, enrollment_date)
|
|
538
|
+
attribute: string;
|
|
539
|
+
// Operator key (eq, neq, gt, gte, lt, lte)
|
|
540
|
+
operator: string;
|
|
541
|
+
// Value to compare against
|
|
542
|
+
value: string;
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
export interface SegmentResponseDto {
|
|
546
|
+
id: string;
|
|
547
|
+
createdAt: string;
|
|
548
|
+
updatedAt: string;
|
|
549
|
+
deletedAt?: string | null;
|
|
550
|
+
createdBy: string;
|
|
551
|
+
realm: 'boost' | 'thrive';
|
|
552
|
+
name: string;
|
|
553
|
+
description?: string | null;
|
|
554
|
+
type: 'static_list' | 'attribute_rule' | 'sso';
|
|
555
|
+
ownership: 'system' | 'custom';
|
|
556
|
+
editable: boolean;
|
|
557
|
+
deletable: boolean;
|
|
558
|
+
ruleJson?: SegmentRuleDto;
|
|
559
|
+
memberCount?: number;
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
export interface SegmentPaginationDto {
|
|
563
|
+
cursor?: string | null;
|
|
564
|
+
hasMore: boolean;
|
|
565
|
+
limit: number;
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
export interface SegmentListResponseDto {
|
|
569
|
+
data: SegmentResponseDto[];
|
|
570
|
+
pagination: SegmentPaginationDto;
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
export interface SegmentAttributeResponseDto {
|
|
574
|
+
key: string;
|
|
575
|
+
label: string;
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
export interface SegmentPreviewCountResponseDto {
|
|
579
|
+
count: number;
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
export interface CreateSegmentDto {
|
|
583
|
+
realm: 'boost' | 'thrive';
|
|
584
|
+
name: string;
|
|
585
|
+
description?: string;
|
|
586
|
+
type: 'static_list' | 'attribute_rule' | 'sso';
|
|
587
|
+
// Required when type = attribute_rule
|
|
588
|
+
ruleJson?: SegmentRuleDto;
|
|
589
|
+
// Initial members for static_list segments
|
|
590
|
+
customerIds?: string[];
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
export interface UpdateSegmentDto {
|
|
594
|
+
name?: string;
|
|
595
|
+
description?: string;
|
|
596
|
+
ruleJson?: SegmentRuleDto;
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
export interface SegmentMemberResponseDto {
|
|
600
|
+
customerId: string;
|
|
601
|
+
addedAt: string;
|
|
602
|
+
addedBy: string;
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
export interface SegmentMembersListResponseDto {
|
|
606
|
+
data: SegmentMemberResponseDto[];
|
|
607
|
+
pagination: SegmentPaginationDto;
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
export interface SegmentMembersDto {
|
|
611
|
+
// List of customer IDs
|
|
612
|
+
customerIds: string[];
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
export interface AddSegmentMembersResponseDto {
|
|
616
|
+
added: number;
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
export interface RemoveSegmentMembersResponseDto {
|
|
620
|
+
removed: number;
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
export interface RollbackRedemptionDto {
|
|
624
|
+
// Reason for rolling back the redemption
|
|
625
|
+
reason: string;
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
export interface RewardResponseDto {
|
|
629
|
+
id: string;
|
|
630
|
+
createdAt: string;
|
|
631
|
+
updatedAt: string;
|
|
632
|
+
deletedAt?: string | null;
|
|
633
|
+
createdBy: string;
|
|
634
|
+
realm: 'boost' | 'thrive';
|
|
635
|
+
siteId?: string | null;
|
|
636
|
+
name: string;
|
|
637
|
+
description?: string | null;
|
|
638
|
+
status: 'active' | 'paused' | 'archived';
|
|
639
|
+
earningRuleCount?: number;
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
export interface RewardPaginationDto {
|
|
643
|
+
cursor?: string | null;
|
|
644
|
+
hasMore: boolean;
|
|
645
|
+
limit: number;
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
export interface RewardListResponseDto {
|
|
649
|
+
data: RewardResponseDto[];
|
|
650
|
+
pagination: RewardPaginationDto;
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
export interface BrandExclusionDto {
|
|
654
|
+
siteId: string;
|
|
655
|
+
stationId: string;
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
export interface EarningRuleDto {
|
|
659
|
+
eventType: 'order_placed' | 'item_purchased' | 'amount_spent';
|
|
660
|
+
points: number;
|
|
661
|
+
spendThresholdCents?: number;
|
|
662
|
+
siteId?: string;
|
|
663
|
+
itemId?: string;
|
|
664
|
+
// Stations excluded from earning on this rule
|
|
665
|
+
brandExclusions?: BrandExclusionDto[];
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
export interface MilestoneDto {
|
|
669
|
+
pointsRequired: number;
|
|
670
|
+
campaignId: string;
|
|
671
|
+
resetsAfterMilestone: boolean;
|
|
672
|
+
maxRewardCount?: number;
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
export interface RewardDetailResponseDto {
|
|
676
|
+
id: string;
|
|
677
|
+
createdAt: string;
|
|
678
|
+
updatedAt: string;
|
|
679
|
+
deletedAt?: string | null;
|
|
680
|
+
createdBy: string;
|
|
681
|
+
realm: 'boost' | 'thrive';
|
|
682
|
+
siteId?: string | null;
|
|
683
|
+
name: string;
|
|
684
|
+
description?: string | null;
|
|
685
|
+
status: 'active' | 'paused' | 'archived';
|
|
686
|
+
earningRuleCount?: number;
|
|
687
|
+
earningRules: EarningRuleDto[];
|
|
688
|
+
milestones: MilestoneDto[];
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
export interface CreateRewardDto {
|
|
692
|
+
realm: 'boost' | 'thrive';
|
|
693
|
+
// Optional site scope for the reward. Omit for a realm-global reward.
|
|
694
|
+
siteId?: string;
|
|
695
|
+
name: string;
|
|
696
|
+
description?: string;
|
|
697
|
+
earningRules?: EarningRuleDto[];
|
|
698
|
+
milestones?: MilestoneDto[];
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
export interface UpdateRewardDto {
|
|
702
|
+
realm?: 'boost' | 'thrive';
|
|
703
|
+
// Optional site scope for the reward. Omit for a realm-global reward.
|
|
704
|
+
siteId?: string;
|
|
705
|
+
name?: string;
|
|
706
|
+
description?: string;
|
|
707
|
+
earningRules?: EarningRuleDto[];
|
|
708
|
+
milestones?: MilestoneDto[];
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
export interface UpdateRewardStatusDto {
|
|
712
|
+
status: 'active' | 'paused' | 'archived';
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
export interface RewardCardResponseDto {
|
|
716
|
+
id: string;
|
|
717
|
+
createdAt: string;
|
|
718
|
+
updatedAt: string;
|
|
719
|
+
rewardId: string;
|
|
720
|
+
customerId: string;
|
|
721
|
+
pointsBalance: number;
|
|
722
|
+
lifetimePoints: number;
|
|
723
|
+
status: string;
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
export interface RewardCardListResponseDto {
|
|
727
|
+
data: RewardCardResponseDto[];
|
|
728
|
+
pagination: RewardPaginationDto;
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
export interface RewardEventResponseDto {
|
|
732
|
+
id: string;
|
|
733
|
+
createdAt: string;
|
|
734
|
+
cardId: string;
|
|
735
|
+
eventType: 'order_placed' | 'item_purchased' | 'amount_spent';
|
|
736
|
+
pointsDelta: number;
|
|
737
|
+
orderId?: string | null;
|
|
738
|
+
description?: string | null;
|
|
739
|
+
adjustedBy?: string | null;
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
export interface RewardCardDetailResponseDto {
|
|
743
|
+
id: string;
|
|
744
|
+
createdAt: string;
|
|
745
|
+
updatedAt: string;
|
|
746
|
+
rewardId: string;
|
|
747
|
+
customerId: string;
|
|
748
|
+
pointsBalance: number;
|
|
749
|
+
lifetimePoints: number;
|
|
750
|
+
status: string;
|
|
751
|
+
events: RewardEventResponseDto[];
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
export interface AdjustPointsDto {
|
|
755
|
+
// Positive to add, negative to deduct
|
|
756
|
+
pointsDelta: number;
|
|
757
|
+
description: string;
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
export interface EarnOrderItemDto {
|
|
761
|
+
id: string;
|
|
762
|
+
quantity: number;
|
|
763
|
+
priceCents?: number;
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
export interface EarnOrderDto {
|
|
767
|
+
orderId: string;
|
|
768
|
+
customerId: string;
|
|
769
|
+
realm: 'boost' | 'thrive';
|
|
770
|
+
siteId: string;
|
|
771
|
+
brandId: string;
|
|
772
|
+
amountCents: number;
|
|
773
|
+
items: EarnOrderItemDto[];
|
|
774
|
+
email?: string;
|
|
775
|
+
metadata?: Record<string, any>;
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
export interface EarnOrderResponseDto {
|
|
779
|
+
rewardId?: string | null;
|
|
780
|
+
rewardIds?: string[];
|
|
781
|
+
alreadyProcessed: boolean;
|
|
782
|
+
pointsAwarded: number;
|
|
783
|
+
issuedVoucherCodes: string[];
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
// GET /loyalty/bundles - List bundles with optional filters
|
|
787
|
+
|
|
788
|
+
export interface GetLoyaltyBundlesQuery {
|
|
789
|
+
// Max items to return
|
|
790
|
+
limit?: number;
|
|
791
|
+
// Opaque cursor from previous response
|
|
792
|
+
cursor?: string;
|
|
793
|
+
realm?: 'boost' | 'thrive';
|
|
794
|
+
siteId?: string;
|
|
795
|
+
siteIds?: string[];
|
|
796
|
+
name?: string;
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
export type GetLoyaltyBundlesResponse = BundleListResponseDto;
|
|
800
|
+
|
|
801
|
+
// POST /loyalty/bundles - Create a new bundle
|
|
802
|
+
|
|
803
|
+
export type PostLoyaltyBundleBody = CreateBundleDto;
|
|
804
|
+
|
|
805
|
+
export type PostLoyaltyBundleResponse = BundleDetailResponseDto;
|
|
806
|
+
|
|
807
|
+
// GET /loyalty/bundles/{id} - Get bundle by ID with groups
|
|
808
|
+
|
|
809
|
+
export interface GetLoyaltyBundlePath {
|
|
810
|
+
id: string;
|
|
811
|
+
}
|
|
812
|
+
|
|
813
|
+
export type GetLoyaltyBundleResponse = BundleDetailResponseDto;
|
|
814
|
+
|
|
815
|
+
// PATCH /loyalty/bundles/{id} - Update a bundle
|
|
816
|
+
|
|
817
|
+
export interface PatchLoyaltyBundlePath {
|
|
818
|
+
id: string;
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
export type PatchLoyaltyBundleBody = UpdateBundleDto;
|
|
822
|
+
|
|
823
|
+
export type PatchLoyaltyBundleResponse = BundleDetailResponseDto;
|
|
824
|
+
|
|
825
|
+
// DELETE /loyalty/bundles/{id} - Soft-delete a bundle
|
|
826
|
+
|
|
827
|
+
export interface DeleteLoyaltyBundlePath {
|
|
828
|
+
id: string;
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
export type DeleteLoyaltyBundleResponse = {};
|
|
832
|
+
|
|
833
|
+
// GET /loyalty/campaigns - List campaigns with filters and pagination
|
|
834
|
+
|
|
835
|
+
export interface GetLoyaltyCampaignsQuery {
|
|
836
|
+
// Max items to return
|
|
837
|
+
limit?: number;
|
|
838
|
+
// Opaque cursor from previous response
|
|
839
|
+
cursor?: string;
|
|
840
|
+
realm?: 'boost' | 'thrive';
|
|
841
|
+
status?: 'draft' | 'active' | 'paused' | 'expired' | 'archived';
|
|
842
|
+
type?: 'promo_code' | 'auto_apply';
|
|
843
|
+
// Case-insensitive partial name match
|
|
844
|
+
name?: string;
|
|
845
|
+
// YYYY-MM-DD
|
|
846
|
+
startDateFrom?: string;
|
|
847
|
+
// YYYY-MM-DD
|
|
848
|
+
startDateTo?: string;
|
|
849
|
+
// YYYY-MM-DD
|
|
850
|
+
endDateFrom?: string;
|
|
851
|
+
// YYYY-MM-DD
|
|
852
|
+
endDateTo?: string;
|
|
853
|
+
sortBy?: 'name' | 'createdAt' | 'startDate' | 'status';
|
|
854
|
+
sortOrder?: 'ASC' | 'DESC';
|
|
855
|
+
// When true, only return campaigns linked to non-deleted rewards
|
|
856
|
+
hasRewards?: boolean;
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
export type GetLoyaltyCampaignsResponse = CampaignListResponseDto;
|
|
860
|
+
|
|
861
|
+
// POST /loyalty/campaigns - Create a campaign with nested child entities
|
|
862
|
+
|
|
863
|
+
export type PostLoyaltyCampaignBody = CreateCampaignDto;
|
|
864
|
+
|
|
865
|
+
export type PostLoyaltyCampaignResponse = CampaignDetailResponseDto;
|
|
866
|
+
|
|
867
|
+
// GET /loyalty/campaigns/{id} - Get campaign detail with all child entities
|
|
868
|
+
|
|
869
|
+
export interface GetLoyaltyCampaignPath {
|
|
870
|
+
id: string;
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
export type GetLoyaltyCampaignResponse = CampaignDetailResponseDto;
|
|
874
|
+
|
|
875
|
+
// PUT /loyalty/campaigns/{id} - Update a campaign and its child entities
|
|
876
|
+
|
|
877
|
+
export interface PutLoyaltyCampaignPath {
|
|
878
|
+
id: string;
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
export type PutLoyaltyCampaignBody = UpdateCampaignDto;
|
|
882
|
+
|
|
883
|
+
export type PutLoyaltyCampaignResponse = CampaignDetailResponseDto;
|
|
884
|
+
|
|
885
|
+
// DELETE /loyalty/campaigns/{id} - Soft-delete a campaign
|
|
886
|
+
|
|
887
|
+
export interface DeleteLoyaltyCampaignPath {
|
|
888
|
+
id: string;
|
|
889
|
+
}
|
|
890
|
+
|
|
891
|
+
export type DeleteLoyaltyCampaignResponse = {};
|
|
892
|
+
|
|
893
|
+
// PATCH /loyalty/campaigns/{id}/status - Transition campaign status
|
|
894
|
+
|
|
895
|
+
export interface PatchLoyaltyCampaignStatusPath {
|
|
896
|
+
id: string;
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
export type PatchLoyaltyCampaignStatusBody = UpdateCampaignStatusDto;
|
|
900
|
+
|
|
901
|
+
export type PatchLoyaltyCampaignStatusResponse = CampaignDetailResponseDto;
|
|
902
|
+
|
|
903
|
+
// POST /loyalty/campaigns/{id}/clone - Deep clone a campaign and all child entities
|
|
904
|
+
|
|
905
|
+
export interface PostLoyaltyCampaignClonePath {
|
|
906
|
+
id: string;
|
|
907
|
+
}
|
|
908
|
+
|
|
909
|
+
export type PostLoyaltyCampaignCloneResponse = CampaignDetailResponseDto;
|
|
910
|
+
|
|
911
|
+
// GET /loyalty/vouchers - List vouchers with optional filters
|
|
912
|
+
|
|
913
|
+
export interface GetLoyaltyVouchersQuery {
|
|
914
|
+
// Max items to return
|
|
915
|
+
limit?: number;
|
|
916
|
+
// Opaque cursor from previous response
|
|
917
|
+
cursor?: string;
|
|
918
|
+
campaignId?: string;
|
|
919
|
+
realm?: 'boost' | 'thrive';
|
|
920
|
+
status?: 'active' | 'redeemed' | 'expired' | 'revoked';
|
|
921
|
+
// Exact code match
|
|
922
|
+
code?: string;
|
|
923
|
+
codeType?: 'open' | 'personal' | 'auto_applied';
|
|
924
|
+
customerId?: string;
|
|
925
|
+
}
|
|
926
|
+
|
|
927
|
+
export type GetLoyaltyVouchersResponse = VoucherListResponseDto;
|
|
928
|
+
|
|
929
|
+
// POST /loyalty/vouchers - Create a single voucher
|
|
930
|
+
|
|
931
|
+
export type PostLoyaltyVoucherBody = CreateVoucherDto;
|
|
932
|
+
|
|
933
|
+
export type PostLoyaltyVoucherResponse = VoucherResponseDto;
|
|
934
|
+
|
|
935
|
+
// GET /loyalty/vouchers/{id} - Get voucher by ID with campaign info and redemption count
|
|
936
|
+
|
|
937
|
+
export interface GetLoyaltyVoucherPath {
|
|
938
|
+
id: string;
|
|
939
|
+
}
|
|
940
|
+
|
|
941
|
+
export type GetLoyaltyVoucherResponse = VoucherResponseDto;
|
|
942
|
+
|
|
943
|
+
// PUT /loyalty/vouchers/{id} - Update a voucher
|
|
944
|
+
|
|
945
|
+
export interface PutLoyaltyVoucherPath {
|
|
946
|
+
id: string;
|
|
947
|
+
}
|
|
948
|
+
|
|
949
|
+
export type PutLoyaltyVoucherBody = UpdateVoucherDto;
|
|
950
|
+
|
|
951
|
+
export type PutLoyaltyVoucherResponse = VoucherResponseDto;
|
|
952
|
+
|
|
953
|
+
// DELETE /loyalty/vouchers/{id} - Soft-delete a voucher
|
|
954
|
+
|
|
955
|
+
export interface DeleteLoyaltyVoucherPath {
|
|
956
|
+
id: string;
|
|
957
|
+
}
|
|
958
|
+
|
|
959
|
+
export type DeleteLoyaltyVoucherResponse = {};
|
|
960
|
+
|
|
961
|
+
// POST /loyalty/vouchers/{id}/revoke - Revoke a voucher with a required reason
|
|
962
|
+
|
|
963
|
+
export interface PostLoyaltyVoucherRevokePath {
|
|
964
|
+
id: string;
|
|
965
|
+
}
|
|
966
|
+
|
|
967
|
+
export type PostLoyaltyVoucherRevokeBody = RevokeVoucherDto;
|
|
968
|
+
|
|
969
|
+
export type PostLoyaltyVoucherRevokeResponse = VoucherResponseDto;
|
|
970
|
+
|
|
971
|
+
// POST /loyalty/vouchers/batch - Batch generate voucher codes for a campaign
|
|
972
|
+
|
|
973
|
+
export type PostLoyaltyVouchersBatchBody = BatchVoucherDto;
|
|
974
|
+
|
|
975
|
+
export type PostLoyaltyVouchersBatchResponse = BatchVoucherResponseDto;
|
|
976
|
+
|
|
977
|
+
// GET /loyalty/vouchers/{id}/redemptions - Get redemption history for a voucher
|
|
978
|
+
|
|
979
|
+
export interface GetLoyaltyVoucherRedemptionsPath {
|
|
980
|
+
id: string;
|
|
981
|
+
}
|
|
982
|
+
|
|
983
|
+
export interface GetLoyaltyVoucherRedemptionsQuery {
|
|
984
|
+
// Max items to return
|
|
985
|
+
limit?: number;
|
|
986
|
+
// Opaque cursor from previous response
|
|
987
|
+
cursor?: string;
|
|
988
|
+
}
|
|
989
|
+
|
|
990
|
+
export type GetLoyaltyVoucherRedemptionsResponse = RedemptionListResponseDto;
|
|
991
|
+
|
|
992
|
+
// POST /loyalty/vouchers/validate - Validate one or more voucher codes
|
|
993
|
+
|
|
994
|
+
export type PostLoyaltyVouchersValidateBody = VoucherOperationDto;
|
|
995
|
+
|
|
996
|
+
export type PostLoyaltyVouchersValidateResponse = VoucherOperationResponseDto;
|
|
997
|
+
|
|
998
|
+
// POST /loyalty/vouchers/redeem - Redeem one or more voucher codes
|
|
999
|
+
|
|
1000
|
+
export type PostLoyaltyVouchersRedeemBody = VoucherOperationDto;
|
|
1001
|
+
|
|
1002
|
+
export type PostLoyaltyVouchersRedeemResponse = VoucherOperationResponseDto;
|
|
1003
|
+
|
|
1004
|
+
// GET /loyalty/segments - List segments with optional filters
|
|
1005
|
+
|
|
1006
|
+
export interface GetLoyaltySegmentsQuery {
|
|
1007
|
+
// Max items to return
|
|
1008
|
+
limit?: number;
|
|
1009
|
+
// Opaque cursor from previous response
|
|
1010
|
+
cursor?: string;
|
|
1011
|
+
realm?: 'boost' | 'thrive';
|
|
1012
|
+
type?: 'static_list' | 'attribute_rule' | 'sso';
|
|
1013
|
+
ownership?: 'system' | 'custom';
|
|
1014
|
+
// Case-insensitive partial name match
|
|
1015
|
+
name?: string;
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
export type GetLoyaltySegmentsResponse = SegmentListResponseDto;
|
|
1019
|
+
|
|
1020
|
+
// POST /loyalty/segments - Create a new segment
|
|
1021
|
+
|
|
1022
|
+
export type PostLoyaltySegmentBody = CreateSegmentDto;
|
|
1023
|
+
|
|
1024
|
+
export type PostLoyaltySegmentResponse = SegmentResponseDto;
|
|
1025
|
+
|
|
1026
|
+
// GET /loyalty/segments/attributes - List available attributes for rule-based segments
|
|
1027
|
+
|
|
1028
|
+
export type GetLoyaltySegmentAttributesResponse = SegmentAttributeResponseDto[];
|
|
1029
|
+
|
|
1030
|
+
// POST /loyalty/segments/preview-count - Preview how many customers match a segment rule
|
|
1031
|
+
|
|
1032
|
+
export type PostLoyaltySegmentPreviewCountBody = SegmentRuleDto;
|
|
1033
|
+
|
|
1034
|
+
export type PostLoyaltySegmentPreviewCountResponse = SegmentPreviewCountResponseDto;
|
|
1035
|
+
|
|
1036
|
+
// GET /loyalty/segments/{id} - Get segment by ID
|
|
1037
|
+
|
|
1038
|
+
export interface GetLoyaltySegmentPath {
|
|
1039
|
+
id: string;
|
|
1040
|
+
}
|
|
1041
|
+
|
|
1042
|
+
export type GetLoyaltySegmentResponse = SegmentResponseDto;
|
|
1043
|
+
|
|
1044
|
+
// PATCH /loyalty/segments/{id} - Update a segment
|
|
1045
|
+
|
|
1046
|
+
export interface PatchLoyaltySegmentPath {
|
|
1047
|
+
id: string;
|
|
1048
|
+
}
|
|
1049
|
+
|
|
1050
|
+
export type PatchLoyaltySegmentBody = UpdateSegmentDto;
|
|
1051
|
+
|
|
1052
|
+
export type PatchLoyaltySegmentResponse = SegmentResponseDto;
|
|
1053
|
+
|
|
1054
|
+
// DELETE /loyalty/segments/{id} - Soft-delete a segment
|
|
1055
|
+
|
|
1056
|
+
export interface DeleteLoyaltySegmentPath {
|
|
1057
|
+
id: string;
|
|
1058
|
+
}
|
|
1059
|
+
|
|
1060
|
+
export type DeleteLoyaltySegmentResponse = {};
|
|
1061
|
+
|
|
1062
|
+
// GET /loyalty/segments/{id}/members - List members of a static_list segment
|
|
1063
|
+
|
|
1064
|
+
export interface GetLoyaltySegmentMembersPath {
|
|
1065
|
+
id: string;
|
|
1066
|
+
}
|
|
1067
|
+
|
|
1068
|
+
export interface GetLoyaltySegmentMembersQuery {
|
|
1069
|
+
// Max items to return
|
|
1070
|
+
limit?: number;
|
|
1071
|
+
// Opaque cursor from previous response
|
|
1072
|
+
cursor?: string;
|
|
1073
|
+
}
|
|
1074
|
+
|
|
1075
|
+
export type GetLoyaltySegmentMembersResponse = SegmentMembersListResponseDto;
|
|
1076
|
+
|
|
1077
|
+
// POST /loyalty/segments/{id}/members - Add members to a segment
|
|
1078
|
+
|
|
1079
|
+
export interface PostLoyaltySegmentMembersPath {
|
|
1080
|
+
id: string;
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1083
|
+
export type PostLoyaltySegmentMembersBody = SegmentMembersDto;
|
|
1084
|
+
|
|
1085
|
+
export type PostLoyaltySegmentMembersResponse = AddSegmentMembersResponseDto;
|
|
1086
|
+
|
|
1087
|
+
// DELETE /loyalty/segments/{id}/members - Remove members from a segment
|
|
1088
|
+
|
|
1089
|
+
export interface DeleteLoyaltySegmentMembersPath {
|
|
1090
|
+
id: string;
|
|
1091
|
+
}
|
|
1092
|
+
|
|
1093
|
+
export type DeleteLoyaltySegmentMembersBody = SegmentMembersDto;
|
|
1094
|
+
|
|
1095
|
+
export type DeleteLoyaltySegmentMembersResponse = RemoveSegmentMembersResponseDto;
|
|
1096
|
+
|
|
1097
|
+
// POST /loyalty/redemptions/{id}/rollback - Roll back a redemption and restore the voucher
|
|
1098
|
+
|
|
1099
|
+
export interface PostLoyaltyRedemptionRollbackPath {
|
|
1100
|
+
id: string;
|
|
1101
|
+
}
|
|
1102
|
+
|
|
1103
|
+
export type PostLoyaltyRedemptionRollbackBody = RollbackRedemptionDto;
|
|
1104
|
+
|
|
1105
|
+
export type PostLoyaltyRedemptionRollbackResponse = RedemptionResponseDto;
|
|
1106
|
+
|
|
1107
|
+
// GET /loyalty/rewards - List rewards with filters and pagination
|
|
1108
|
+
|
|
1109
|
+
export interface GetLoyaltyRewardsQuery {
|
|
1110
|
+
// Max items to return
|
|
1111
|
+
limit?: number;
|
|
1112
|
+
// Opaque cursor from previous response
|
|
1113
|
+
cursor?: string;
|
|
1114
|
+
// Case-insensitive partial match across reward text fields
|
|
1115
|
+
query?: string;
|
|
1116
|
+
realm?: 'boost' | 'thrive';
|
|
1117
|
+
// Exact reward site scope match
|
|
1118
|
+
siteId?: string;
|
|
1119
|
+
// Exact milestone-linked campaign match
|
|
1120
|
+
campaignId?: string;
|
|
1121
|
+
status?: 'active' | 'paused' | 'archived';
|
|
1122
|
+
}
|
|
1123
|
+
|
|
1124
|
+
export type GetLoyaltyRewardsResponse = RewardListResponseDto;
|
|
1125
|
+
|
|
1126
|
+
// POST /loyalty/rewards - Create a reward with earning rules and milestones
|
|
1127
|
+
|
|
1128
|
+
export type PostLoyaltyRewardBody = CreateRewardDto;
|
|
1129
|
+
|
|
1130
|
+
export type PostLoyaltyRewardResponse = RewardDetailResponseDto;
|
|
1131
|
+
|
|
1132
|
+
// GET /loyalty/rewards/{id} - Get reward detail with earning rules and milestones
|
|
1133
|
+
|
|
1134
|
+
export interface GetLoyaltyRewardPath {
|
|
1135
|
+
id: string;
|
|
1136
|
+
}
|
|
1137
|
+
|
|
1138
|
+
export type GetLoyaltyRewardResponse = RewardDetailResponseDto;
|
|
1139
|
+
|
|
1140
|
+
// PUT /loyalty/rewards/{id} - Update a reward and replace its earning rules and milestones
|
|
1141
|
+
|
|
1142
|
+
export interface PutLoyaltyRewardPath {
|
|
1143
|
+
id: string;
|
|
1144
|
+
}
|
|
1145
|
+
|
|
1146
|
+
export type PutLoyaltyRewardBody = UpdateRewardDto;
|
|
1147
|
+
|
|
1148
|
+
export type PutLoyaltyRewardResponse = RewardDetailResponseDto;
|
|
1149
|
+
|
|
1150
|
+
// PATCH /loyalty/rewards/{id}/status - Transition reward status
|
|
1151
|
+
|
|
1152
|
+
export interface PatchLoyaltyRewardStatusPath {
|
|
1153
|
+
id: string;
|
|
1154
|
+
}
|
|
1155
|
+
|
|
1156
|
+
export type PatchLoyaltyRewardStatusBody = UpdateRewardStatusDto;
|
|
1157
|
+
|
|
1158
|
+
export type PatchLoyaltyRewardStatusResponse = RewardDetailResponseDto;
|
|
1159
|
+
|
|
1160
|
+
// GET /loyalty/rewards/{id}/cards - List enrolled customer cards for a reward
|
|
1161
|
+
|
|
1162
|
+
export interface GetLoyaltyRewardCardsPath {
|
|
1163
|
+
id: string;
|
|
1164
|
+
}
|
|
1165
|
+
|
|
1166
|
+
export interface GetLoyaltyRewardCardsQuery {
|
|
1167
|
+
// Max items to return
|
|
1168
|
+
limit?: number;
|
|
1169
|
+
// Opaque cursor from previous response
|
|
1170
|
+
cursor?: string;
|
|
1171
|
+
}
|
|
1172
|
+
|
|
1173
|
+
export type GetLoyaltyRewardCardsResponse = RewardCardListResponseDto;
|
|
1174
|
+
|
|
1175
|
+
// GET /loyalty/rewards/{id}/cards/{customerId} - Get card detail with transaction event history
|
|
1176
|
+
|
|
1177
|
+
export interface GetLoyaltyRewardCardPath {
|
|
1178
|
+
id: string;
|
|
1179
|
+
customerId: string;
|
|
1180
|
+
}
|
|
1181
|
+
|
|
1182
|
+
export type GetLoyaltyRewardCardResponse = RewardCardDetailResponseDto;
|
|
1183
|
+
|
|
1184
|
+
// POST /loyalty/rewards/cards/{cardId}/adjust - Manual point adjustment on a reward card
|
|
1185
|
+
|
|
1186
|
+
export interface PostLoyaltyRewardCardAdjustPath {
|
|
1187
|
+
cardId: string;
|
|
1188
|
+
}
|
|
1189
|
+
|
|
1190
|
+
export type PostLoyaltyRewardCardAdjustBody = AdjustPointsDto;
|
|
1191
|
+
|
|
1192
|
+
export type PostLoyaltyRewardCardAdjustResponse = RewardCardDetailResponseDto;
|
|
1193
|
+
|
|
1194
|
+
// POST /loyalty/rewards/orders/earn - Evaluate an order against active reward rules and award points idempotently
|
|
1195
|
+
|
|
1196
|
+
export type PostLoyaltyRewardOrderEarnBody = EarnOrderDto;
|
|
1197
|
+
|
|
1198
|
+
export type PostLoyaltyRewardOrderEarnResponse = EarnOrderResponseDto;
|