@voucherify/sdk 2.9.1 → 2.9.3

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 (77) hide show
  1. package/dist/voucherifysdk.cjs +2 -0
  2. package/dist/voucherifysdk.cjs.map +1 -0
  3. package/dist/voucherifysdk.d.mts +5252 -0
  4. package/dist/voucherifysdk.d.ts +5252 -0
  5. package/dist/voucherifysdk.esm.js +2 -2261
  6. package/dist/voucherifysdk.esm.js.map +1 -1
  7. package/package.json +12 -8
  8. package/CHANGELOG.md +0 -657
  9. package/dist/ApiLimitsHandler.d.ts +0 -10
  10. package/dist/AsyncActions.d.ts +0 -15
  11. package/dist/Balance.d.ts +0 -12
  12. package/dist/Campaigns.d.ts +0 -58
  13. package/dist/Categories.d.ts +0 -26
  14. package/dist/ClientSide.d.ts +0 -53
  15. package/dist/Consents.d.ts +0 -10
  16. package/dist/Customers.d.ts +0 -72
  17. package/dist/Distributions.d.ts +0 -22
  18. package/dist/Events.d.ts +0 -10
  19. package/dist/Exports.d.ts +0 -22
  20. package/dist/Loyalties.d.ts +0 -159
  21. package/dist/MetadataSchemas.d.ts +0 -14
  22. package/dist/Orders.d.ts +0 -27
  23. package/dist/ProductCollections.d.ts +0 -26
  24. package/dist/Products.d.ts +0 -63
  25. package/dist/PromotionTiers.d.ts +0 -34
  26. package/dist/Promotions.d.ts +0 -18
  27. package/dist/PromotionsStacks.d.ts +0 -30
  28. package/dist/Qualifications.d.ts +0 -10
  29. package/dist/Redemptions.d.ts +0 -35
  30. package/dist/RequestController.d.ts +0 -29
  31. package/dist/Rewards.d.ts +0 -43
  32. package/dist/Segments.d.ts +0 -22
  33. package/dist/ValidationRules.d.ts +0 -43
  34. package/dist/Validations.d.ts +0 -17
  35. package/dist/VoucherifyClientSide.d.ts +0 -86
  36. package/dist/VoucherifyError.d.ts +0 -20
  37. package/dist/VoucherifyServerSide.d.ts +0 -131
  38. package/dist/Vouchers.d.ts +0 -78
  39. package/dist/helpers.d.ts +0 -18
  40. package/dist/index.d.ts +0 -25
  41. package/dist/types/ApplicableTo.d.ts +0 -30
  42. package/dist/types/AsyncActions.d.ts +0 -21
  43. package/dist/types/Balance.d.ts +0 -14
  44. package/dist/types/Campaigns.d.ts +0 -120
  45. package/dist/types/Categories.d.ts +0 -38
  46. package/dist/types/ClientSide.d.ts +0 -134
  47. package/dist/types/Consents.d.ts +0 -33
  48. package/dist/types/Customers.d.ts +0 -361
  49. package/dist/types/DiscountVoucher.d.ts +0 -93
  50. package/dist/types/Distributions.d.ts +0 -144
  51. package/dist/types/Events.d.ts +0 -17
  52. package/dist/types/Exports.d.ts +0 -149
  53. package/dist/types/Gift.d.ts +0 -3
  54. package/dist/types/Loyalties.d.ts +0 -1057
  55. package/dist/types/MetadataSchemas.d.ts +0 -33
  56. package/dist/types/Orders.d.ts +0 -195
  57. package/dist/types/ProductCollections.d.ts +0 -96
  58. package/dist/types/Products.d.ts +0 -106
  59. package/dist/types/PromotionTiers.d.ts +0 -127
  60. package/dist/types/Promotions.d.ts +0 -108
  61. package/dist/types/PromotionsStacks.d.ts +0 -71
  62. package/dist/types/Qualifications.d.ts +0 -86
  63. package/dist/types/Redemptions.d.ts +0 -205
  64. package/dist/types/Rewards.d.ts +0 -219
  65. package/dist/types/Segments.d.ts +0 -32
  66. package/dist/types/Stackable.d.ts +0 -101
  67. package/dist/types/UtilityTypes.d.ts +0 -3
  68. package/dist/types/ValidateSession.d.ts +0 -17
  69. package/dist/types/ValidationError.d.ts +0 -7
  70. package/dist/types/ValidationRules.d.ts +0 -93
  71. package/dist/types/Validations.d.ts +0 -98
  72. package/dist/types/Vouchers.d.ts +0 -364
  73. package/dist/types/index.d.ts +0 -25
  74. package/dist/voucherifysdk.umd.development.js +0 -2270
  75. package/dist/voucherifysdk.umd.development.js.map +0 -1
  76. package/dist/voucherifysdk.umd.production.min.js +0 -2
  77. package/dist/voucherifysdk.umd.production.min.js.map +0 -1
