@voucherify/sdk 2.5.0 → 2.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,116 @@
1
1
  # @voucherify/sdk
2
2
 
3
+ ## 2.7.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`32fa44a`](https://github.com/voucherifyio/voucherify-js-sdk/commit/32fa44ab17b21bda9daf953eaf4969d528c2d707) [#255](https://github.com/voucherifyio/voucherify-js-sdk/pull/255) Thanks [@awilczek](https://github.com/awilczek)! - Update axios to 1.6.5 in SDK package
8
+
9
+ * [`8df2fed`](https://github.com/voucherifyio/voucherify-js-sdk/commit/8df2fed2b4319f681d0ff17b9bb15e6bbf80dd7c) [#254](https://github.com/voucherifyio/voucherify-js-sdk/pull/254) Thanks [@p-zielinski](https://github.com/p-zielinski)! - Add support for few endpoints of Loyalties API.
10
+ - Added support for new endpoints: `POST /v1/qualifications`, `POST /client/v1/qualifications` [(examples of usage available in readme.md)](..%2F..%2Fpackages%2Fsdk%2FREADME.md)
11
+ - New exported types/interfaces: `InapplicableTo`, `Referrer`, `ReferrerWithSummaryLoyaltyReferrals`, `Customer`, `CustomerWithSummaryLoyaltyReferrals`, `CustomerSummary`, `CustomerSummaryRedemptions`, `CustomerSummaryOrders`, `CustomerLoyalty`, `CustomerReferrals`, `Discount`, `DiscountAmount_`, `DiscountUnit_`, `DiscountUnitBase_`, `DiscountUnitMultiple_`, `DiscountPercent_`, `DiscountFixed_`, `Order`, `OrderItem`, `OrderCalculated`, `OrderRedemptions`, `OrderItemCalculated`, `QualificationsCheckEligibilityRequestBody`, `QualificationsCheckEligibilityResponseBody`, `QualificationsFiltersFields`, `QualificationsFiltersCondition`, `QualificationsFieldConditions`, `QualificationsRedeemablesResponse`, `QualificationsStackingRulesResponse`, `QualificationsRedeemable`, `QualificationsRedeemableBase`, `RedeemableSingleResultResponse`, `ValidationRulesAssignmentsList`,
12
+ - Added optional properties to `ApplicableTo`: `product_id`, `product_source_id`, `quantity_limit`, `aggregated_quantity_limit`, `amount_limit`, `aggregated_amount_limit`, `order_item_indices`
13
+ - Added required property: `data_ref: 'data'` to `ApplicableToResultList` // NOTE: as this type is only used in responses, this is not a breaking change.
14
+ - Added optional properties to `CustomerRequest`: `birthday` and `birthdate`
15
+
16
+ ## 2.6.0
17
+
18
+ ### Minor Changes
19
+
20
+ - [`8a3bead`](https://github.com/voucherifyio/voucherify-js-sdk/commit/8a3bead11809f676778d53dddd0ef49f6f17358d) [#252](https://github.com/voucherifyio/voucherify-js-sdk/pull/252) Thanks [@p-zielinski](https://github.com/p-zielinski)! - Added support for new endpoints and adding missing types in Rewards API.
21
+
22
+ Added support for new endpoints:
23
+
24
+ - `/loyalties/{campaignId}/rewards/{assignmentId}`,
25
+ - `/loyalties/{campaignId}/tiers/{tierId}/rewards`,
26
+ - `/rewards/{rewardId}/assignments/{assignmentId}` (example available in readme.md)
27
+
28
+ New exported types/interfaces in `Loyalties.ts`:
29
+ Domain types:
30
+
31
+ - LoyaltyTierRewardItemParameters,
32
+ - LoyaltyTierRewardItemCampaignParameters,
33
+ - LoyaltyTierRewardItemCoinParameters,
34
+ - LoyaltyTierRewardItemMaterialParameters,
35
+ - LoyaltyTierRewardItemCampaignDiscountCoupons,
36
+ - LoyaltyTierRewardItemCampaignGiftVouchersAndLoyaltyProgram
37
+
38
+ 0-level types:
39
+
40
+ - LoyaltiesGetRewardAssignmentResponseBody,
41
+ - LoyaltiesListLoyaltyTierRewardsResponseBody
42
+
43
+ New exported types/interfaces in `Rewards.ts`:
44
+ Domain types:
45
+
46
+ - RewardAssignment (old `RewardsAssignmentObject`),
47
+ - RewardsAssignmentCampaignOrMaterialReward,
48
+ - RewardsAssignmentCoinReward
49
+ -
50
+
51
+ 0-level types:
52
+
53
+ - RewardsListAssignmentsRequestQuery (old `RewardsListAssignmentsParams`),
54
+ - RewardsListAssignmentsResponseBody (old `RewardsListAssignmentsResponse`),
55
+ - RewardsCreateAssignmentRequestBody (old `RewardsCreateAssignment`),
56
+ - RewardsCreateAssignmentCoinRewardRequestBody,
57
+ - RewardsCreateAssignmentCampaignOrMaterialRewardRequestBody,
58
+ - RewardsCreateAssignmentResponseBody (old `RewardsCreateAssignmentResponse`),
59
+ - RewardsUpdateAssignmentRequestBody (old `RewardsUpdateAssignment`),
60
+ - RewardsUpdateAssignmentResponseBody (old `RewardsUpdateAssignmentResponse`)
61
+ - RewardsGetAssignmentResponseBody (brand new)
62
+
63
+ ***
64
+
65
+ Added support for following endpoints:
66
+
67
+ - GET /vouchers/{code}/transactions (client.vouchers.listTransactions(code, query))
68
+ - POST /vouchers/{code}/transactions/export (client.vouchers.exportTransactions(code, body))
69
+ - GET /validation-rules-assignments (client.client.validationRules.listRulesAssignments(validationRuleId))
70
+
71
+ **New exported types/interfaces**
72
+ Domain types:
73
+
74
+ - GiftCardTransaction
75
+ - GiftCardTransactionBase
76
+ GiftCardTransactionDetails
77
+ - GiftCardTransactionRedemptionDetails
78
+ - GiftCardTransactionRefundDetails
79
+ - GiftCardTransactionAdditionDetails
80
+ - GiftCardTransactionRemovalDetails
81
+ - VoucherTransaction
82
+ - VoucherTransactionsExportFields
83
+ - ValidationRulesAssignment
84
+
85
+ 0-level types:
86
+
87
+ - VouchersListTransactionsRequestQuery
88
+ - VouchersListTransactionsResponseBody
89
+ - VouchersExportTransactionsRequestBody
90
+ - VouchersExportTransactionsResponseBody
91
+ - ValidationRulesListRulesAssignmentsRequestQuery
92
+ - ValidationRulesListRulesAssignmentsResponseBody
93
+
94
+ **Other changes**
95
+
96
+ - Use `VouchersExportTransactionsRequestBody` as `LoyaltiesExportCardTransactionsRequestBody` (these types are identical, both related to the export of loyalty card transactions)
97
+ - Use `VouchersExportTransactionsResponseBody` as `LoyaltiesExportCardTransactionsResponseBody` (these types are identical, both related to the export of loyalty card transactions)
98
+
99
+ ***
100
+
101
+ New exported types/interfaces in `Categories.ts`:
102
+
103
+ - CategoriesListRequestQuery
104
+
105
+ Added support for query parameters(CategoriesListRequestQuery) in `/categories` (categories.list method)
106
+
107
+ ***
108
+
109
+ Add support for few endpoints of Loyalties API:
110
+
111
+ - Added support for new endpoints: `GET /promotions/{campaignId}/stacks`, `GET /promotions/{campaignId}/stacks`, `GET PUT DELETE /promotions/{campaignId}/stacks/{stackId}`, `GET /promotions/stacks` [(examples of usage available in readme.md)](..%2F..%2Fpackages%2Fsdk%2FREADME.md)
112
+ - New exported types/interfaces: `PromotionsStacksListInCampaignResponseBody`, `PromotionsStacksListResponseBody`, `PromotionsStacksListRequestQuery`, `PromotionsStacksGetResponseBody`, `PromotionsStacksUpdateRequestBody`, `PromotionsStacksUpdateResponseBody`, `PromotionsStacksCreateInCampaignRequestBody`, `PromotionsStacksCreateInCampaignResponseBody`, `PromotionStackBase`, `PromotionStack`
113
+
3
114
  ## 2.5.0
4
115
 
5
116
  ### Minor Changes
package/README.md CHANGED
@@ -155,6 +155,8 @@ Methods are provided within `client.vouchers.*` namespace.
155
155
  - [Update Vouchers in bulk](#update-vouchers-in-bulk)
156
156
  - [Release Validation Session](#release-validation-session)
157
157
  - [Import Vouchers using CSV](#import-vouchers-using-csv)
158
+ - [List Voucher Transactions](#list-voucher-transactions)
159
+ - [Export Voucher Transactions](#export-voucher-transactions)
158
160
 
159
161
  #### [Create Voucher](https://docs.voucherify.io/reference/create-voucher)
160
162
 
@@ -244,6 +246,18 @@ client.vouchers.releaseValidationSession(code, sessionKey)
244
246
  client.vouchers.importCSV(filePath)
245
247
  ```
246
248
 
249
+ #### [List Voucher Transactions](https://docs.voucherify.io/reference/list-voucher-transactions)
250
+
251
+ ```javascript
252
+ client.vouchers.listTransactions(code, query)
253
+ ```
254
+
255
+ #### [Export Voucher Transactions](https://docs.voucherify.io/reference/export-voucher-transactions)
256
+
257
+ ```javascript
258
+ client.vouchers.exportTransactions(code, body)
259
+ ```
260
+
247
261
  ---
248
262
 
249
263
  ### Campaigns
@@ -436,6 +450,20 @@ client.categories.list()
436
450
 
437
451
  ---
438
452
 
453
+ ### Qualifications
454
+
455
+ Methods are provided within `client.qualifications.*` or `client.promotions.*` namespace.
456
+
457
+ - [Check Eligibility](#Check-Eligibility)
458
+
459
+ #### [Check Eligibility](https://docs.voucherify.io/reference/check-eligibility)
460
+
461
+ ```javascript
462
+ client.qualifications.checkEligibility(body)
463
+ ```
464
+
465
+ ---
466
+
439
467
  ### Validations
440
468
 
441
469
  Methods are provided within `client.validations.*` or `client.promotions.*` namespace.
@@ -950,6 +978,7 @@ Methods are provided within `client.rewards.*` namespace.
950
978
  - [Update Reward](#update-reward)
951
979
  - [Delete Reward](#delete-reward)
952
980
  - [List Rewards](#list-rewards)
981
+ - [Get Assignment](#get-reward-assignment)
953
982
  - [Create Reward Assignment](#create-reward-assignment)
954
983
  - [Update Reward Assignment](#update-reward-assignment)
955
984
  - [Delete Reward Assignment](#delete-reward-assignment)
@@ -988,13 +1017,19 @@ client.rewards.list()
988
1017
  client.rewards.list(params)
989
1018
  ```
990
1019
 
1020
+ #### [Get Reward Assignment](https://docs.voucherify.io/reference/get-reward-assignment)
1021
+
1022
+ ```javascript
1023
+ client.rewards.getAssignment(rewardId, assignment)
1024
+ ```
1025
+
991
1026
  #### [Create Reward Assignment](https://docs.voucherify.io/reference/create-reward-assignment)
992
1027
 
993
1028
  ```javascript
994
1029
  client.rewards.createAssignment(rewardId, assignment)
995
1030
  ```
996
1031
 
997
- Check [reward assignment object](https://docs.voucherify.io/reference/the-reward-assignment-object).
1032
+ Check [reward assignment object](https://docs.voucherify.io/reference/reward-assignment-object).
998
1033
 
999
1034
  #### [Update Reward Assignment](https://docs.voucherify.io/reference/update-reward-assignment)
1000
1035
 
@@ -1029,6 +1064,7 @@ Methods are provided within `client.loyalties.*` namespace.
1029
1064
  - [Create Loyalty Program Reward Assignment](#create-loyalty-program-reward-assignment)
1030
1065
  - [Update Loyalty Program Reward Assignment](#update-loyalty-program-reward-assignment)
1031
1066
  - [Delete Loyalty Program Reward Assignment](#delete-loyalty-program-reward-assignment)
1067
+ - [Get Loyalty Program Reward Assignment](#get-loyalty-program-reward-assignment)
1032
1068
  - [List Loyalty Program Reward Assignments](#list-loyalty-program-reward-assignments)
1033
1069
  - [Create Loyalty Program Earning Rules](#create-loyalty-program-earning-rules)
1034
1070
  - [Update Loyalty Program Earning Rule](#update-loyalty-program-earning-rule)
@@ -1046,6 +1082,7 @@ Methods are provided within `client.loyalties.*` namespace.
1046
1082
  - [Transfer Loyalty Points](#transfer-loyalty-points)
1047
1083
  - [Get Loyalty Points Expiration](#get-loyalty-points-expiration)
1048
1084
  - [Redeem Loyalty Card](#redeem-loyalty-card)
1085
+ - [List Loyalty Tier Rewards](#list-loyalty-tier-rewards)
1049
1086
  - [List Loyalty Card Transactions](#list-loyalty-card-transactions)
1050
1087
  - [[Export Loyalty Card Transactions](#export-loyalty-card-transactions)
1051
1088
  - [Get Reward Assignment](#get-reward-assignment)
@@ -1105,6 +1142,13 @@ client.loyalties.updateRewardAssignment(campaignId, assignment)
1105
1142
  client.loyalties.deleteRewardAssignment(campaignId, assignmentId)
1106
1143
  ```
1107
1144
 
1145
+ #### [Get Loyalty Program Reward Assignment](https://docs.voucherify.io/reference/get-reward-assignment-2)
1146
+
1147
+ ```javascript
1148
+ client.loyalties.getRewardAssignment(campaignId, assignmentId)
1149
+ ```
1150
+
1151
+
1108
1152
  #### [List Loyalty Program Reward Assignments](https://docs.voucherify.io/reference/list-reward-assignments-1)
1109
1153
 
1110
1154
  ```javascript
@@ -1245,6 +1289,12 @@ client.loyalties.redeemReward(campaignId, memberId, params)
1245
1289
 
1246
1290
  When redeeming reward with type `COIN` you need to provide additional `order` object in the `params`
1247
1291
 
1292
+ #### [List Loyalty Tier Rewards](https://docs.voucherify.io/reference/list-loyalty-tier-rewards)
1293
+
1294
+ ```javascript
1295
+ client.loyalties.listLoyaltyTierRewards(campaignId, tierId)
1296
+ ```
1297
+
1248
1298
  ---
1249
1299
 
1250
1300
  #### [List Loyalty Card Transactions](https://docs.voucherify.io/reference/list-loyalty-card-transactions)
@@ -1372,7 +1422,8 @@ Methods are provided within `client.validationRules.*` namespace.
1372
1422
  - [Create Rule Assignment](#create-validation-rule-assignment)
1373
1423
  - [Delete Rule Assignment](#delete-validation-rule-assignment)
1374
1424
  - [List Rules](#list-validation-rules)
1375
- - [List Rule Assignments](#list-validation-rule-assignments)
1425
+ - [List Validation Rule Assignments](#list-validation-rule-assignments)
1426
+ - [List Validation Rules Assignments](#list-validation-rules-assignments)
1376
1427
 
1377
1428
  #### [Create Validation Rule](https://docs.voucherify.io/reference/create-validation-rules)
1378
1429
 
@@ -1426,6 +1477,13 @@ client.validationRules.listAssignments(validationRuleId)
1426
1477
  client.validationRules.listAssignments(validationRuleId, params)
1427
1478
  ```
1428
1479
 
1480
+ #### [List Validation Rules Assignments](https://docs.voucherify.io/reference/list-validation-rules-assignments)
1481
+
1482
+ ```javascript
1483
+ client.validationRules.listRulesAssignments(validationRuleId)
1484
+ client.validationRules.listRulesAssignments(validationRuleId, params)
1485
+ ```
1486
+
1429
1487
  ---
1430
1488
 
1431
1489
  ### Events
@@ -1562,6 +1620,7 @@ Methods are provided within `client.*` namespace.
1562
1620
  - [List consents](#list-consents)
1563
1621
  - [Update consents](#update-consents)
1564
1622
  - [Track custom events](#track-custom-events)
1623
+ - [Qualifications](#Qualifications)
1565
1624
 
1566
1625
  #### Set Identity
1567
1626
 
@@ -1634,6 +1693,12 @@ client.updateConsents(idOrSourceId, consents)
1634
1693
  client.track(eventName, metadata, customer)
1635
1694
  ```
1636
1695
 
1696
+ #### [Qualifications](https://docs.voucherify.io/reference/check-eligibility-client-side)
1697
+
1698
+ ```javascript
1699
+ client.qualifications(body)
1700
+ ```
1701
+
1637
1702
  # <a name="snippet"></a>🏎 Marketer-ready Voucherify snippet
1638
1703
 
1639
1704
  Go [here](./examples/sdk/with-html) for more HTML-based examples
@@ -6,7 +6,7 @@ export declare class Categories {
6
6
  /**
7
7
  * @see https://docs.voucherify.io/reference/list-categories
8
8
  */
9
- list(): Promise<T.ListCategories>;
9
+ list(params?: T.CategoriesListRequestQuery): Promise<T.ListCategories>;
10
10
  /**
11
11
  * @see https://docs.voucherify.io/reference/create-category
12
12
  */
@@ -1,4 +1,5 @@
1
1
  import * as T from './types/ClientSide';
2
+ import * as TQ from './types/Qualifications';
2
3
  import type { RequestController } from './RequestController';
3
4
  export declare class ClientSide {
4
5
  private client;
@@ -45,4 +46,8 @@ export declare class ClientSide {
45
46
  * @see https://docs.voucherify.io/reference/redeem-stackable-discounts-client-side
46
47
  */
47
48
  redeemStackable(params: T.ClientSideRedemptionsRedeemStackableParams): Promise<import("./types").RedemptionsRedeemStackableResponse>;
49
+ /**
50
+ * @see https://docs.voucherify.io/reference/check-eligibility
51
+ */
52
+ qualifications(body: TQ.QualificationsCheckEligibilityRequestBody): Promise<TQ.QualificationsCheckEligibilityResponseBody>;
48
53
  }
@@ -39,6 +39,10 @@ export declare class Loyalties {
39
39
  * @see https://docs.voucherify.io/reference/delete-reward-assignment-1
40
40
  */
41
41
  deleteRewardAssignment(campaignId: string, assignmentId: string): Promise<unknown>;
42
+ /**
43
+ * @see https://docs.voucherify.io/reference/get-reward-assignment-2
44
+ */
45
+ getRewardAssignment(campaignId: string, assignmentId: string): Promise<import("./types").RewardAssignment>;
42
46
  /**
43
47
  * @see https://docs.voucherify.io/reference/list-earning-rules
44
48
  */
@@ -110,6 +114,10 @@ export declare class Loyalties {
110
114
  * @see https://docs.voucherify.io/reference/redeem-loyalty-card
111
115
  */
112
116
  redeemReward(campaignId: string, memberId: string, params: T.LoyaltiesRedeemRewardParams): Promise<T.LoyaltiesRedeemRewardResponse>;
117
+ /**
118
+ * @see https://docs.voucherify.io/reference/list-loyalty-tier-rewards
119
+ */
120
+ listLoyaltyTierRewards(campaignId: string, tierId: string): Promise<T.LoyaltiesListLoyaltyTierRewardsResponseBody>;
113
121
  /**
114
122
  * @see https://docs.voucherify.io/reference/list-loyalty-card-transactions
115
123
  * @see https://docs.voucherify.io/reference/list-loyalty-card-transactions-1
@@ -119,11 +127,7 @@ export declare class Loyalties {
119
127
  * @see https://docs.voucherify.io/reference/export-loyalty-card-transactions
120
128
  * @see https://docs.voucherify.io/reference/export-loyalty-card-transactions-1
121
129
  */
122
- exportCardTransactions(memberId: string, campaignId: string | null, params?: T.LoyaltiesExportCardTransactionsRequestBody): Promise<T.LoyaltiesExportCardTransactionsResponseBody>;
123
- /**
124
- * @see https://docs.voucherify.io/reference/get-reward-assignment-1
125
- */
126
- getRewardAssignment(campaignId: string, assignmentId: string): Promise<import("./types").RewardAssignment>;
130
+ exportCardTransactions(memberId: string, campaignId: string | null, params?: T.LoyaltiesExportCardTransactionsRequestBody): Promise<import("./types").VouchersExportTransactionsResponseBody>;
127
131
  /**
128
132
  * @see https://docs.voucherify.io/reference/get-reward-details
129
133
  */
@@ -1,10 +1,12 @@
1
1
  import * as T from './types/Promotions';
2
2
  import type { RequestController } from './RequestController';
3
3
  import type { PromotionTiers } from './PromotionTiers';
4
+ import { PromotionsStacks } from './PromotionsStacks';
4
5
  export declare class Promotions {
5
6
  private client;
6
7
  tiers: PromotionTiers;
7
- constructor(client: RequestController, tiers: PromotionTiers);
8
+ stack: PromotionsStacks;
9
+ constructor(client: RequestController, tiers: PromotionTiers, stack: PromotionsStacks);
8
10
  /**
9
11
  * @see https://docs.voucherify.io/reference/create-promotion-campaign
10
12
  */
@@ -0,0 +1,30 @@
1
+ import * as T from './types/PromotionsStacks';
2
+ import type { RequestController } from './RequestController';
3
+ export declare class PromotionsStacks {
4
+ private client;
5
+ constructor(client: RequestController);
6
+ /**
7
+ * @see https://docs.voucherify.io/reference/list-promotion-stacks-in-campaign
8
+ */
9
+ listInCampaign(campaignId: string): Promise<T.PromotionsStacksListInCampaignResponseBody>;
10
+ /**
11
+ * @see https://docs.voucherify.io/reference/list-promotion-stacks-in-campaign
12
+ */
13
+ createInCampaign(campaignId: string, body: T.PromotionsStacksCreateInCampaignRequestBody): Promise<T.PromotionsStacksCreateInCampaignResponseBody>;
14
+ /**
15
+ * @see https://docs.voucherify.io/reference/delete-promotion-stack
16
+ */
17
+ delete(campaignId: string, stackId: string): Promise<{}>;
18
+ /**
19
+ * @see https://docs.voucherify.io/reference/get-promotion-stack
20
+ */
21
+ get(campaignId: string, stackId: string): Promise<T.PromotionStack>;
22
+ /**
23
+ * @see https://docs.voucherify.io/reference/update-promotion-stack
24
+ */
25
+ update(campaignId: string, stackId: string, body: T.PromotionsStacksUpdateRequestBody): Promise<T.PromotionsStacksUpdateResponseBody>;
26
+ /**
27
+ * @see https://docs.voucherify.io/reference/list-promotion-stacks-in-campaign
28
+ */
29
+ list(params?: T.PromotionsStacksListRequestQuery): Promise<T.PromotionsStacksListResponseBody>;
30
+ }
@@ -0,0 +1,10 @@
1
+ import * as T from './types/Qualifications';
2
+ import type { RequestController } from './RequestController';
3
+ export declare class Qualifications {
4
+ private client;
5
+ constructor(client: RequestController);
6
+ /**
7
+ * @see https://docs.voucherify.io/reference/check-eligibility
8
+ */
9
+ checkEligibility(body: T.QualificationsCheckEligibilityRequestBody): Promise<T.QualificationsCheckEligibilityResponseBody>;
10
+ }
package/dist/Rewards.d.ts CHANGED
@@ -23,17 +23,21 @@ export declare class Rewards {
23
23
  * @see https://docs.voucherify.io/reference/delete-reward
24
24
  */
25
25
  delete(rewardId: string): Promise<unknown>;
26
+ /**
27
+ * @see https://docs.voucherify.io/reference/get-reward-assignment
28
+ */
29
+ getAssignment(rewardId: string, assignmentId: string): Promise<T.RewardAssignment>;
26
30
  /**
27
31
  * @see https://docs.voucherify.io/reference/list-reward-assignments
28
32
  */
29
- listAssignments(rewardId: string, params?: T.RewardsListAssignmentsParams): Promise<T.RewardsListAssignmentsResponse>;
33
+ listAssignments(rewardId: string, params?: T.RewardsListAssignmentsRequestQuery): Promise<T.RewardsListAssignmentsResponseBody>;
30
34
  /**
31
35
  * @see https://docs.voucherify.io/reference/create-reward-assignment
32
36
  */
33
- createAssignment(rewardId: string, assignment: T.RewardsCreateAssignment): Promise<T.RewardsAssignmentObject>;
37
+ createAssignment(rewardId: string, assignment: T.RewardsCreateAssignmentRequestBody): Promise<T.RewardAssignment>;
34
38
  /**
35
39
  * @see https://docs.voucherify.io/reference/update-reward-assignment
36
40
  */
37
- updateAssignment(rewardId: string, assignment: T.RewardsUpdateAssignment): Promise<T.RewardsAssignmentObject>;
41
+ updateAssignment(rewardId: string, assignment: T.RewardsUpdateAssignmentRequestBody): Promise<T.RewardAssignment>;
38
42
  deleteAssignment(rewardId: string, assignmentId: string): Promise<unknown>;
39
43
  }
@@ -32,6 +32,10 @@ export declare class ValidationRules {
32
32
  * @see https://docs.voucherify.io/reference/list-validation-rules
33
33
  */
34
34
  list(params?: T.ValidationRulesListParams): Promise<T.ValidationRulesListResponse>;
35
+ /**
36
+ * @see https://docs.voucherify.io/reference/list-validation-rules-assignments
37
+ */
38
+ listRulesAssignments(params?: T.ValidationRulesListRulesAssignmentsRequestQuery): Promise<T.ValidationRulesListRulesAssignmentsResponseBody>;
35
39
  /**
36
40
  * @see https://docs.voucherify.io/reference/list-validation-rule-assignments
37
41
  */
@@ -18,6 +18,7 @@ import { ApiLimitsHandler } from './ApiLimitsHandler';
18
18
  import { MetadataSchemas } from './MetadataSchemas';
19
19
  import { Categories } from './Categories';
20
20
  import { ProductCollections } from './ProductCollections';
21
+ import { Qualifications } from './Qualifications';
21
22
  export interface VoucherifyServerSideOptions {
22
23
  /**
23
24
  * Optionally, you can add `apiUrl` to the client options if you want to use Voucherify running in a specific region.
@@ -118,6 +119,7 @@ export declare function VoucherifyServerSide(options: VoucherifyServerSideOption
118
119
  orders: Orders;
119
120
  products: Products;
120
121
  productCollections: ProductCollections;
122
+ qualifications: Qualifications;
121
123
  rewards: Rewards;
122
124
  loyalties: Loyalties;
123
125
  segments: Segments;
@@ -66,5 +66,13 @@ export declare class Vouchers {
66
66
  * @see https://docs.voucherify.io/reference/import-vouchers-using-csv
67
67
  */
68
68
  importCSV(filePath: string): Promise<AAT.AsyncActionCreateResponse>;
69
+ /**
70
+ * @see https://docs.voucherify.io/reference/list-voucher-transactions
71
+ */
72
+ listTransactions(code: string, params?: T.VouchersListTransactionsRequestQuery): Promise<T.VouchersListTransactionsResponseBody>;
73
+ /**
74
+ * @see https://docs.voucherify.io/reference/export-voucher-transactions
75
+ */
76
+ exportTransactions(code: string, body: T.VouchersExportTransactionsRequestBody): Promise<T.VouchersExportTransactionsResponseBody>;
69
77
  }
70
78
  export {};
package/dist/index.d.ts CHANGED
@@ -22,3 +22,4 @@ export type { ValidationRules } from './ValidationRules';
22
22
  export type { Validations } from './Validations';
23
23
  export type { VoucherifyError } from './VoucherifyError';
24
24
  export type { Vouchers } from './Vouchers';
25
+ export type { Qualifications } from './Qualifications';
@@ -3,13 +3,28 @@ export interface ApplicableTo {
3
3
  object: 'product' | 'sku' | 'products_collection';
4
4
  id: string;
5
5
  source_id?: string;
6
+ product_id?: string;
7
+ product_source_id?: string;
6
8
  strict: boolean;
7
9
  price?: number;
8
10
  price_formula?: number;
9
11
  effect: ApplicableToEffect;
12
+ quantity_limit?: number;
13
+ aggregated_quantity_limit?: number;
14
+ amount_limit?: number;
15
+ aggregated_amount_limit?: number;
16
+ order_item_indices?: number[];
10
17
  }
11
18
  export interface ApplicableToResultList {
12
19
  object: 'list';
13
20
  total: number;
14
21
  data: ApplicableTo[];
22
+ data_ref: 'data';
15
23
  }
24
+ export declare type InapplicableToResultList = {
25
+ data: InapplicableTo[];
26
+ total: number;
27
+ object: 'list';
28
+ data_ref: string;
29
+ };
30
+ export declare type InapplicableTo = ApplicableTo;
@@ -3,6 +3,7 @@ export interface ListCategories {
3
3
  data_ref: 'data';
4
4
  data: CategoryObject[];
5
5
  total: number;
6
+ has_more: boolean;
6
7
  }
7
8
  export declare type CategoryObject = ResponseCreateCategory & {
8
9
  updated_at?: string;
@@ -30,3 +31,7 @@ export declare type Category = {
30
31
  updated_at?: string;
31
32
  object: 'category';
32
33
  };
34
+ export declare type CategoriesListRequestQuery = {
35
+ limit?: number;
36
+ starting_after_id?: number;
37
+ };
@@ -65,9 +65,11 @@ export interface CustomerRequest {
65
65
  id?: string;
66
66
  source_id?: string;
67
67
  name?: string;
68
- email?: string;
69
- metadata?: Record<string, any>;
70
68
  description?: string;
69
+ email?: string;
70
+ phone?: string;
71
+ birthday?: string;
72
+ birthdate?: string;
71
73
  address?: {
72
74
  city?: string;
73
75
  state?: string;
@@ -76,7 +78,7 @@ export interface CustomerRequest {
76
78
  country?: string;
77
79
  postal_code?: string;
78
80
  };
79
- phone?: string;
81
+ metadata?: Record<string, any>;
80
82
  }
81
83
  export interface CustomersCommonListRequest {
82
84
  limit?: number;
@@ -142,6 +144,89 @@ declare type CustomerAddress = {
142
144
  postal_code?: string | null;
143
145
  } | null;
144
146
  };
147
+ export declare type Referrer = CustomerRequest;
148
+ export declare type Customer = CustomerRequest;
149
+ export declare type ReferrerWithSummaryLoyaltyReferrals = CustomerWithSummaryLoyaltyReferrals;
150
+ export declare type CustomerId = {
151
+ id: string;
152
+ object: 'customer';
153
+ };
154
+ export declare type ReferrerId = CustomerId;
155
+ export declare type CustomerWithSummaryLoyaltyReferrals = {
156
+ id?: string;
157
+ source_id?: string;
158
+ name?: string;
159
+ description?: string;
160
+ email?: string;
161
+ phone?: string;
162
+ birthday?: string;
163
+ birthdate?: string;
164
+ address: {
165
+ city?: string;
166
+ state?: string;
167
+ line_1?: string;
168
+ line_2?: string;
169
+ country?: string;
170
+ postal_code?: string;
171
+ } | null;
172
+ metadata?: Record<string, any>;
173
+ summary: CustomerSummary;
174
+ loyalty: CustomerLoyalty;
175
+ referrals: CustomerReferrals;
176
+ system_metadata: Record<string, unknown>;
177
+ created_at: string;
178
+ updated_at?: string;
179
+ assets?: {
180
+ cockpit_url?: string;
181
+ };
182
+ object: 'customer';
183
+ };
184
+ export declare type CustomerSummary = {
185
+ redemptions: CustomerSummaryRedemptions;
186
+ orders: CustomerSummaryOrders;
187
+ };
188
+ export declare type CustomerSummaryRedemptions = {
189
+ total_redeemed: number;
190
+ total_failed: number;
191
+ total_succeeded: number;
192
+ total_rolled_back: number;
193
+ total_rollback_failed: number;
194
+ total_rollback_succeeded: number;
195
+ gift: {
196
+ redeemed_amount: number;
197
+ amount_to_go: number;
198
+ };
199
+ loyalty_card: {
200
+ redeemed_points: number;
201
+ points_to_go: number;
202
+ };
203
+ };
204
+ export declare type CustomerSummaryOrders = {
205
+ total_amount: number;
206
+ total_count: number;
207
+ average_amount: number;
208
+ last_order_amount: number;
209
+ last_order_date: string;
210
+ };
211
+ export declare type CustomerLoyalty = {
212
+ points: number;
213
+ referred_customers: number;
214
+ campaigns: Record<string, {
215
+ points: number;
216
+ loyalty_tier: string;
217
+ referred_customers: number;
218
+ }>;
219
+ };
220
+ export declare type CustomerReferrals = {
221
+ total: number;
222
+ campaigns: {
223
+ campaign_id: string;
224
+ referrer_id: string;
225
+ related_object_id: string;
226
+ related_object_type: string;
227
+ date: string;
228
+ }[];
229
+ };
145
230
  export declare type CustomersUpdateInBulkRequestBody = (CustomerBase & CustomerAddress & {
146
231
  source_id: string | null;
147
232
  })[];