@voucherify/sdk 2.9.2 → 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 -663
  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 -16
  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,33 +0,0 @@
1
- interface MetadataSchemaProperty {
2
- type: string;
3
- array: boolean;
4
- deleted?: boolean;
5
- optional: boolean;
6
- objectType?: string;
7
- eq?: (string | number)[];
8
- ne?: (string | number)[];
9
- lt?: number;
10
- lte?: number;
11
- gt?: number;
12
- gte?: number;
13
- minLength?: number;
14
- maxLength?: number;
15
- exactLength?: number;
16
- }
17
- export interface MetadataSchema {
18
- id: string;
19
- related_object: string;
20
- properties: Record<string, MetadataSchemaProperty>;
21
- allow_defined_only?: boolean;
22
- created_at: string;
23
- updated_at?: string;
24
- object: 'metadata_schema';
25
- }
26
- export interface MetadataSchemasListResponse {
27
- object: 'list';
28
- total: number;
29
- data_ref: 'schemas';
30
- schemas: MetadataSchema[];
31
- }
32
- export declare type MetadataSchemasGetResponse = MetadataSchema;
33
- export {};
@@ -1,195 +0,0 @@
1
- import { Customer, CustomerId, CustomerRequest, CustomerWithSummaryLoyaltyReferrals, Referrer, ReferrerId, ReferrerWithSummaryLoyaltyReferrals } from './Customers';
2
- export interface OrdersItem {
3
- sku_id?: string;
4
- product_id?: string;
5
- related_object?: 'product' | 'sku';
6
- source_id?: string;
7
- discount_quantity?: number;
8
- initial_quantity?: number;
9
- quantity?: number;
10
- price?: number;
11
- amount?: number;
12
- discount_amount?: number;
13
- initial_amount?: number;
14
- applied_discount_amount?: number;
15
- subtotal_amount?: number;
16
- product?: {
17
- id?: string;
18
- source_id?: string;
19
- override?: boolean;
20
- name?: string;
21
- metadata?: Record<string, any>;
22
- price?: number;
23
- };
24
- sku?: {
25
- id?: string;
26
- source_id?: string;
27
- override?: boolean;
28
- sku?: string;
29
- price?: number;
30
- };
31
- object?: 'order_item';
32
- metadata?: Record<string, any>;
33
- }
34
- export interface OrdersCreate {
35
- source_id?: string;
36
- status?: 'CREATED' | 'PAID' | 'CANCELED' | 'FULFILLED';
37
- customer?: CustomerRequest;
38
- amount?: number;
39
- discount_amount?: number;
40
- items?: OrdersItem[];
41
- metadata?: Record<string, any>;
42
- }
43
- export interface OrdersCreateResponse {
44
- id: string;
45
- source_id?: string;
46
- created_at: string;
47
- updated_at?: string;
48
- status?: 'CREATED' | 'PAID' | 'PROCESSING' | 'CANCELED' | 'FULFILLED';
49
- amount?: number;
50
- initial_amount?: number;
51
- discount_amount?: number;
52
- items_discount_amount?: number;
53
- total_discount_amount?: number;
54
- applied_discount_amount?: number;
55
- items_applied_discount_amount?: number;
56
- total_amount?: number;
57
- total_applied_discount_amount?: number;
58
- items?: OrdersItem[];
59
- metadata?: Record<string, any>;
60
- customer?: CustomerRequest;
61
- object: 'order';
62
- }
63
- export declare type OrdersGetResponse = OrdersCreateResponse;
64
- export interface OrdersUpdate {
65
- id: string;
66
- source_id?: string;
67
- status?: 'CREATED' | 'PAID' | 'CANCELED' | 'FULFILLED';
68
- items?: OrdersItem[];
69
- amount?: number;
70
- discount_amount?: number;
71
- metadata?: Record<string, any>;
72
- customer?: {
73
- id: string;
74
- };
75
- }
76
- export declare type OrdersUpdateResponse = OrdersGetResponse;
77
- export interface OrdersListParams {
78
- limit?: number;
79
- page?: number;
80
- }
81
- export interface OrdersListResponse {
82
- object: 'list';
83
- total: number;
84
- data_ref: 'orders';
85
- orders: OrdersGetResponse[];
86
- }
87
- export declare type Order = {
88
- id?: string;
89
- source_id?: string;
90
- status?: 'CREATED' | 'PAID' | 'CANCELED' | 'FULFILLED';
91
- amount?: number;
92
- discount_amount?: number;
93
- initial_amount?: number;
94
- items?: OrderItem[];
95
- customer?: Customer;
96
- customer_id?: string;
97
- referrer?: Referrer;
98
- referrer_id?: string;
99
- metadata?: Record<string, any>;
100
- };
101
- export declare type OrderItem = {
102
- sku_id?: string;
103
- product_id?: string;
104
- related_object?: 'product' | 'sku';
105
- source_id?: string;
106
- quantity?: number;
107
- discount_quantity?: number;
108
- initial_quantity?: number;
109
- amount?: number;
110
- discount_amount?: number;
111
- initial_amount?: number;
112
- price?: number;
113
- product?: {
114
- id?: string;
115
- source_id?: string;
116
- override?: boolean;
117
- name?: string;
118
- metadata?: Record<string, any>;
119
- price?: number;
120
- };
121
- sku?: {
122
- id?: string;
123
- source_id?: string;
124
- override?: boolean;
125
- sku?: string;
126
- price?: number;
127
- };
128
- metadata?: Record<string, any>;
129
- };
130
- export declare type OrderCalculated = {
131
- id?: string;
132
- source_id?: string | null;
133
- created_at?: string;
134
- updated_at?: string | null;
135
- status?: 'CREATED' | 'PAID' | 'CANCELED' | 'FULFILLED';
136
- amount?: number;
137
- initial_amount?: number;
138
- discount_amount?: number;
139
- items_discount_amount?: number;
140
- total_discount_amount?: number;
141
- total_amount?: number;
142
- applied_discount_amount?: number;
143
- items_applied_discount_amount?: number;
144
- total_applied_discount_amount?: number;
145
- items?: OrderItemCalculated[];
146
- metadata?: Record<string, unknown>;
147
- customer?: CustomerId | CustomerWithSummaryLoyaltyReferrals;
148
- customer_id: string | null;
149
- referrer?: ReferrerId | ReferrerWithSummaryLoyaltyReferrals;
150
- referrer_id: string | null;
151
- object: 'order';
152
- redemptions?: Record<string, OrderRedemptions>;
153
- };
154
- export declare type OrderRedemptions = {
155
- date?: string;
156
- rollback_id?: string;
157
- rollback_date?: string;
158
- related_object_type?: string;
159
- related_object_id?: string;
160
- related_object_parent_id?: string;
161
- stacked?: string[];
162
- rollback_stacked?: string[];
163
- };
164
- export declare type OrderItemCalculated = {
165
- sku_id?: string;
166
- product_id?: string;
167
- related_object?: 'product' | 'sku';
168
- source_id?: string;
169
- quantity?: number;
170
- discount_quantity?: number;
171
- initial_quantity?: number;
172
- amount?: number;
173
- discount_amount?: number;
174
- initial_amount?: number;
175
- total_applied_discount_amount?: number;
176
- price?: number;
177
- subtotal_amount?: number;
178
- product?: {
179
- id?: string;
180
- source_id?: string;
181
- override?: boolean;
182
- name?: string;
183
- metadata?: Record<string, any>;
184
- price?: number;
185
- };
186
- sku?: {
187
- id?: string;
188
- source_id?: string;
189
- override?: boolean;
190
- sku?: string;
191
- price?: number;
192
- };
193
- object: 'order_item';
194
- metadata?: Record<string, any>;
195
- };
@@ -1,96 +0,0 @@
1
- import { WithRequiredProperty } from './UtilityTypes';
2
- export interface ProductIdentity {
3
- id?: string;
4
- object?: 'product';
5
- }
6
- export interface SkuIdentity {
7
- id?: string;
8
- product_id?: string;
9
- object?: 'sku';
10
- }
11
- export interface ProductBase {
12
- name?: string | null;
13
- price?: number | null;
14
- attributes?: string[];
15
- metadata?: Record<string, unknown>;
16
- }
17
- export interface SkuBase {
18
- sku?: string | null;
19
- price?: number | null;
20
- attributes?: Record<string, unknown>;
21
- metadata?: Record<string, unknown>;
22
- product?: Required<ProductIdentity> & Required<ProductBase> & {
23
- source_id: string | null;
24
- object: 'product';
25
- };
26
- image_url?: string | null;
27
- }
28
- export interface ProductSaved {
29
- created_at?: string;
30
- updated_at?: string | null;
31
- image_url?: string | null;
32
- object?: 'product';
33
- }
34
- export interface SkuSaved {
35
- created_at?: string;
36
- updated_at?: string | null;
37
- image_url?: string | null;
38
- object?: 'sku';
39
- }
40
- export declare type ProductOrSkuIdentity = Required<SkuIdentity> | Required<ProductIdentity>;
41
- export interface ProductCollectionIdentity {
42
- id?: string;
43
- }
44
- export interface ProductCollectionSaved {
45
- created_at?: string;
46
- object?: 'products_collection';
47
- }
48
- export declare type ProductCollectionBase = StaticProductCollectionBase | DynamicProductCollectionBase;
49
- export interface StaticProductCollectionBase {
50
- name?: string;
51
- type?: 'STATIC';
52
- products?: ProductOrSkuIdentity[];
53
- }
54
- export interface DynamicProductCollectionBase {
55
- name?: string;
56
- type?: 'AUTO_UPDATE';
57
- filter?: Filter;
58
- }
59
- export declare type ProductCollection = ProductCollectionBase & ProductCollectionIdentity & ProductCollectionSaved;
60
- export declare type Filter = Partial<Record<string, Junction | {
61
- conditions: Partial<Record<FiltersCondition, unknown>>;
62
- }>>;
63
- export declare type Junction = 'and' | 'AND' | 'or' | 'OR';
64
- /**
65
- * @deprecated
66
- */
67
- export declare type AllowedFiltersKeys = 'id' | 'name' | 'attributes' | 'source_id' | 'price' | 'image_url' | 'product_id' | 'skus' | 'created_at' | 'updated_at' | 'object' | `metadata.${string}`;
68
- export declare type FiltersCondition = '$in' | '$not_in' | '$is' | '$is_days_ago' | '$is_days_in_future' | '$is_not' | '$has_value' | '$is_unknown' | '$contains' | '$not_contain' | '$starts_with' | '$ends_with' | '$more_than' | '$less_than' | '$more_than_ago' | '$less_than_ago' | '$more_than_future' | '$less_than_future' | '$more_than_equal' | '$less_than_equal' | '$after' | '$before' | '$count' | '$count_less' | '$count_more';
69
- export declare type ProductCollectionsCreateRequestBody = WithRequiredProperty<StaticProductCollectionBase, 'name' | 'type'> | Required<DynamicProductCollectionBase>;
70
- export declare type ProductCollectionsCreateResponseBody = Required<ProductCollectionBase> & Required<ProductCollectionIdentity> & Required<ProductCollectionSaved>;
71
- export interface ProductCollectionsListRequestQuery {
72
- limit?: number;
73
- page?: number;
74
- order?: 'created_at' | '-created_at';
75
- }
76
- export interface ProductCollectionsListResponseBody {
77
- object: 'list';
78
- data_ref: 'data';
79
- data: Required<ProductCollection>[];
80
- total: number;
81
- }
82
- export declare type ProductCollectionsGetResponseBody = Required<ProductCollection>;
83
- export interface ProductCollectionsListProductsRequestQuery {
84
- limit?: number;
85
- page?: number;
86
- }
87
- export interface ProductCollectionsListProductsResponseBody {
88
- object: 'list';
89
- data_ref: 'data';
90
- data: ((Required<SkuIdentity> & Required<SkuSaved> & Required<SkuBase> & {
91
- source_id: string | null;
92
- }) | (Required<ProductIdentity> & Required<ProductSaved> & Required<ProductBase> & {
93
- source_id: string | null;
94
- }))[];
95
- total: number;
96
- }
@@ -1,106 +0,0 @@
1
- export interface ProductsCreate {
2
- name?: string;
3
- source_id?: string;
4
- price?: number;
5
- attributes?: string[];
6
- metadata?: Record<string, any>;
7
- image_url?: string;
8
- }
9
- export interface ProductsGetResponseSkus {
10
- skus?: {
11
- object: 'list';
12
- total: number;
13
- data?: ProductsGetSkuResponse[];
14
- };
15
- }
16
- export interface ProductsCreateResponse {
17
- id: string;
18
- source_id?: string;
19
- object: 'product';
20
- name?: string;
21
- price?: number;
22
- attributes?: string[];
23
- created_at: string;
24
- image_url?: string;
25
- metadata?: Record<string, any>;
26
- }
27
- export declare type ProductsGetResponse = ProductsCreateResponse & ProductsGetResponseSkus;
28
- export declare type ProductsUpdate = {
29
- name?: string;
30
- id?: string;
31
- source_id?: string;
32
- attributes?: string[];
33
- price?: number;
34
- image_url?: string;
35
- metadata?: Record<string, any>;
36
- };
37
- export declare type ProductsUpdateResponse = ProductsCreateResponse;
38
- export interface ProductsBulkUpdateMetadata {
39
- source_ids: string[];
40
- metadata: Record<string, any>;
41
- }
42
- export declare type ProductsBulkUpdate = ProductsCreate[];
43
- export declare type ProductsBulkUpdateResponse = {
44
- async_action_id: string;
45
- };
46
- export declare type ProductsBulkUpdateMetadataResponse = {
47
- async_action_id: string;
48
- };
49
- export interface ProductsDeleteParams {
50
- force?: boolean;
51
- }
52
- export interface ProductsListParams {
53
- page?: number;
54
- limit?: number;
55
- }
56
- export interface ProductsListResponse {
57
- object: 'list';
58
- total: number;
59
- data_ref: 'products';
60
- products: ProductsGetResponse[];
61
- }
62
- export interface ProductsCreateSku {
63
- sku: string;
64
- source_id?: string;
65
- attributes?: Record<string, string>;
66
- metadata?: Record<string, any>;
67
- price?: number;
68
- image_url?: string;
69
- currency?: string;
70
- }
71
- export interface ProductsCreateSkuResponse {
72
- id: string;
73
- source_id?: string;
74
- sku?: string;
75
- price?: number;
76
- attributes?: Record<string, string>;
77
- metadata?: Record<string, any>;
78
- updated_at?: string;
79
- currency?: string;
80
- created_at: string;
81
- object: 'sku';
82
- }
83
- export declare type ProductsGetSkuResponse = ProductsCreateSkuResponse;
84
- export declare type ProductsUpdateSku = ProductsCreateSku & {
85
- id?: string;
86
- source_id?: string;
87
- };
88
- export declare type ProductsUpdateSkuResponse = ProductsGetSkuResponse;
89
- export interface ProductsDeleteSkuParams {
90
- force?: boolean;
91
- }
92
- export interface ProductsListSkus {
93
- object: 'list';
94
- total: number;
95
- skus: ProductsGetSkuResponse[];
96
- }
97
- export interface SimpleProduct {
98
- id: string;
99
- source_id?: string;
100
- name?: string;
101
- }
102
- export interface SimpleSku {
103
- id: string;
104
- source_id?: string;
105
- sku?: string;
106
- }
@@ -1,127 +0,0 @@
1
- import { DiscountAmount, DiscountPercent, DiscountUnit, DiscountFixed } from './DiscountVoucher';
2
- import { OrdersCreateResponse, OrdersItem } from './Orders';
3
- import { SimpleCustomer } from './Customers';
4
- import { ValidationRulesListAssignmentsResponse } from './ValidationRules';
5
- import { ValidationSessionReleaseParams } from './ValidateSession';
6
- export interface SimplePromotionTier {
7
- tracking_id: string;
8
- metadata?: Record<string, any>;
9
- valid: boolean;
10
- id: string;
11
- name: string;
12
- banner?: string;
13
- discount: DiscountUnit | DiscountPercent | DiscountAmount | DiscountFixed;
14
- hierarchy: number;
15
- object: 'promotion_tier';
16
- }
17
- export interface PromotionTier {
18
- id: string;
19
- object: 'promotion_tier';
20
- name: string;
21
- banner?: string;
22
- campaign: {
23
- id: string;
24
- object: 'campaign';
25
- start_date?: string;
26
- expiration_date?: string;
27
- active: boolean;
28
- };
29
- validation_rule_assignments: ValidationRulesListAssignmentsResponse;
30
- action: {
31
- discount: DiscountUnit | DiscountPercent | DiscountAmount | DiscountFixed;
32
- };
33
- hierarchy: number;
34
- metadata?: Record<string, any>;
35
- active?: boolean;
36
- }
37
- export interface PromotionTiersListAllParams {
38
- is_available?: boolean;
39
- limit?: number;
40
- page?: number;
41
- }
42
- export interface PromotionTiersListAllResponse {
43
- object: 'list';
44
- data_ref: 'tiers';
45
- tiers: PromotionTier[];
46
- has_more: boolean;
47
- }
48
- export declare type PromotionTiersListResponse = PromotionTiersListAllResponse;
49
- export declare type PromotionTierGetResponse = PromotionTier;
50
- export interface PromotionTiersCreateParams {
51
- name?: string;
52
- banner?: string;
53
- action?: {
54
- discount?: DiscountUnit | DiscountPercent | DiscountAmount | DiscountFixed;
55
- };
56
- metadata?: Record<string, any>;
57
- }
58
- export declare type PromotionTiersCreateResponse = PromotionTier;
59
- export interface PromotionTiersRedeemParams {
60
- customer?: Omit<SimpleCustomer, 'object'> & {
61
- description?: string;
62
- };
63
- order?: {
64
- id?: string;
65
- source_id?: string;
66
- amount?: number;
67
- items?: OrdersItem[];
68
- status?: 'CREATED' | 'PAID' | 'CANCELED' | 'FULFILLED';
69
- metadata?: Record<string, any>;
70
- };
71
- metadata?: Record<string, any>;
72
- session?: ValidationSessionReleaseParams;
73
- }
74
- export interface PromotionTiersRedeemResponse {
75
- id: string;
76
- object: 'redemption';
77
- date: string;
78
- customer_id?: string;
79
- tracking_id?: string;
80
- order: Omit<OrdersCreateResponse, 'object' | 'customer'> & {
81
- customer: {
82
- id: string;
83
- object: 'customer';
84
- referrals: {
85
- campaigns: any[];
86
- total: number;
87
- };
88
- };
89
- total_discount_amount?: number;
90
- total_amount?: number;
91
- };
92
- result?: string;
93
- promotion_tier: PromotionTier & {
94
- summary: {
95
- redemptions: {
96
- total_redeemed: number;
97
- };
98
- orders: {
99
- total_amount: number;
100
- total_discount_amount: number;
101
- };
102
- };
103
- };
104
- }
105
- export interface PromotionTierRedeemDetailsSimple {
106
- id: string;
107
- name: string;
108
- banner?: string;
109
- campaign: {
110
- id: string;
111
- };
112
- }
113
- export declare type PromotionTierRedeemDetails = PromotionTier & {
114
- summary: {
115
- redemptions: {
116
- total_redeemed: number;
117
- };
118
- orders: {
119
- total_amount: number;
120
- total_discount_amount: number;
121
- };
122
- };
123
- };
124
- export declare type PromotionTiersUpdateParams = PromotionTiersCreateParams & {
125
- id: string;
126
- };
127
- export declare type PromotionTiersUpdateResponse = PromotionTier;
@@ -1,108 +0,0 @@
1
- import { DiscountAmount, DiscountPercent, DiscountUnit, DiscountFixed } from './DiscountVoucher';
2
- import { OrdersItem } from './Orders';
3
- import { PromotionTier } from './PromotionTiers';
4
- import { SimpleCustomer } from './Customers';
5
- import { ValidationRulesCreateAssignmentResponse } from './ValidationRules';
6
- export interface PromotionsCreateResponse {
7
- id: string;
8
- name: string;
9
- campaign_type?: 'PROMOTION';
10
- type: 'STATIC';
11
- description?: string;
12
- start_date?: string;
13
- expiration_date?: string;
14
- promotion: {
15
- object: 'list';
16
- data_ref: 'tiers';
17
- tiers?: PromotionTier[];
18
- has_more: boolean;
19
- };
20
- category?: string;
21
- auto_join: boolean;
22
- join_once: boolean;
23
- validation_rules_assignments: {
24
- data?: ValidationRulesCreateAssignmentResponse[];
25
- object: 'list';
26
- total: number;
27
- data_ref: 'data';
28
- };
29
- activity_duration_after_publishing?: string;
30
- validity_timeframe?: {
31
- interval?: string;
32
- duration?: string;
33
- };
34
- validity_day_of_week?: number[];
35
- metadata?: Record<string, string>;
36
- created_at: string;
37
- vouchers_generation_status: 'DONE';
38
- active: boolean;
39
- use_voucher_metadata_schema: boolean;
40
- protected: boolean;
41
- object: 'campaign';
42
- }
43
- export interface PromotionsCreate {
44
- name: string;
45
- campaign_type: 'PROMOTION';
46
- start_date?: string;
47
- expiration_date?: string;
48
- promotion?: {
49
- tiers: {
50
- name: string;
51
- banner: string;
52
- action: {
53
- discount: DiscountUnit | DiscountAmount | DiscountPercent | DiscountFixed;
54
- };
55
- metadata?: Record<string, any>;
56
- }[];
57
- };
58
- }
59
- export interface PromotionsValidateParams {
60
- customer?: Omit<SimpleCustomer, 'id' | 'object'> & {
61
- description?: string;
62
- id?: string;
63
- };
64
- order?: {
65
- id?: string;
66
- source_id?: string;
67
- items?: OrdersItem[];
68
- amount?: number;
69
- metadata?: Record<string, any>;
70
- };
71
- metadata?: Record<string, any>;
72
- }
73
- export interface PromotionsValidateQueryParams {
74
- audienceRulesOnly?: boolean;
75
- filters?: Record<string, any>;
76
- }
77
- export interface PromotionsValidateResponse {
78
- valid: boolean;
79
- promotions?: {
80
- id: string;
81
- object: 'promotion_tier';
82
- banner?: string;
83
- name: string;
84
- start_date?: string;
85
- expiration_date?: string;
86
- discount?: DiscountUnit | DiscountAmount | DiscountPercent | DiscountFixed;
87
- discount_amount?: number;
88
- applied_discount_amount?: number;
89
- metadata?: Record<string, any>;
90
- order?: {
91
- id?: string;
92
- source_id?: string;
93
- amount: number;
94
- initial_amount?: number;
95
- items_discount_amount?: number;
96
- items_applied_discount_amount?: number;
97
- items?: OrdersItem[];
98
- metadata?: Record<string, any>;
99
- discount_amount?: number;
100
- total_discount_amount?: number;
101
- total_amount?: number;
102
- applied_discount_amount?: number;
103
- total_applied_discount_amount?: number;
104
- };
105
- hierarchy?: number;
106
- }[];
107
- tracking_id?: string;
108
- }