@voucherify/sdk 2.9.3 → 2.9.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/dist/ApiLimitsHandler.d.ts +13 -0
  2. package/dist/AsyncActions.d.ts +17 -0
  3. package/dist/Balance.d.ts +15 -0
  4. package/dist/Campaigns.d.ts +66 -0
  5. package/dist/Categories.d.ts +29 -0
  6. package/dist/ClientSide.d.ts +77 -0
  7. package/dist/Consents.d.ts +13 -0
  8. package/dist/Customers.d.ts +75 -0
  9. package/dist/Distributions.d.ts +29 -0
  10. package/dist/Events.d.ts +15 -0
  11. package/dist/Exports.d.ts +25 -0
  12. package/dist/Loyalties.d.ts +171 -0
  13. package/dist/MetadataSchemas.d.ts +17 -0
  14. package/dist/Orders.d.ts +32 -0
  15. package/dist/ProductCollections.d.ts +30 -0
  16. package/dist/Products.d.ts +66 -0
  17. package/dist/PromotionTiers.d.ts +43 -0
  18. package/dist/Promotions.d.ts +30 -0
  19. package/dist/PromotionsStacks.d.ts +34 -0
  20. package/dist/Qualifications.d.ts +24 -0
  21. package/dist/Redemptions.d.ts +53 -0
  22. package/dist/RequestController.d.ts +31 -0
  23. package/dist/Rewards.d.ts +46 -0
  24. package/dist/Segments.d.ts +25 -0
  25. package/dist/ValidationRules.d.ts +47 -0
  26. package/dist/Validations.d.ts +39 -0
  27. package/dist/VoucherifyClientSide.d.ts +112 -0
  28. package/dist/VoucherifyError.d.ts +23 -0
  29. package/dist/VoucherifyServerSide.d.ts +170 -0
  30. package/dist/Vouchers.d.ts +84 -0
  31. package/dist/helpers.d.ts +20 -0
  32. package/dist/index.d.ts +63 -0
  33. package/dist/types/ApplicableTo.d.ts +32 -0
  34. package/dist/types/AsyncActions.d.ts +23 -0
  35. package/dist/types/Balance.d.ts +18 -0
  36. package/dist/types/Campaigns.d.ts +124 -0
  37. package/dist/types/Categories.d.ts +40 -0
  38. package/dist/types/ClientSide.d.ts +145 -0
  39. package/dist/types/Consents.d.ts +34 -0
  40. package/dist/types/Customers.d.ts +363 -0
  41. package/dist/types/DiscountVoucher.d.ts +94 -0
  42. package/dist/types/Distributions.d.ts +148 -0
  43. package/dist/types/Events.d.ts +21 -0
  44. package/dist/types/Exports.d.ts +151 -0
  45. package/dist/types/Gift.d.ts +5 -0
  46. package/dist/types/Loyalties.d.ts +1061 -0
  47. package/dist/types/MetadataSchemas.d.ts +34 -0
  48. package/dist/types/Orders.d.ts +199 -0
  49. package/dist/types/ProductCollections.d.ts +99 -0
  50. package/dist/types/Products.d.ts +108 -0
  51. package/dist/types/PromotionTiers.d.ts +131 -0
  52. package/dist/types/Promotions.d.ts +113 -0
  53. package/dist/types/PromotionsStacks.d.ts +74 -0
  54. package/dist/types/Qualifications.d.ts +92 -0
  55. package/dist/types/Redemptions.d.ts +215 -0
  56. package/dist/types/Rewards.d.ts +220 -0
  57. package/dist/types/Segments.d.ts +34 -0
  58. package/dist/types/Stackable.d.ts +106 -0
  59. package/dist/types/UtilityTypes.d.ts +5 -0
  60. package/dist/types/ValidateSession.d.ts +19 -0
  61. package/dist/types/ValidationError.d.ts +9 -0
  62. package/dist/types/ValidationRules.d.ts +96 -0
  63. package/dist/types/Validations.d.ts +109 -0
  64. package/dist/types/Vouchers.d.ts +452 -0
  65. package/dist/types/index.d.ts +27 -0
  66. package/dist/voucherifysdk.cjs +2022 -1
  67. package/dist/voucherifysdk.cjs.map +1 -1
  68. package/dist/voucherifysdk.esm.js +1985 -1
  69. package/dist/voucherifysdk.esm.js.map +1 -1
  70. package/package.json +2 -2
  71. package/dist/voucherifysdk.d.mts +0 -5252
  72. package/dist/voucherifysdk.d.ts +0 -5252