@@ -1,101 +0,0 @@
1
- import { RewardRedemptionParams } from './Rewards';
2
- import { GiftRedemptionParams } from './Gift';
3
- import { OrdersCreateResponse } from './Orders';
4
- import { ApplicableToResultList } from './ApplicableTo';
5
- import { DiscountVouchersTypes, DiscountVouchersEffectTypes, DiscountUnitVouchersEffectTypes } from './DiscountVoucher';
6
- import { SimpleProduct, SimpleSku } from './Products';
7
- import { LoyaltyPointsTransfer } from './Loyalties';
8
- import { ValidationError } from './ValidationError';
9
- import { Category } from './Categories';
10
- declare type ExpandOption = 'order' | 'redeemable' | 'redemption';
11
- export interface StackableOptions {
12
- expand: ExpandOption[];
13
- }
14
- export declare type StackableRedeemableObject = 'promotion_stack' | 'promotion_tier' | 'voucher';
15
- export interface StackableRedeemableParams {
16
- object: StackableRedeemableObject;
17
- id: string;
18
- reward?: RewardRedemptionParams;
19
- gift?: GiftRedemptionParams;
20
- }
21
- export declare type StackableRedeemableResponseStatus = 'APPLICABLE' | 'INAPPLICABLE' | 'SKIPPED';
22
- export interface StackableRedeemableResultDiscountUnit {
23
- effect: DiscountUnitVouchersEffectTypes;
24
- unit_off: number;
25
- unit_type: string;
26
- sku?: SimpleSku;
27
- product?: SimpleProduct;
28
- }
29
- export interface StackableRedeemableResultDiscount {
30
- type: DiscountVouchersTypes;
31
- effect: DiscountVouchersEffectTypes;
32
- amount_off?: number;
33
- amount_off_formula?: string;
34
- percent_off?: number;
35
- percent_off_formula?: string;
36
- amount_limit?: number;
37
- fixed_amount?: number;
38
- fixed_amount_formula?: string;
39
- unit_off?: number;
40
- unit_off_formula?: string;
41
- unit_type?: string;
42
- sku?: SimpleSku;
43
- product?: SimpleProduct;
44
- units?: StackableRedeemableResultDiscountUnit[];
45
- }
46
- export interface StackableRedeemableResultGift {
47
- credits?: number;
48
- }
49
- export interface StackableRedeemableResultLoyaltyCard {
50
- points?: number;
51
- transfers?: LoyaltyPointsTransfer[];
52
- }
53
- export interface StackableRedeemableResultResponse {
54
- discount?: StackableRedeemableResultDiscount;
55
- gift?: StackableRedeemableResultGift;
56
- loyalty_card?: StackableRedeemableResultLoyaltyCard;
57
- error?: ValidationError;
58
- details?: {
59
- key?: string;
60
- message?: string;
61
- };
62
- }
63
- export interface StackableRedeemableResponse {
64
- status: StackableRedeemableResponseStatus;
65
- id: string;
66
- object: StackableRedeemableObject;
67
- order?: OrdersCreateResponse;
68
- applicable_to?: ApplicableToResultList;
69
- inapplicable_to?: ApplicableToResultList;
70
- result?: StackableRedeemableResultResponse;
71
- metadata?: Record<string, any>;
72
- categories?: Category[];
73
- }
74
- export declare type StackableRedeemableInapplicableResponse = {
75
- status: 'INAPPLICABLE';
76
- id: string;
77
- object: 'voucher' | 'promotion_tier';
78
- result: {
79
- error?: ValidationError;
80
- details?: {
81
- key?: string;
82
- message?: string;
83
- };
84
- };
85
- metadata?: Record<string, unknown>;
86
- categories?: Category[];
87
- };
88
- export declare type StackableRedeemableSkippedResponse = {
89
- status: 'SKIPPED';
90
- id: string;
91
- object: 'voucher' | 'promotion_tier';
92
- result: {
93
- details?: {
94
- key?: string;
95
- message?: string;
96
- };
97
- };
98
- metadata?: Record<string, unknown>;
99
- categories?: Category[];
100
- };
101
- export {};
@@ -1,3 +0,0 @@
1
- export declare type WithRequiredProperty<Type, Key extends keyof Type> = Type & {
2
- [Property in Key]-?: Type[Property];
3
- };
@@ -1,17 +0,0 @@
1
- export declare type ValidationSessionType = 'LOCK';
2
- export declare type ValidationSessionTTLUnit = 'DAYS' | 'HOURS' | 'MICROSECONDS' | 'MILLISECONDS' | 'MINUTES' | 'NANOSECONDS' | 'SECONDS';
3
- export interface ValidationSessionParams {
4
- key?: string;
5
- type?: ValidationSessionType;
6
- ttl?: number;
7
- ttl_unit?: ValidationSessionTTLUnit;
8
- }
9
- export interface ValidationSessionResponse {
10
- key: string;
11
- type: ValidationSessionType;
12
- ttl: number;
13
- ttl_unit: ValidationSessionTTLUnit;
14
- }
15
- export interface ValidationSessionReleaseParams {
16
- key: string;
17
- }
@@ -1,7 +0,0 @@
1
- export interface ValidationError {
2
- code?: number;
3
- key?: string;
4
- message: string;
5
- details?: string;
6
- request_id?: string;
7
- }
@@ -1,93 +0,0 @@
1
- import { ApplicableToResultList } from './ApplicableTo';
2
- export interface ValidationRulesCreate {
3
- name: string;
4
- error?: {
5
- message?: string;
6
- };
7
- rules?: {
8
- logic?: string;
9
- [rule: string]: any;
10
- };
11
- }
12
- export interface ValidationRulesCreateResponse {
13
- id: string;
14
- name: string;
15
- error?: {
16
- message?: string;
17
- };
18
- rules?: {
19
- logic?: string;
20
- [rule: string]: any;
21
- };
22
- created_at: string;
23
- updated_at?: string;
24
- object: 'validation_rules';
25
- }
26
- export interface ValidationRulesValidateResponse {
27
- valid: boolean;
28
- rule_id: string;
29
- applicable_to: ApplicableToResultList;
30
- }
31
- export declare type ValidationRulesGetResponse = ValidationRulesCreateResponse & {
32
- assignments_count?: string;
33
- };
34
- export declare type ValidationRulesUpdate = Partial<ValidationRulesCreate> & {
35
- id: string;
36
- };
37
- export declare type ValidationRulesUpdateResponse = ValidationRulesCreateResponse;
38
- export interface ValidationRulesCreateAssignment {
39
- voucher?: string;
40
- campaign?: string;
41
- promotion_tier?: string;
42
- }
43
- export interface ValidationRulesCreateAssignmentResponse {
44
- id: string;
45
- rule_id: string;
46
- related_object_id?: string;
47
- related_object_type?: string;
48
- created_at?: string;
49
- updated_at: string;
50
- object: 'validation_rules_assignment';
51
- }
52
- export interface ValidationRulesListParams {
53
- limit?: number;
54
- page?: number;
55
- }
56
- export interface ValidationRulesListResponse {
57
- object: 'list';
58
- total: number;
59
- data_ref: 'data';
60
- data: ValidationRulesGetResponse[];
61
- }
62
- export interface ValidationRulesListAssignmentsParams {
63
- limit?: number;
64
- page?: number;
65
- }
66
- export interface ValidationRulesListAssignmentsResponse {
67
- object: 'list';
68
- total: number;
69
- data_ref: 'data';
70
- data: ValidationRulesCreateAssignmentResponse[];
71
- }
72
- export declare type ValidationRulesAssignmentsList = ValidationRulesListResponse;
73
- export interface ValidationRulesAssignment {
74
- id: string;
75
- rule_id: string;
76
- related_object_id: string;
77
- related_object_type: string;
78
- created_at: string;
79
- object: 'validation_rules_assignment';
80
- }
81
- export interface ValidationRulesListRulesAssignmentsRequestQuery {
82
- related_object_id?: string;
83
- rule?: string;
84
- page?: number;
85
- limit?: number;
86
- order?: 'created_at' | '-created_at';
87
- }
88
- export interface ValidationRulesListRulesAssignmentsResponseBody {
89
- object: 'list';
90
- data_ref: 'data';
91
- total: number;
92
- data: ValidationRulesAssignment[];
93
- }
@@ -1,98 +0,0 @@
1
- import { DiscountAmount, DiscountPercent, DiscountUnit, DiscountFixed } from './DiscountVoucher';
2
- import { CustomersCreateBody } from './Customers';
3
- import { StackableOptions, StackableRedeemableInapplicableResponse, StackableRedeemableParams, StackableRedeemableResponse, StackableRedeemableSkippedResponse } from './Stackable';
4
- import { ValidationSessionParams, ValidationSessionResponse } from './ValidateSession';
5
- import { ApplicableToResultList } from './ApplicableTo';
6
- import { ValidationError } from './ValidationError';
7
- import { OrdersItem, OrdersCreate, OrdersCreateResponse } from './Orders';
8
- import { PromotionsValidateParams } from './Promotions';
9
- export interface ValidationsValidateVoucherParams {
10
- customer?: {
11
- id?: string;
12
- source_id?: string;
13
- name?: string;
14
- email?: string;
15
- description?: string;
16
- metadata?: Record<string, any>;
17
- };
18
- order?: {
19
- id?: string;
20
- source_id?: string;
21
- amount?: number;
22
- items?: OrdersItem[];
23
- metadata?: Record<string, any>;
24
- };
25
- gift?: {
26
- credits: number;
27
- };
28
- reward?: {
29
- id: string;
30
- };
31
- session?: ValidationSessionParams;
32
- }
33
- export interface ValidationsValidateVoucherResponse {
34
- applicable_to?: ApplicableToResultList;
35
- inapplicable_to?: ApplicableToResultList;
36
- campaign?: string;
37
- campaign_id?: string;
38
- metadata?: Record<string, any>;
39
- code?: string;
40
- valid?: boolean;
41
- discount?: DiscountAmount | DiscountUnit | DiscountPercent | DiscountFixed;
42
- gift?: {
43
- amount: number;
44
- balance: number;
45
- };
46
- loyalty?: {
47
- points_cost: number;
48
- };
49
- order?: {
50
- amount: number;
51
- discount_amount: number;
52
- total_discount_amount: number;
53
- total_amount: number;
54
- applied_discount_amount?: number;
55
- total_applied_discount_amount?: number;
56
- items?: OrdersItem[];
57
- initial_amount?: number;
58
- items_discount_amount?: number;
59
- items_applied_discount_amount?: number;
60
- metadata?: Record<string, any>;
61
- };
62
- session?: ValidationSessionParams;
63
- start_date?: string;
64
- expiration_date?: string;
65
- tracking_id: string;
66
- error?: ValidationError;
67
- }
68
- export interface ValidationsValidateStackableParams {
69
- options?: StackableOptions;
70
- redeemables: StackableRedeemableParams[];
71
- session?: ValidationSessionParams;
72
- order?: OrdersCreate;
73
- customer?: CustomersCreateBody;
74
- metadata?: Record<string, any>;
75
- }
76
- export interface ValidationValidateStackableResponse {
77
- valid: boolean;
78
- tracking_id?: string;
79
- session?: ValidationSessionResponse;
80
- order?: OrdersCreateResponse;
81
- redeemables?: StackableRedeemableResponse[];
82
- skipped_redeemables?: StackableRedeemableSkippedResponse[];
83
- inapplicable_redeemables?: StackableRedeemableInapplicableResponse[];
84
- stacking_rules: ValidationsStackingRules;
85
- }
86
- export declare type ValidationsStackingRules = {
87
- redeemables_limit: number;
88
- applicable_redeemables_limit: number;
89
- applicable_redeemables_per_category_limit?: number;
90
- applicable_exclusive_redeemables_limit: number;
91
- applicable_exclusive_redeemables_per_category_limit?: number;
92
- exclusive_categories: string[];
93
- joint_categories: string[];
94
- redeemables_application_mode: 'ALL' | 'PARTIAL';
95
- redeemables_sorting_rule: 'CATEGORY_HIERARCHY' | 'REQUESTED_ORDER';
96
- };
97
- export declare type ValidationsValidateCode = PromotionsValidateParams;
98
- export declare type ValidationsValidateContext = ValidationsValidateVoucherParams;
@@ -1,364 +0,0 @@
1
- import { OrdersGetResponse } from './Orders';
2
- import { SimpleCustomer } from './Customers';
3
- import { DiscountUnit, DiscountAmount, DiscountPercent, DiscountFixed } from './DiscountVoucher';
4
- import { LoyaltyCardTransaction } from './Loyalties';
5
- export declare type VoucherType = 'GIFT_VOUCHER' | 'DISCOUNT_VOUCHER' | 'LOYALTY_CARD' | 'LUCKY_DRAW';
6
- export interface SimpleVoucher {
7
- code_config?: {
8
- length?: number;
9
- charset?: string;
10
- pattern?: string;
11
- prefix?: string;
12
- suffix?: string;
13
- };
14
- type: VoucherType;
15
- is_referral_code?: boolean;
16
- discount?: DiscountUnit | DiscountAmount | DiscountPercent | DiscountFixed;
17
- loyalty_card?: {
18
- points: number;
19
- balance: number;
20
- };
21
- redemption?: {
22
- quantity: number;
23
- };
24
- }
25
- export interface VouchersResponse {
26
- id: string;
27
- code: string;
28
- campaign?: string;
29
- category?: string;
30
- type?: 'DISCOUNT_VOUCHER' | 'GIFT_VOUCHER';
31
- discount?: DiscountAmount | DiscountPercent | DiscountUnit | DiscountFixed;
32
- gift?: {
33
- amount: number;
34
- balance: number;
35
- };
36
- loyalty_card?: {
37
- points: number;
38
- balance: number;
39
- next_expiration_date?: string;
40
- next_expiration_points?: number;
41
- };
42
- start_date?: string;
43
- expiration_date?: string;
44
- validity_timeframe?: {
45
- interval: string;
46
- duration: string;
47
- };
48
- validity_day_of_week?: number[];
49
- publish?: {
50
- object: 'list';
51
- count: number;
52
- data_ref: 'entries';
53
- entries: string[];
54
- total: number;
55
- url: string;
56
- };
57
- redemption?: {
58
- object: 'list';
59
- quantity?: number;
60
- redeemed_quantity: number;
61
- data_ref: 'redemption_entries';
62
- redemption_entries: string[];
63
- total: number;
64
- url: string;
65
- };
66
- active: boolean;
67
- additional_info?: string;
68
- metadata?: Record<string, any>;
69
- assets?: {
70
- qr?: {
71
- id: string;
72
- url: string;
73
- };
74
- barcode?: {
75
- id: string;
76
- url: string;
77
- };
78
- };
79
- is_referral_code: boolean;
80
- referrer_id?: string;
81
- holder_id?: string;
82
- updated_at?: string;
83
- created_at: string;
84
- object: 'voucher';
85
- validation_rules_assignments: {
86
- object: 'list';
87
- total: number;
88
- data_ref: 'data';
89
- data?: {
90
- id: string;
91
- rule_id?: string;
92
- related_object_id?: string;
93
- related_object_type?: string;
94
- created_at: string;
95
- object: 'validation_rules_assignment';
96
- }[];
97
- };
98
- }
99
- export interface VouchersQualificationExamineBody {
100
- customer?: Omit<SimpleCustomer, 'object'> & {
101
- description: string;
102
- };
103
- order?: Pick<OrdersGetResponse, 'id' | 'source_id' | 'amount' | 'items' | 'metadata'>;
104
- reward?: {
105
- id: string;
106
- assignment_id?: string;
107
- };
108
- metadata?: Record<string, any>;
109
- }
110
- export interface VouchersQualificationExamineParams {
111
- audienceRulesOnly?: boolean;
112
- order?: 'created_at' | '-created_at' | 'updated_at' | '-updated_at';
113
- limit?: number;
114
- }
115
- export interface VouchersQualificationExamineResponse {
116
- object: 'list';
117
- total: number;
118
- data_ref: 'data';
119
- data?: VouchersResponse[];
120
- }
121
- export interface VouchersCreateParameters {
122
- active?: boolean;
123
- code?: string;
124
- code_config?: {
125
- length?: number;
126
- charset?: string;
127
- pattern?: string;
128
- prefix?: string;
129
- suffix?: string;
130
- };
131
- redemption?: {
132
- quantity: number;
133
- };
134
- validation_rules?: string[];
135
- }
136
- export declare type VouchersCreate = VouchersCreateParameters & Pick<VouchersResponse, 'type' | 'discount' | 'gift' | 'category' | 'additional_info' | 'start_date' | 'expiration_date' | 'metadata'>;
137
- export declare type VouchersCreateResponse = Omit<VouchersResponse, 'validation_rules_assignments'>;
138
- export declare type VouchersGetResponse = VouchersResponse;
139
- export interface VouchersUpdate {
140
- code: string;
141
- category?: string;
142
- start_date?: string;
143
- expiration_date?: string;
144
- active?: boolean;
145
- additional_info?: string;
146
- metadata?: Record<string, any>;
147
- gift?: {
148
- amount: number;
149
- };
150
- }
151
- export declare type VouchersUpdateResponse = VouchersResponse;
152
- export interface VouchersDeleteParams {
153
- force?: boolean;
154
- }
155
- export interface VouchersListParams {
156
- limit?: number;
157
- page?: number;
158
- category?: string;
159
- campaign?: string;
160
- customer?: string;
161
- created_at?: {
162
- after?: string;
163
- before?: string;
164
- };
165
- updated_at?: {
166
- after?: string;
167
- before?: string;
168
- };
169
- order?: '-created_at' | 'created_at' | '-updated_at' | 'updated_at' | '-type' | 'type' | '-code' | 'code' | '-campaign' | 'campaign' | '-category' | 'category';
170
- filters?: {
171
- junction?: string;
172
- [filter_condition: string]: any;
173
- };
174
- }
175
- export interface VouchersListResponse {
176
- object: 'list';
177
- total: number;
178
- data_ref: 'vouchers';
179
- vouchers: VouchersResponse[];
180
- }
181
- export declare type VouchersEnableResponse = VouchersResponse;
182
- export declare type VouchersDisableResponse = VouchersResponse;
183
- export interface VouchersImport {
184
- code: string;
185
- category?: string;
186
- type?: 'DISCOUNT_VOUCHER' | 'GIFT_VOUCHER';
187
- discount: DiscountAmount | DiscountPercent | DiscountUnit | DiscountFixed;
188
- additional_info?: string;
189
- start_date?: string;
190
- expiration_date?: string;
191
- active?: boolean;
192
- metadata?: Record<string, any>;
193
- redemption?: {
194
- quantity: number;
195
- };
196
- code_config?: {
197
- length?: number;
198
- charset?: string;
199
- pattern?: string;
200
- prefix?: string;
201
- suffix?: string;
202
- };
203
- }
204
- export interface VouchersBulkUpdateObject {
205
- code: string;
206
- metadata: Record<string, any>;
207
- }
208
- export declare type VouchersBulkUpdate = VouchersBulkUpdateObject[];
209
- export interface VouchersBulkUpdateMetadata {
210
- codes: string[];
211
- metadata: Record<string, any>;
212
- }
213
- export declare type VouchersImportResponse = {
214
- async_action_id: string;
215
- };
216
- export declare type VouchersBulkUpdateMetadataResponse = {
217
- async_action_id: string;
218
- };
219
- export declare type VouchersBulkUpdateResponse = {
220
- async_action_id: string;
221
- };
222
- export declare type GiftCardTransaction = GiftCardTransactionBase & GiftCardTransactionDetails;
223
- export interface GiftCardTransactionBase {
224
- id: string;
225
- source_id: string | null;
226
- voucher_id: string;
227
- campaign_id: string | null;
228
- related_transaction_id: string | null;
229
- reason: string | null;
230
- created_at: string;
231
- }
232
- export declare type GiftCardTransactionDetails = GiftCardTransactionRedemptionDetails | GiftCardTransactionRefundDetails | GiftCardTransactionAdditionDetails | GiftCardTransactionRemovalDetails;
233
- export interface GiftCardTransactionRedemptionDetails {
234
- source: null;
235
- type: 'CREDITS_REDEMPTION';
236
- details: {
237
- balance: {
238
- type: 'gift_voucher';
239
- total: number;
240
- amount: number;
241
- object: 'balance';
242
- balance: number;
243
- related_object: {
244
- id: string;
245
- type: 'voucher';
246
- };
247
- };
248
- order: {
249
- id: string;
250
- source_id: string | null;
251
- };
252
- redemption: {
253
- id: string;
254
- };
255
- };
256
- }
257
- export interface GiftCardTransactionRefundDetails {
258
- source: null;
259
- type: 'CREDITS_REFUND';
260
- details: {
261
- balance: {
262
- type: 'gift_voucher';
263
- total: number;
264
- amount: number;
265
- object: 'balance';
266
- balance: number;
267
- related_object: {
268
- id: string;
269
- type: 'voucher';
270
- };
271
- };
272
- order: {
273
- id: string;
274
- source_id: string | null;
275
- };
276
- redemption: {
277
- id: string;
278
- };
279
- rollback: {
280
- id: string;
281
- };
282
- };
283
- }
284
- export interface GiftCardTransactionAdditionDetails {
285
- source: 'voucherify-web-ui' | 'API';
286
- type: 'CREDITS_ADDITION';
287
- details: {
288
- balance: {
289
- type: 'gift_voucher';
290
- total: number;
291
- amount: number;
292
- object: 'balance';
293
- balance: number;
294
- operation_type: 'MANUAL' | 'AUTOMATIC';
295
- related_object: {
296
- id: string;
297
- type: 'voucher';
298
- };
299
- };
300
- };
301
- }
302
- export interface GiftCardTransactionRemovalDetails {
303
- source: 'voucherify-web-ui' | 'API';
304
- type: 'CREDITS_REMOVAL';
305
- details: {
306
- balance: {
307
- type: 'gift_voucher';
308
- total: number;
309
- amount: number;
310
- object: 'balance';
311
- balance: number;
312
- operation_type: 'MANUAL' | 'AUTOMATIC';
313
- related_object: {
314
- id: string;
315
- type: 'voucher';
316
- };
317
- };
318
- };
319
- }
320
- export declare type VoucherTransaction = GiftCardTransaction | LoyaltyCardTransaction;
321
- export declare type VoucherTransactionsExportFields = 'id' | 'campaign_id' | 'voucher_id' | 'type' | 'source_id' | 'reason' | 'source' | 'balance' | 'amount' | 'related_transaction_id' | 'created_at' | 'details';
322
- export interface VouchersListTransactionsRequestQuery {
323
- limit?: number;
324
- starting_after_id?: string;
325
- order?: 'id' | '-id';
326
- /**
327
- * @deprecated Use starting_after_id
328
- */
329
- page?: number;
330
- }
331
- export interface VouchersListTransactionsResponseBody {
332
- object: 'list';
333
- data_ref: 'data';
334
- data: VoucherTransaction[];
335
- has_more: boolean;
336
- more_starting_after?: string;
337
- }
338
- export interface VouchersExportTransactionsRequestBody {
339
- parameters?: {
340
- order?: '-created_at' | 'created_at';
341
- fields?: VoucherTransactionsExportFields[];
342
- };
343
- }
344
- export interface VouchersExportTransactionsResponseBody {
345
- id: string;
346
- status: 'SCHEDULED';
347
- channel: string;
348
- parameters: {
349
- order?: string;
350
- fields?: VoucherTransactionsExportFields[];
351
- filters: {
352
- voucher_id: {
353
- conditions: {
354
- $in: [string];
355
- };
356
- };
357
- };
358
- };
359
- result: null;
360
- user_id: string | null;
361
- exported_object: 'voucher_transactions';
362
- object: 'export';
363
- created_at: string;
364
- }