@voucherify/sdk 2.9.2 → 2.9.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ApiLimitsHandler.d.ts +13 -10
- package/dist/AsyncActions.d.ts +17 -15
- package/dist/Balance.d.ts +15 -12
- package/dist/Campaigns.d.ts +66 -58
- package/dist/Categories.d.ts +29 -26
- package/dist/ClientSide.d.ts +77 -53
- package/dist/Consents.d.ts +13 -10
- package/dist/Customers.d.ts +75 -72
- package/dist/Distributions.d.ts +29 -22
- package/dist/Events.d.ts +15 -10
- package/dist/Exports.d.ts +25 -22
- package/dist/Loyalties.d.ts +171 -159
- package/dist/MetadataSchemas.d.ts +17 -14
- package/dist/Orders.d.ts +32 -27
- package/dist/ProductCollections.d.ts +30 -26
- package/dist/Products.d.ts +66 -63
- package/dist/PromotionTiers.d.ts +43 -34
- package/dist/Promotions.d.ts +30 -18
- package/dist/PromotionsStacks.d.ts +34 -30
- package/dist/Qualifications.d.ts +24 -10
- package/dist/Redemptions.d.ts +53 -35
- package/dist/RequestController.d.ts +31 -29
- package/dist/Rewards.d.ts +46 -43
- package/dist/Segments.d.ts +25 -22
- package/dist/ValidationRules.d.ts +47 -43
- package/dist/Validations.d.ts +39 -17
- package/dist/VoucherifyClientSide.d.ts +112 -86
- package/dist/VoucherifyError.d.ts +23 -20
- package/dist/VoucherifyServerSide.d.ts +170 -131
- package/dist/Vouchers.d.ts +84 -78
- package/dist/helpers.d.ts +20 -18
- package/dist/index.d.ts +63 -25
- package/dist/types/ApplicableTo.d.ts +32 -30
- package/dist/types/AsyncActions.d.ts +23 -21
- package/dist/types/Balance.d.ts +18 -16
- package/dist/types/Campaigns.d.ts +124 -120
- package/dist/types/Categories.d.ts +40 -38
- package/dist/types/ClientSide.d.ts +145 -134
- package/dist/types/Consents.d.ts +34 -33
- package/dist/types/Customers.d.ts +363 -361
- package/dist/types/DiscountVoucher.d.ts +94 -93
- package/dist/types/Distributions.d.ts +148 -144
- package/dist/types/Events.d.ts +21 -17
- package/dist/types/Exports.d.ts +151 -149
- package/dist/types/Gift.d.ts +5 -3
- package/dist/types/Loyalties.d.ts +1061 -1057
- package/dist/types/MetadataSchemas.d.ts +34 -33
- package/dist/types/Orders.d.ts +199 -195
- package/dist/types/ProductCollections.d.ts +99 -96
- package/dist/types/Products.d.ts +108 -106
- package/dist/types/PromotionTiers.d.ts +131 -127
- package/dist/types/Promotions.d.ts +113 -108
- package/dist/types/PromotionsStacks.d.ts +74 -71
- package/dist/types/Qualifications.d.ts +92 -86
- package/dist/types/Redemptions.d.ts +215 -205
- package/dist/types/Rewards.d.ts +220 -219
- package/dist/types/Segments.d.ts +34 -32
- package/dist/types/Stackable.d.ts +106 -101
- package/dist/types/UtilityTypes.d.ts +5 -3
- package/dist/types/ValidateSession.d.ts +19 -17
- package/dist/types/ValidationError.d.ts +9 -7
- package/dist/types/ValidationRules.d.ts +96 -93
- package/dist/types/Validations.d.ts +109 -98
- package/dist/types/Vouchers.d.ts +452 -364
- package/dist/types/index.d.ts +27 -25
- package/dist/voucherifysdk.cjs +2023 -0
- package/dist/voucherifysdk.cjs.map +1 -0
- package/dist/voucherifysdk.esm.js +981 -1256
- package/dist/voucherifysdk.esm.js.map +1 -1
- package/package.json +13 -9
- package/CHANGELOG.md +0 -663
- package/dist/voucherifysdk.umd.development.js +0 -2270
- package/dist/voucherifysdk.umd.development.js.map +0 -1
- package/dist/voucherifysdk.umd.production.min.js +0 -2
- package/dist/voucherifysdk.umd.production.min.js.map +0 -1
package/dist/types/Vouchers.d.ts
CHANGED
|
@@ -1,364 +1,452 @@
|
|
|
1
|
-
import { OrdersGetResponse } from './Orders';
|
|
2
|
-
import { SimpleCustomer } from './Customers';
|
|
3
|
-
import { DiscountUnit, DiscountAmount, DiscountPercent, DiscountFixed } from './DiscountVoucher';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
};
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
};
|
|
357
|
-
};
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
}
|
|
1
|
+
import { OrdersGetResponse } from './Orders.js';
|
|
2
|
+
import { SimpleCustomer } from './Customers.js';
|
|
3
|
+
import { DiscountUnit, DiscountAmount, DiscountPercent, DiscountFixed } from './DiscountVoucher.js';
|
|
4
|
+
|
|
5
|
+
interface LoyaltyCardTransaction {
|
|
6
|
+
id: string;
|
|
7
|
+
source_id: string | null;
|
|
8
|
+
voucher_id: string;
|
|
9
|
+
campaign_id: string;
|
|
10
|
+
source: string | null;
|
|
11
|
+
reason: string | null;
|
|
12
|
+
type: LoyaltyCardTransactionsType;
|
|
13
|
+
details: {
|
|
14
|
+
balance: {
|
|
15
|
+
type: 'loyalty_card';
|
|
16
|
+
total: number;
|
|
17
|
+
object: 'balance';
|
|
18
|
+
operation_type: 'MANUAL' | 'AUTOMATIC';
|
|
19
|
+
points: number;
|
|
20
|
+
balance: number;
|
|
21
|
+
related_object: {
|
|
22
|
+
id: string;
|
|
23
|
+
type: 'voucher';
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
order?: {
|
|
27
|
+
id: string;
|
|
28
|
+
source_id: string;
|
|
29
|
+
};
|
|
30
|
+
event?: {
|
|
31
|
+
id: string;
|
|
32
|
+
type: string;
|
|
33
|
+
};
|
|
34
|
+
earning_rule?: {
|
|
35
|
+
id: string;
|
|
36
|
+
source: {
|
|
37
|
+
banner: string;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
segment?: {
|
|
41
|
+
id: string;
|
|
42
|
+
name: string;
|
|
43
|
+
};
|
|
44
|
+
loyalty_tier?: {
|
|
45
|
+
id: string;
|
|
46
|
+
name: string;
|
|
47
|
+
};
|
|
48
|
+
redemption?: {
|
|
49
|
+
id: string;
|
|
50
|
+
};
|
|
51
|
+
rollback?: {
|
|
52
|
+
id: string;
|
|
53
|
+
};
|
|
54
|
+
reward?: {
|
|
55
|
+
id: string;
|
|
56
|
+
name: string;
|
|
57
|
+
};
|
|
58
|
+
custom_event?: {
|
|
59
|
+
id: string;
|
|
60
|
+
type: string;
|
|
61
|
+
};
|
|
62
|
+
event_schema?: {
|
|
63
|
+
id: string;
|
|
64
|
+
name: string;
|
|
65
|
+
};
|
|
66
|
+
source_voucher?: SimpleLoyaltyVoucher;
|
|
67
|
+
destination_voucher?: SimpleLoyaltyVoucher;
|
|
68
|
+
};
|
|
69
|
+
related_transaction_id: string | null;
|
|
70
|
+
created_at: string;
|
|
71
|
+
}
|
|
72
|
+
type LoyaltyCardTransactionsType = 'POINTS_ACCRUAL' | 'POINTS_CANCELLATION' | 'POINTS_REDEMPTION' | 'POINTS_REFUND' | 'POINTS_ADDITION' | 'POINTS_REMOVAL' | 'POINTS_EXPIRATION' | 'POINTS_TRANSFER_IN' | 'POINTS_TRANSFER_OUT';
|
|
73
|
+
interface SimpleLoyaltyVoucher {
|
|
74
|
+
id: string;
|
|
75
|
+
code: string;
|
|
76
|
+
loyalty_card: {
|
|
77
|
+
points: number;
|
|
78
|
+
balance: number;
|
|
79
|
+
next_expiration_date?: string;
|
|
80
|
+
next_expiration_points?: string;
|
|
81
|
+
};
|
|
82
|
+
type: 'LOYALTY_CARD';
|
|
83
|
+
campaign: string;
|
|
84
|
+
campaign_id: string;
|
|
85
|
+
is_referral_code?: boolean;
|
|
86
|
+
holder_id?: string;
|
|
87
|
+
referrer_id?: string;
|
|
88
|
+
created_at?: string;
|
|
89
|
+
object: 'voucher';
|
|
90
|
+
}
|
|
91
|
+
type VoucherType = 'GIFT_VOUCHER' | 'DISCOUNT_VOUCHER' | 'LOYALTY_CARD' | 'LUCKY_DRAW';
|
|
92
|
+
interface SimpleVoucher {
|
|
93
|
+
code_config?: {
|
|
94
|
+
length?: number;
|
|
95
|
+
charset?: string;
|
|
96
|
+
pattern?: string;
|
|
97
|
+
prefix?: string;
|
|
98
|
+
suffix?: string;
|
|
99
|
+
};
|
|
100
|
+
type: VoucherType;
|
|
101
|
+
is_referral_code?: boolean;
|
|
102
|
+
discount?: DiscountUnit | DiscountAmount | DiscountPercent | DiscountFixed;
|
|
103
|
+
loyalty_card?: {
|
|
104
|
+
points: number;
|
|
105
|
+
balance: number;
|
|
106
|
+
};
|
|
107
|
+
redemption?: {
|
|
108
|
+
quantity: number;
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
interface VouchersResponse {
|
|
112
|
+
id: string;
|
|
113
|
+
code: string;
|
|
114
|
+
campaign?: string;
|
|
115
|
+
category?: string;
|
|
116
|
+
type?: 'DISCOUNT_VOUCHER' | 'GIFT_VOUCHER';
|
|
117
|
+
discount?: DiscountAmount | DiscountPercent | DiscountUnit | DiscountFixed;
|
|
118
|
+
gift?: {
|
|
119
|
+
amount: number;
|
|
120
|
+
balance: number;
|
|
121
|
+
};
|
|
122
|
+
loyalty_card?: {
|
|
123
|
+
points: number;
|
|
124
|
+
balance: number;
|
|
125
|
+
next_expiration_date?: string;
|
|
126
|
+
next_expiration_points?: number;
|
|
127
|
+
};
|
|
128
|
+
start_date?: string;
|
|
129
|
+
expiration_date?: string;
|
|
130
|
+
validity_timeframe?: {
|
|
131
|
+
interval: string;
|
|
132
|
+
duration: string;
|
|
133
|
+
};
|
|
134
|
+
validity_day_of_week?: number[];
|
|
135
|
+
publish?: {
|
|
136
|
+
object: 'list';
|
|
137
|
+
count: number;
|
|
138
|
+
data_ref: 'entries';
|
|
139
|
+
entries: string[];
|
|
140
|
+
total: number;
|
|
141
|
+
url: string;
|
|
142
|
+
};
|
|
143
|
+
redemption?: {
|
|
144
|
+
object: 'list';
|
|
145
|
+
quantity?: number;
|
|
146
|
+
redeemed_quantity: number;
|
|
147
|
+
data_ref: 'redemption_entries';
|
|
148
|
+
redemption_entries: string[];
|
|
149
|
+
total: number;
|
|
150
|
+
url: string;
|
|
151
|
+
};
|
|
152
|
+
active: boolean;
|
|
153
|
+
additional_info?: string;
|
|
154
|
+
metadata?: Record<string, any>;
|
|
155
|
+
assets?: {
|
|
156
|
+
qr?: {
|
|
157
|
+
id: string;
|
|
158
|
+
url: string;
|
|
159
|
+
};
|
|
160
|
+
barcode?: {
|
|
161
|
+
id: string;
|
|
162
|
+
url: string;
|
|
163
|
+
};
|
|
164
|
+
};
|
|
165
|
+
is_referral_code: boolean;
|
|
166
|
+
referrer_id?: string;
|
|
167
|
+
holder_id?: string;
|
|
168
|
+
updated_at?: string;
|
|
169
|
+
created_at: string;
|
|
170
|
+
object: 'voucher';
|
|
171
|
+
validation_rules_assignments: {
|
|
172
|
+
object: 'list';
|
|
173
|
+
total: number;
|
|
174
|
+
data_ref: 'data';
|
|
175
|
+
data?: {
|
|
176
|
+
id: string;
|
|
177
|
+
rule_id?: string;
|
|
178
|
+
related_object_id?: string;
|
|
179
|
+
related_object_type?: string;
|
|
180
|
+
created_at: string;
|
|
181
|
+
object: 'validation_rules_assignment';
|
|
182
|
+
}[];
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
interface VouchersQualificationExamineBody {
|
|
186
|
+
customer?: Omit<SimpleCustomer, 'object'> & {
|
|
187
|
+
description: string;
|
|
188
|
+
};
|
|
189
|
+
order?: Pick<OrdersGetResponse, 'id' | 'source_id' | 'amount' | 'items' | 'metadata'>;
|
|
190
|
+
reward?: {
|
|
191
|
+
id: string;
|
|
192
|
+
assignment_id?: string;
|
|
193
|
+
};
|
|
194
|
+
metadata?: Record<string, any>;
|
|
195
|
+
}
|
|
196
|
+
interface VouchersQualificationExamineParams {
|
|
197
|
+
audienceRulesOnly?: boolean;
|
|
198
|
+
order?: 'created_at' | '-created_at' | 'updated_at' | '-updated_at';
|
|
199
|
+
limit?: number;
|
|
200
|
+
}
|
|
201
|
+
interface VouchersQualificationExamineResponse {
|
|
202
|
+
object: 'list';
|
|
203
|
+
total: number;
|
|
204
|
+
data_ref: 'data';
|
|
205
|
+
data?: VouchersResponse[];
|
|
206
|
+
}
|
|
207
|
+
interface VouchersCreateParameters {
|
|
208
|
+
active?: boolean;
|
|
209
|
+
code?: string;
|
|
210
|
+
code_config?: {
|
|
211
|
+
length?: number;
|
|
212
|
+
charset?: string;
|
|
213
|
+
pattern?: string;
|
|
214
|
+
prefix?: string;
|
|
215
|
+
suffix?: string;
|
|
216
|
+
};
|
|
217
|
+
redemption?: {
|
|
218
|
+
quantity: number;
|
|
219
|
+
};
|
|
220
|
+
validation_rules?: string[];
|
|
221
|
+
}
|
|
222
|
+
type VouchersCreate = VouchersCreateParameters & Pick<VouchersResponse, 'type' | 'discount' | 'gift' | 'category' | 'additional_info' | 'start_date' | 'expiration_date' | 'metadata'>;
|
|
223
|
+
type VouchersCreateResponse = Omit<VouchersResponse, 'validation_rules_assignments'>;
|
|
224
|
+
type VouchersGetResponse = VouchersResponse;
|
|
225
|
+
interface VouchersUpdate {
|
|
226
|
+
code: string;
|
|
227
|
+
category?: string;
|
|
228
|
+
start_date?: string;
|
|
229
|
+
expiration_date?: string;
|
|
230
|
+
active?: boolean;
|
|
231
|
+
additional_info?: string;
|
|
232
|
+
metadata?: Record<string, any>;
|
|
233
|
+
gift?: {
|
|
234
|
+
amount: number;
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
type VouchersUpdateResponse = VouchersResponse;
|
|
238
|
+
interface VouchersDeleteParams {
|
|
239
|
+
force?: boolean;
|
|
240
|
+
}
|
|
241
|
+
interface VouchersListParams {
|
|
242
|
+
limit?: number;
|
|
243
|
+
page?: number;
|
|
244
|
+
category?: string;
|
|
245
|
+
campaign?: string;
|
|
246
|
+
customer?: string;
|
|
247
|
+
created_at?: {
|
|
248
|
+
after?: string;
|
|
249
|
+
before?: string;
|
|
250
|
+
};
|
|
251
|
+
updated_at?: {
|
|
252
|
+
after?: string;
|
|
253
|
+
before?: string;
|
|
254
|
+
};
|
|
255
|
+
order?: '-created_at' | 'created_at' | '-updated_at' | 'updated_at' | '-type' | 'type' | '-code' | 'code' | '-campaign' | 'campaign' | '-category' | 'category';
|
|
256
|
+
filters?: {
|
|
257
|
+
junction?: string;
|
|
258
|
+
[filter_condition: string]: any;
|
|
259
|
+
};
|
|
260
|
+
}
|
|
261
|
+
interface VouchersListResponse {
|
|
262
|
+
object: 'list';
|
|
263
|
+
total: number;
|
|
264
|
+
data_ref: 'vouchers';
|
|
265
|
+
vouchers: VouchersResponse[];
|
|
266
|
+
}
|
|
267
|
+
type VouchersEnableResponse = VouchersResponse;
|
|
268
|
+
type VouchersDisableResponse = VouchersResponse;
|
|
269
|
+
interface VouchersImport {
|
|
270
|
+
code: string;
|
|
271
|
+
category?: string;
|
|
272
|
+
type?: 'DISCOUNT_VOUCHER' | 'GIFT_VOUCHER';
|
|
273
|
+
discount: DiscountAmount | DiscountPercent | DiscountUnit | DiscountFixed;
|
|
274
|
+
additional_info?: string;
|
|
275
|
+
start_date?: string;
|
|
276
|
+
expiration_date?: string;
|
|
277
|
+
active?: boolean;
|
|
278
|
+
metadata?: Record<string, any>;
|
|
279
|
+
redemption?: {
|
|
280
|
+
quantity: number;
|
|
281
|
+
};
|
|
282
|
+
code_config?: {
|
|
283
|
+
length?: number;
|
|
284
|
+
charset?: string;
|
|
285
|
+
pattern?: string;
|
|
286
|
+
prefix?: string;
|
|
287
|
+
suffix?: string;
|
|
288
|
+
};
|
|
289
|
+
}
|
|
290
|
+
interface VouchersBulkUpdateObject {
|
|
291
|
+
code: string;
|
|
292
|
+
metadata: Record<string, any>;
|
|
293
|
+
}
|
|
294
|
+
type VouchersBulkUpdate = VouchersBulkUpdateObject[];
|
|
295
|
+
interface VouchersBulkUpdateMetadata {
|
|
296
|
+
codes: string[];
|
|
297
|
+
metadata: Record<string, any>;
|
|
298
|
+
}
|
|
299
|
+
type VouchersImportResponse = {
|
|
300
|
+
async_action_id: string;
|
|
301
|
+
};
|
|
302
|
+
type VouchersBulkUpdateMetadataResponse = {
|
|
303
|
+
async_action_id: string;
|
|
304
|
+
};
|
|
305
|
+
type VouchersBulkUpdateResponse = {
|
|
306
|
+
async_action_id: string;
|
|
307
|
+
};
|
|
308
|
+
type GiftCardTransaction = GiftCardTransactionBase & GiftCardTransactionDetails;
|
|
309
|
+
interface GiftCardTransactionBase {
|
|
310
|
+
id: string;
|
|
311
|
+
source_id: string | null;
|
|
312
|
+
voucher_id: string;
|
|
313
|
+
campaign_id: string | null;
|
|
314
|
+
related_transaction_id: string | null;
|
|
315
|
+
reason: string | null;
|
|
316
|
+
created_at: string;
|
|
317
|
+
}
|
|
318
|
+
type GiftCardTransactionDetails = GiftCardTransactionRedemptionDetails | GiftCardTransactionRefundDetails | GiftCardTransactionAdditionDetails | GiftCardTransactionRemovalDetails;
|
|
319
|
+
interface GiftCardTransactionRedemptionDetails {
|
|
320
|
+
source: null;
|
|
321
|
+
type: 'CREDITS_REDEMPTION';
|
|
322
|
+
details: {
|
|
323
|
+
balance: {
|
|
324
|
+
type: 'gift_voucher';
|
|
325
|
+
total: number;
|
|
326
|
+
amount: number;
|
|
327
|
+
object: 'balance';
|
|
328
|
+
balance: number;
|
|
329
|
+
related_object: {
|
|
330
|
+
id: string;
|
|
331
|
+
type: 'voucher';
|
|
332
|
+
};
|
|
333
|
+
};
|
|
334
|
+
order: {
|
|
335
|
+
id: string;
|
|
336
|
+
source_id: string | null;
|
|
337
|
+
};
|
|
338
|
+
redemption: {
|
|
339
|
+
id: string;
|
|
340
|
+
};
|
|
341
|
+
};
|
|
342
|
+
}
|
|
343
|
+
interface GiftCardTransactionRefundDetails {
|
|
344
|
+
source: null;
|
|
345
|
+
type: 'CREDITS_REFUND';
|
|
346
|
+
details: {
|
|
347
|
+
balance: {
|
|
348
|
+
type: 'gift_voucher';
|
|
349
|
+
total: number;
|
|
350
|
+
amount: number;
|
|
351
|
+
object: 'balance';
|
|
352
|
+
balance: number;
|
|
353
|
+
related_object: {
|
|
354
|
+
id: string;
|
|
355
|
+
type: 'voucher';
|
|
356
|
+
};
|
|
357
|
+
};
|
|
358
|
+
order: {
|
|
359
|
+
id: string;
|
|
360
|
+
source_id: string | null;
|
|
361
|
+
};
|
|
362
|
+
redemption: {
|
|
363
|
+
id: string;
|
|
364
|
+
};
|
|
365
|
+
rollback: {
|
|
366
|
+
id: string;
|
|
367
|
+
};
|
|
368
|
+
};
|
|
369
|
+
}
|
|
370
|
+
interface GiftCardTransactionAdditionDetails {
|
|
371
|
+
source: 'voucherify-web-ui' | 'API';
|
|
372
|
+
type: 'CREDITS_ADDITION';
|
|
373
|
+
details: {
|
|
374
|
+
balance: {
|
|
375
|
+
type: 'gift_voucher';
|
|
376
|
+
total: number;
|
|
377
|
+
amount: number;
|
|
378
|
+
object: 'balance';
|
|
379
|
+
balance: number;
|
|
380
|
+
operation_type: 'MANUAL' | 'AUTOMATIC';
|
|
381
|
+
related_object: {
|
|
382
|
+
id: string;
|
|
383
|
+
type: 'voucher';
|
|
384
|
+
};
|
|
385
|
+
};
|
|
386
|
+
};
|
|
387
|
+
}
|
|
388
|
+
interface GiftCardTransactionRemovalDetails {
|
|
389
|
+
source: 'voucherify-web-ui' | 'API';
|
|
390
|
+
type: 'CREDITS_REMOVAL';
|
|
391
|
+
details: {
|
|
392
|
+
balance: {
|
|
393
|
+
type: 'gift_voucher';
|
|
394
|
+
total: number;
|
|
395
|
+
amount: number;
|
|
396
|
+
object: 'balance';
|
|
397
|
+
balance: number;
|
|
398
|
+
operation_type: 'MANUAL' | 'AUTOMATIC';
|
|
399
|
+
related_object: {
|
|
400
|
+
id: string;
|
|
401
|
+
type: 'voucher';
|
|
402
|
+
};
|
|
403
|
+
};
|
|
404
|
+
};
|
|
405
|
+
}
|
|
406
|
+
type VoucherTransaction = GiftCardTransaction | LoyaltyCardTransaction;
|
|
407
|
+
type VoucherTransactionsExportFields = 'id' | 'campaign_id' | 'voucher_id' | 'type' | 'source_id' | 'reason' | 'source' | 'balance' | 'amount' | 'related_transaction_id' | 'created_at' | 'details';
|
|
408
|
+
interface VouchersListTransactionsRequestQuery {
|
|
409
|
+
limit?: number;
|
|
410
|
+
starting_after_id?: string;
|
|
411
|
+
order?: 'id' | '-id';
|
|
412
|
+
/**
|
|
413
|
+
* @deprecated Use starting_after_id
|
|
414
|
+
*/
|
|
415
|
+
page?: number;
|
|
416
|
+
}
|
|
417
|
+
interface VouchersListTransactionsResponseBody {
|
|
418
|
+
object: 'list';
|
|
419
|
+
data_ref: 'data';
|
|
420
|
+
data: VoucherTransaction[];
|
|
421
|
+
has_more: boolean;
|
|
422
|
+
more_starting_after?: string;
|
|
423
|
+
}
|
|
424
|
+
interface VouchersExportTransactionsRequestBody {
|
|
425
|
+
parameters?: {
|
|
426
|
+
order?: '-created_at' | 'created_at';
|
|
427
|
+
fields?: VoucherTransactionsExportFields[];
|
|
428
|
+
};
|
|
429
|
+
}
|
|
430
|
+
interface VouchersExportTransactionsResponseBody {
|
|
431
|
+
id: string;
|
|
432
|
+
status: 'SCHEDULED';
|
|
433
|
+
channel: string;
|
|
434
|
+
parameters: {
|
|
435
|
+
order?: string;
|
|
436
|
+
fields?: VoucherTransactionsExportFields[];
|
|
437
|
+
filters: {
|
|
438
|
+
voucher_id: {
|
|
439
|
+
conditions: {
|
|
440
|
+
$in: [string];
|
|
441
|
+
};
|
|
442
|
+
};
|
|
443
|
+
};
|
|
444
|
+
};
|
|
445
|
+
result: null;
|
|
446
|
+
user_id: string | null;
|
|
447
|
+
exported_object: 'voucher_transactions';
|
|
448
|
+
object: 'export';
|
|
449
|
+
created_at: string;
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
export type { GiftCardTransaction, GiftCardTransactionAdditionDetails, GiftCardTransactionBase, GiftCardTransactionDetails, GiftCardTransactionRedemptionDetails, GiftCardTransactionRefundDetails, GiftCardTransactionRemovalDetails, SimpleVoucher, VoucherTransaction, VoucherTransactionsExportFields, VoucherType, VouchersBulkUpdate, VouchersBulkUpdateMetadata, VouchersBulkUpdateMetadataResponse, VouchersBulkUpdateObject, VouchersBulkUpdateResponse, VouchersCreate, VouchersCreateParameters, VouchersCreateResponse, VouchersDeleteParams, VouchersDisableResponse, VouchersEnableResponse, VouchersExportTransactionsRequestBody, VouchersExportTransactionsResponseBody, VouchersGetResponse, VouchersImport, VouchersImportResponse, VouchersListParams, VouchersListResponse, VouchersListTransactionsRequestQuery, VouchersListTransactionsResponseBody, VouchersQualificationExamineBody, VouchersQualificationExamineParams, VouchersQualificationExamineResponse, VouchersResponse, VouchersUpdate, VouchersUpdateResponse };
|