@@ -0,0 +1,145 @@
1
+ import { CustomerRequest, CustomersCreateBody, CustomersUpdateConsentsBody, CustomersCreateResponse } from './Customers.js';
2
+ import { VouchersResponse, VouchersListParams } from './Vouchers.js';
3
+ import { DiscountUnit, DiscountAmount, DiscountPercent, DiscountFixed } from './DiscountVoucher.js';
4
+ import { OrdersItem, OrdersCreateResponse } from './Orders.js';
5
+ import { ConsentsListResponse } from './Consents.js';
6
+ import { DistributionsPublicationsCreateResponse } from './Distributions.js';
7
+ import { SimplePromotionTier } from './PromotionTiers.js';
8
+ import { ValidationSessionReleaseParams } from './ValidateSession.js';
9
+ import { ApplicableToResultList } from './ApplicableTo.js';
10
+ import { ValidationsValidateStackableParams, ValidationValidateStackableResponse } from './Validations.js';
11
+ import { RedemptionsRedeemStackableParams, RedemptionsRedeemStackableResponse } from './Redemptions.js';
12
+ import './ValidationRules.js';
13
+ import './Stackable.js';
14
+ import './Rewards.js';
15
+ import './Gift.js';
16
+ import './Products.js';
17
+ import './Loyalties.js';
18
+ import './Categories.js';
19
+ import './ValidationError.js';
20
+ import './Promotions.js';
21
+
22
+ type ClientSideItem = Pick<OrdersItem, 'source_id' | 'sku_id' | 'product_id' | 'sku' | 'quantity' | 'related_object' | 'amount'>;
23
+ type ClientSideCustomersUpdateConsentsBody = CustomersUpdateConsentsBody;
24
+ type ClientSideCustomersCreateParams = CustomersCreateBody;
25
+ type ClientSideCustomersCreateResponse = CustomersCreateResponse;
26
+ interface ClientSideValidateParams {
27
+ code?: string;
28
+ tracking_id?: string;
29
+ amount?: number;
30
+ items?: ClientSideItem[];
31
+ orderMetadata?: Record<string, any>;
32
+ customer?: Pick<CustomerRequest, 'source_id' | 'metadata'>;
33
+ reward?: {
34
+ id: string;
35
+ };
36
+ metadata?: Record<string, any>;
37
+ session_type?: 'LOCK';
38
+ session_key?: string;
39
+ session_ttl?: number;
40
+ session_ttl_unit?: 'MILLISECONDS' | 'SECONDS' | 'MINUTES' | 'HOURS' | 'DAYS';
41
+ }
42
+ type ClientSideListVouchersParams = VouchersListParams;
43
+ type ClientSideVoucherListing = Pick<VouchersResponse, 'active' | 'code' | 'metadata' | 'assets' | 'object' | 'expiration_date' | 'start_date' | 'created_at'>;
44
+ interface ClientSideListVouchersResponse {
45
+ object: 'list';
46
+ total: number;
47
+ data_ref: 'vouchers';
48
+ vouchers: ClientSideVoucherListing[];
49
+ }
50
+ interface ClientSideValidateResponse {
51
+ code?: string;
52
+ valid: boolean;
53
+ discount?: DiscountUnit | DiscountAmount | DiscountPercent | DiscountFixed;
54
+ applicable_to?: ApplicableToResultList;
55
+ order?: {
56
+ amount: number;
57
+ discount_amount: number;
58
+ total_discount_amount: number;
59
+ total_amount: number;
60
+ items?: ClientSideItem[];
61
+ };
62
+ tracking_id?: string;
63
+ campaign_id?: string;
64
+ loyalty?: {
65
+ points_cost: number;
66
+ };
67
+ gift?: {
68
+ amount: number;
69
+ balance: number;
70
+ };
71
+ promotions?: SimplePromotionTier[];
72
+ }
73
+ interface ClientSideRedeemPayload {
74
+ tracking_id?: string;
75
+ customer?: CustomerRequest;
76
+ order?: ClientSideRedeemOrder;
77
+ metadata?: Record<string, any>;
78
+ reward?: {
79
+ id: string;
80
+ };
81
+ session?: ValidationSessionReleaseParams;
82
+ }
83
+ interface ClientSideRedeemResponse {
84
+ id: string;
85
+ object: 'redemption';
86
+ date?: string;
87
+ customer_id?: string;
88
+ tracking_id?: string;
89
+ order?: OrdersCreateResponse;
90
+ metadata?: Record<string, any>;
91
+ result: 'SUCCESS' | 'FAILURE';
92
+ voucher?: VouchersResponse;
93
+ }
94
+ interface ClientSidePublishPayload {
95
+ source_id?: string;
96
+ channel?: 'Voucherify.js' | string;
97
+ customer?: CustomerRequest;
98
+ voucher?: string;
99
+ metadata?: Record<string, any>;
100
+ }
101
+ type ClientSidePublishPreparedPayload = ClientSidePublishPayload;
102
+ interface ClientSidePublishQueryParams {
103
+ join_once?: boolean;
104
+ campaign?: string;
105
+ }
106
+ interface ClientSidePublishCampaign {
107
+ name: string;
108
+ count?: number;
109
+ }
110
+ type ClientSidePublishResponse = DistributionsPublicationsCreateResponse & {
111
+ vouchers_id?: string[];
112
+ };
113
+ interface ClientSideTrackLoyalty {
114
+ code?: string;
115
+ }
116
+ interface ClientSideTrackReferral {
117
+ code?: string;
118
+ }
119
+ interface ClientSideTrackPayload {
120
+ event: string;
121
+ metadata?: Record<string, any>;
122
+ customer: CustomerRequest;
123
+ loyalty?: ClientSideTrackLoyalty;
124
+ referral?: ClientSideTrackReferral;
125
+ }
126
+ interface ClientSideTrackResponse {
127
+ object: 'event';
128
+ type: string;
129
+ }
130
+ type ClientSideRedeemOrder = Partial<Pick<OrdersCreateResponse, 'id' | 'source_id' | 'metadata' | 'amount'>> & {
131
+ items?: ClientSideItem[];
132
+ };
133
+ interface ClientSideRedeemWidgetPayload {
134
+ order?: {
135
+ amount?: number;
136
+ };
137
+ }
138
+ type ClientSideTrackCustomer = CustomerRequest;
139
+ type ClientSideConsentsListResponse = ConsentsListResponse;
140
+ type ClientSideValidationsValidateStackableParams = ValidationsValidateStackableParams;
141
+ type ClientSideValidationValidateStackableResponse = ValidationValidateStackableResponse;
142
+ type ClientSideRedemptionsRedeemStackableParams = RedemptionsRedeemStackableParams;
143
+ type ClientSideRedemptionsRedeemStackableResponse = RedemptionsRedeemStackableResponse;
144
+
145
+ export type { ClientSideConsentsListResponse, ClientSideCustomersCreateParams, ClientSideCustomersCreateResponse, ClientSideCustomersUpdateConsentsBody, ClientSideListVouchersParams, ClientSideListVouchersResponse, ClientSidePublishCampaign, ClientSidePublishPayload, ClientSidePublishPreparedPayload, ClientSidePublishQueryParams, ClientSidePublishResponse, ClientSideRedeemOrder, ClientSideRedeemPayload, ClientSideRedeemResponse, ClientSideRedeemWidgetPayload, ClientSideRedemptionsRedeemStackableParams, ClientSideRedemptionsRedeemStackableResponse, ClientSideTrackCustomer, ClientSideTrackLoyalty, ClientSideTrackPayload, ClientSideTrackReferral, ClientSideTrackResponse, ClientSideValidateParams, ClientSideValidateResponse, ClientSideValidationValidateStackableResponse, ClientSideValidationsValidateStackableParams, ClientSideVoucherListing };
@@ -0,0 +1,34 @@
1
+ interface ConsentGroup {
2
+ id: string;
3
+ name: string;
4
+ description: string;
5
+ consents: string[];
6
+ created_at: string;
7
+ updated_at?: string;
8
+ object: 'consent_group';
9
+ }
10
+ interface Consent {
11
+ id: string;
12
+ name: string;
13
+ description: string;
14
+ category: string;
15
+ created_at: string;
16
+ updated_at?: string;
17
+ object: 'consent';
18
+ }
19
+ interface ConsentsListResponse {
20
+ groups: {
21
+ object: 'list';
22
+ total: number;
23
+ data_ref: 'data';
24
+ data: ConsentGroup[];
25
+ };
26
+ consents: {
27
+ object: 'list';
28
+ total: number;
29
+ data_ref: 'data';
30
+ data: Consent[];
31
+ };
32
+ }
33
+
34
+ export type { Consent, ConsentsListResponse };
@@ -0,0 +1,363 @@
1
+ import { DiscountAmount, DiscountPercent, DiscountUnit, DiscountFixed } from './DiscountVoucher.js';
2
+
3
+ interface SimpleCustomer {
4
+ id: string;
5
+ name?: string;
6
+ email?: string;
7
+ source_id?: string;
8
+ metadata?: Record<string, any>;
9
+ object: 'customer';
10
+ }
11
+ interface CustomerObject {
12
+ id: string;
13
+ source_id?: string;
14
+ name?: string;
15
+ email?: string;
16
+ phone?: string;
17
+ description?: string;
18
+ address: {
19
+ city?: string;
20
+ state?: string;
21
+ line_1?: string;
22
+ line_2?: string;
23
+ country?: string;
24
+ postal_code?: string;
25
+ };
26
+ summary: {
27
+ redemptions: {
28
+ total_redeemed: number;
29
+ total_failed: number;
30
+ total_succeeded: number;
31
+ total_rolled_back: number;
32
+ total_rollback_failed: number;
33
+ total_rollback_succeeded: number;
34
+ gift?: {
35
+ redeemed_amount: number;
36
+ amount_to_go: number;
37
+ };
38
+ loyalty?: {
39
+ redeemed_points: number;
40
+ points_to_go: number;
41
+ };
42
+ };
43
+ orders: {
44
+ total_amount: number;
45
+ total_count: number;
46
+ average_amount: number;
47
+ last_order_amount: number;
48
+ last_order_date?: string;
49
+ };
50
+ };
51
+ loyalty: {
52
+ points: number;
53
+ referred_customers: number;
54
+ campaigns?: Record<string, {
55
+ points: number;
56
+ referred_customers: number;
57
+ }>;
58
+ };
59
+ metadata: Record<string, any>;
60
+ created_at: string;
61
+ object: 'customer';
62
+ }
63
+ type CustomerUnconfirmed = Pick<CustomerObject, 'summary' | 'email' | 'loyalty'> & {
64
+ object: 'unconfirmed_customer';
65
+ };
66
+ interface CustomerRequest {
67
+ id?: string;
68
+ source_id?: string;
69
+ name?: string;
70
+ description?: string;
71
+ email?: string;
72
+ phone?: string;
73
+ birthday?: string;
74
+ birthdate?: string;
75
+ address?: {
76
+ city?: string;
77
+ state?: string;
78
+ line_1?: string;
79
+ line_2?: string;
80
+ country?: string;
81
+ postal_code?: string;
82
+ };
83
+ metadata?: Record<string, any>;
84
+ }
85
+ interface CustomersCommonListRequest {
86
+ limit?: number;
87
+ page?: number;
88
+ email?: string;
89
+ city?: string;
90
+ name?: string;
91
+ order?: 'created_at' | '-created_at';
92
+ starting_after?: Date | string;
93
+ }
94
+ interface CustomersCommonListResponse {
95
+ object: 'list';
96
+ total: number;
97
+ data_ref: 'customers';
98
+ customers: CustomerObject[];
99
+ has_more?: boolean;
100
+ }
101
+ interface CustomerActivityListQueryParams {
102
+ limit?: number;
103
+ order?: 'created_at' | '-created_at';
104
+ starting_after_id?: string;
105
+ campaign_type?: 'LOYALTY_PROGRAM' | 'PROMOTION' | 'DISCOUNT_COUPONS' | 'GIFT_VOUCHERS' | 'REFERRAL_PROGRAM';
106
+ campaign_id?: string;
107
+ category?: 'ACTION' | 'EFFECT';
108
+ type?: string;
109
+ start_date?: string;
110
+ end_date?: string;
111
+ }
112
+ interface CustomerActivityListResponse {
113
+ object: 'list';
114
+ data_ref: 'data';
115
+ data: Record<string, unknown>[];
116
+ has_more: boolean;
117
+ more_starting_after?: string;
118
+ }
119
+ interface CustomerActivitiesListQueryParams {
120
+ limit?: number;
121
+ order?: 'created_at' | '-created_at';
122
+ starting_after?: string;
123
+ starting_after_id?: string;
124
+ campaign_type?: 'LOYALTY_PROGRAM' | 'PROMOTION' | 'DISCOUNT_COUPONS' | 'GIFT_VOUCHERS' | 'REFERRAL_PROGRAM';
125
+ campaign_id?: string;
126
+ }
127
+ interface CustomerActivitiesListResponse {
128
+ object: 'list';
129
+ total: number;
130
+ data_ref: 'data';
131
+ data: Record<string, any>[];
132
+ }
133
+ interface CustomerRedeemablesListQueryParams {
134
+ limit?: number;
135
+ order?: 'created_at' | '-created_at' | 'id' | '-id';
136
+ starting_after_id?: string;
137
+ filters?: Record<string, any>;
138
+ }
139
+ interface CustomerRedeemablesListResponse {
140
+ object: 'list';
141
+ total: number;
142
+ data_ref: 'data';
143
+ data: CustomerRedeemablesListItemResponse[];
144
+ has_more: boolean;
145
+ more_starting_after?: string;
146
+ }
147
+ interface CustomerRedeemablesListItemResponse {
148
+ id: string;
149
+ created_at: string;
150
+ redeemable_id: string;
151
+ redeemable_object: string;
152
+ customer_id: string;
153
+ holder_role: 'OWNER' | 'REFERRER' | 'REFEREE';
154
+ campaign_id: string;
155
+ campaign_type: 'LOYALTY_PROGRAM' | 'PROMOTION' | 'DISCOUNT_COUPONS' | 'GIFT_VOUCHERS' | 'REFERRAL_PROGRAM';
156
+ voucher_type: 'GIFT_VOUCHER' | 'DISCOUNT_VOUCHER' | 'LOYALTY_CARD';
157
+ redeemable: CustomerRedeemablesListItemContainerResponse;
158
+ }
159
+ interface CustomerRedeemablesListItemContainerVoucherResponse {
160
+ id: string;
161
+ code: string;
162
+ campaign?: string;
163
+ camapign_id?: string;
164
+ category_id?: string;
165
+ type: 'GIFT_VOUCHER' | 'DISCOUNT_VOUCHER' | 'LOYALTY_CARD';
166
+ discount?: DiscountAmount | DiscountPercent | DiscountUnit | DiscountFixed;
167
+ gift?: {
168
+ amount: number;
169
+ balance: number;
170
+ effect: string;
171
+ };
172
+ loyalty_card?: {
173
+ points: number;
174
+ balance: number;
175
+ next_expiration_date?: string;
176
+ next_expiration_points?: number;
177
+ };
178
+ start_date?: string;
179
+ expiration_date?: string;
180
+ validity_timeframe?: {
181
+ interval: string;
182
+ duration: string;
183
+ };
184
+ validity_day_of_week?: number[];
185
+ publish?: {
186
+ object: 'list';
187
+ count: number;
188
+ url: string;
189
+ };
190
+ redemption?: {
191
+ object: 'list';
192
+ quantity?: number;
193
+ redeemed_quantity: number;
194
+ url: string;
195
+ redeemed_points?: number;
196
+ };
197
+ active?: boolean;
198
+ additional_info?: string;
199
+ metadata?: Record<string, any>;
200
+ assets: {
201
+ qr: {
202
+ id: string;
203
+ url: string;
204
+ };
205
+ barcode: {
206
+ id: string;
207
+ url: string;
208
+ };
209
+ };
210
+ is_referral_code: boolean;
211
+ holder_id?: string;
212
+ updated_at?: string;
213
+ created_at: string;
214
+ object: 'voucher';
215
+ }
216
+ interface CustomerRedeemablesListItemContainerResponse {
217
+ type: 'voucher';
218
+ voucher?: CustomerRedeemablesListItemContainerVoucherResponse;
219
+ status: 'ACTIVE' | 'USED' | 'DISABLED' | 'NOT_ACTIVE_YET' | 'EXPIRED' | 'NO_BALANCE';
220
+ }
221
+ type CustomersCreateBody = CustomerRequest;
222
+ type CustomersCreateResponse = CustomerObject | CustomerUnconfirmed;
223
+ type CustomersGetResponse = CustomerObject | CustomerUnconfirmed;
224
+ type CustomersListParams = CustomersCommonListRequest;
225
+ type CustomersListResponse = CustomersCommonListResponse;
226
+ type CustomersScrollParams = CustomersCommonListRequest;
227
+ type CustomersScrollResponse = CustomersCommonListResponse;
228
+ type CustomersScrollYield = CustomerObject;
229
+ type IdOrSourceId = {
230
+ id: string;
231
+ } | {
232
+ source_id: string;
233
+ };
234
+ type CustomersUpdateParams = CustomerRequest & IdOrSourceId;
235
+ type CustomersUpdateResponse = CustomerObject | CustomerUnconfirmed;
236
+ type CustomersUpdateConsentsBody = Record<string, boolean>;
237
+ type CustomerBase = {
238
+ name?: string | null;
239
+ description?: string | null;
240
+ email?: string | null;
241
+ phone?: string | null;
242
+ birthdate?: string | null;
243
+ metadata?: Record<string, unknown> | null;
244
+ };
245
+ type CustomerAddress = {
246
+ address?: {
247
+ city?: string | null;
248
+ state?: string | null;
249
+ line_1?: string | null;
250
+ line_2?: string | null;
251
+ country?: string | null;
252
+ postal_code?: string | null;
253
+ } | null;
254
+ };
255
+ type Referrer = CustomerRequest;
256
+ type Customer = CustomerRequest;
257
+ type ReferrerWithSummaryLoyaltyReferrals = CustomerWithSummaryLoyaltyReferrals;
258
+ type CustomerId = {
259
+ id: string;
260
+ object: 'customer';
261
+ };
262
+ type ReferrerId = CustomerId;
263
+ type CustomerWithSummaryLoyaltyReferrals = {
264
+ id?: string;
265
+ source_id?: string;
266
+ name?: string;
267
+ description?: string;
268
+ email?: string;
269
+ phone?: string;
270
+ birthday?: string;
271
+ birthdate?: string;
272
+ address: {
273
+ city?: string;
274
+ state?: string;
275
+ line_1?: string;
276
+ line_2?: string;
277
+ country?: string;
278
+ postal_code?: string;
279
+ } | null;
280
+ metadata?: Record<string, any>;
281
+ summary: CustomerSummary;
282
+ loyalty: CustomerLoyalty;
283
+ referrals: CustomerReferrals;
284
+ system_metadata: Record<string, unknown>;
285
+ created_at: string;
286
+ updated_at?: string;
287
+ assets?: {
288
+ cockpit_url?: string;
289
+ };
290
+ object: 'customer';
291
+ };
292
+ type CustomerSummary = {
293
+ redemptions: CustomerSummaryRedemptions;
294
+ orders: CustomerSummaryOrders;
295
+ };
296
+ type CustomerSummaryRedemptions = {
297
+ total_redeemed: number;
298
+ total_failed: number;
299
+ total_succeeded: number;
300
+ total_rolled_back: number;
301
+ total_rollback_failed: number;
302
+ total_rollback_succeeded: number;
303
+ gift: {
304
+ redeemed_amount: number;
305
+ amount_to_go: number;
306
+ };
307
+ loyalty_card: {
308
+ redeemed_points: number;
309
+ points_to_go: number;
310
+ };
311
+ };
312
+ type CustomerSummaryOrders = {
313
+ total_amount: number;
314
+ total_count: number;
315
+ average_amount: number;
316
+ last_order_amount: number;
317
+ last_order_date: string;
318
+ };
319
+ type CustomerLoyalty = {
320
+ points: number;
321
+ referred_customers: number;
322
+ campaigns: Record<string, {
323
+ points: number;
324
+ loyalty_tier: string;
325
+ referred_customers: number;
326
+ }>;
327
+ };
328
+ type CustomerReferrals = {
329
+ total: number;
330
+ campaigns: {
331
+ campaign_id: string;
332
+ referrer_id: string;
333
+ related_object_id: string;
334
+ related_object_type: string;
335
+ date: string;
336
+ }[];
337
+ };
338
+ type CustomersUpdateInBulkRequestBody = (CustomerBase & CustomerAddress & {
339
+ source_id: string | null;
340
+ })[];
341
+ interface CustomersUpdateMetadataInBulkRequestBody {
342
+ source_ids: string[];
343
+ metadata: Record<string, unknown>;
344
+ }
345
+ interface CustomersDeletePermanentlyResponseBody {
346
+ id: string;
347
+ created_at: string;
348
+ related_object_id: string;
349
+ related_object: 'customer';
350
+ status: 'DONE';
351
+ data_json: {
352
+ events: number;
353
+ customer_events: number;
354
+ daily_events: number;
355
+ segments: number;
356
+ orders: number;
357
+ order_events: number;
358
+ customer: 1;
359
+ };
360
+ object: 'pernament_deletion';
361
+ }
362
+
363
+ export type { Customer, CustomerActivitiesListQueryParams, CustomerActivitiesListResponse, CustomerActivityListQueryParams, CustomerActivityListResponse, CustomerId, CustomerLoyalty, CustomerObject, CustomerRedeemablesListItemContainerResponse, CustomerRedeemablesListItemContainerVoucherResponse, CustomerRedeemablesListItemResponse, CustomerRedeemablesListQueryParams, CustomerRedeemablesListResponse, CustomerReferrals, CustomerRequest, CustomerSummary, CustomerSummaryOrders, CustomerSummaryRedemptions, CustomerUnconfirmed, CustomerWithSummaryLoyaltyReferrals, CustomersCommonListRequest, CustomersCommonListResponse, CustomersCreateBody, CustomersCreateResponse, CustomersDeletePermanentlyResponseBody, CustomersGetResponse, CustomersListParams, CustomersListResponse, CustomersScrollParams, CustomersScrollResponse, CustomersScrollYield, CustomersUpdateConsentsBody, CustomersUpdateInBulkRequestBody, CustomersUpdateMetadataInBulkRequestBody, CustomersUpdateParams, CustomersUpdateResponse, Referrer, ReferrerId, ReferrerWithSummaryLoyaltyReferrals, SimpleCustomer };
@@ -0,0 +1,94 @@
1
+ type DiscountVouchersTypes = 'AMOUNT' | 'PERCENT' | 'UNIT' | 'FIXED';
2
+ declare enum DiscountVouchersTypesEnum {
3
+ AMOUNT = "AMOUNT",
4
+ PERCENT = "PERCENT",
5
+ UNIT = "UNIT",
6
+ FIXED = "FIXED"
7
+ }
8
+ type DiscountVouchersEffectTypes = 'ADD_MISSING_ITEMS' | 'ADD_NEW_ITEMS' | 'ADD_MANY_ITEMS' | 'APPLY_TO_ORDER' | 'APPLY_TO_ITEMS' | 'APPLY_TO_ITEMS_PROPORTIONALLY' | 'APPLY_TO_ITEMS_PROPORTIONALLY_BY_QUANTITY' | 'APPLY_TO_ITEMS_BY_QUANTITY';
9
+ type DiscountUnitVouchersEffectTypes = 'ADD_MISSING_ITEMS' | 'ADD_NEW_ITEMS' | 'ADD_MANY_ITEMS';
10
+ type DiscountAmountVouchersEffectTypes = 'APPLY_TO_ORDER' | 'APPLY_TO_ITEMS' | 'APPLY_TO_ITEMS_PROPORTIONALLY' | 'APPLY_TO_ITEMS_PROPORTIONALLY_BY_QUANTITY' | 'APPLY_TO_ITEMS_BY_QUANTITY';
11
+ type DiscountPercentVouchersEffectTypes = 'APPLY_TO_ORDER' | 'APPLY_TO_ITEMS';
12
+ type DiscountFixedVouchersEffectTypes = 'APPLY_TO_ORDER' | 'APPLY_TO_ITEMS';
13
+ interface SimpleSkuDiscountUnit {
14
+ id: string;
15
+ source_id?: string;
16
+ sku: string;
17
+ }
18
+ interface SimpleProductDiscountUnit {
19
+ id: string;
20
+ source_id?: string;
21
+ name: string;
22
+ }
23
+ interface DiscountUnit {
24
+ type?: DiscountVouchersTypesEnum.UNIT;
25
+ unit_off?: number;
26
+ unit_off_formula?: string;
27
+ effect?: DiscountUnitVouchersEffectTypes;
28
+ unit_type?: string;
29
+ product?: SimpleProductDiscountUnit;
30
+ sku?: SimpleSkuDiscountUnit;
31
+ }
32
+ interface DiscountAmount {
33
+ type?: DiscountVouchersTypesEnum.AMOUNT;
34
+ amount_off?: number;
35
+ amount_off_formula?: string;
36
+ effect?: DiscountAmountVouchersEffectTypes;
37
+ }
38
+ interface DiscountPercent {
39
+ type?: DiscountVouchersTypesEnum.PERCENT;
40
+ percent_off?: number;
41
+ percent_off_formula?: string;
42
+ amount_limit?: number;
43
+ effect?: DiscountPercentVouchersEffectTypes;
44
+ }
45
+ interface DiscountFixed {
46
+ type?: DiscountVouchersTypesEnum.FIXED;
47
+ fixed_amount?: number;
48
+ fixed_amount_formula?: string;
49
+ effect?: DiscountFixedVouchersEffectTypes;
50
+ }
51
+ type Discount = DiscountAmount_ | DiscountUnit_ | DiscountUnitMultiple_ | DiscountPercent_ | DiscountFixed_;
52
+ type DiscountAmount_ = {
53
+ type: 'AMOUNT';
54
+ amount_off?: number;
55
+ amount_off_formula?: string;
56
+ aggregated_amount_limit?: number;
57
+ effect?: DiscountAmountVouchersEffectTypes;
58
+ is_dynamic?: boolean;
59
+ };
60
+ type DiscountUnit_ = {
61
+ type: 'UNIT';
62
+ } & DiscountUnitBase_;
63
+ type DiscountUnitBase_ = {
64
+ unit_off?: number;
65
+ unit_off_formula?: string;
66
+ unit_type: string;
67
+ product?: SimpleProductDiscountUnit;
68
+ sku?: SimpleSkuDiscountUnit;
69
+ effect?: 'ADD_MISSING_ITEMS' | 'ADD_NEW_ITEMS';
70
+ is_dynamic?: boolean;
71
+ };
72
+ type DiscountUnitMultiple_ = {
73
+ type: 'UNIT';
74
+ effect: 'ADD_MANY_ITEMS';
75
+ units: DiscountUnitBase_[];
76
+ };
77
+ type DiscountPercent_ = {
78
+ type: 'PERCENT';
79
+ percent_off?: number;
80
+ percent_off_formula?: string;
81
+ amount_limit?: number;
82
+ aggregated_amount_limit?: number;
83
+ effect?: DiscountPercentVouchersEffectTypes;
84
+ is_dynamic?: boolean;
85
+ };
86
+ type DiscountFixed_ = {
87
+ type: 'FIXED';
88
+ fixed_amount?: number;
89
+ fixed_amount_formula?: string;
90
+ effect?: DiscountFixedVouchersEffectTypes;
91
+ is_dynamic?: boolean;
92
+ };
93
+
94
+ export { type Discount, type DiscountAmount, type DiscountAmountVouchersEffectTypes, type DiscountAmount_, type DiscountFixed, type DiscountFixedVouchersEffectTypes, type DiscountFixed_, type DiscountPercent, type DiscountPercentVouchersEffectTypes, type DiscountPercent_, type DiscountUnit, type DiscountUnitBase_, type DiscountUnitMultiple_, type DiscountUnitVouchersEffectTypes, type DiscountUnit_, type DiscountVouchersEffectTypes, type DiscountVouchersTypes, DiscountVouchersTypesEnum };