Commit 712502a
authored
v4.4.0: Customer Inventory Enhancements, Rule Failure Reasons and Import Endpoints (#20)
<i id="toc"></i>
## Summary
- [Management API](#user-content-management-api)
- [Expose Import Endpoints](#user-content-expose-import-endpoints)
- [Introduce `updateReferral` Endpoint](#user-content-update-referral)
- [Integration API](#user-content-integration-api)
- [Improve Responses Transparency](#user-content-improve-responses)
- [Extended Customer Inventory Endpoint](#user-content-customer-inventory)
- [Attach Loyalty Program ID in responses](#user-content-attach-loyalty-id)
- [A reminder of The Deprecation Notice: Integration API@v1 endpoints](#user-content-deprecation-reminder)
<i id="management-api"></i>
## Management API
<i id="expose-import-endpoints"></i>
### Expose import endpoints as integral part of the SDK
All of our CSV import endpoints are accessible via the Web Application from the corresponding entity pages (refer to our [Help Center](https://help.talon.one/hc/en-us/articles/360010114599-Import-and-Export-Coupons#ImportCoupons) for an example regarding Coupons).
Now these are also available endpoints as part of the SDK (links to our developer docs):
- [Coupons Import](https://developers.talon.one/Management-API/API-Reference#importCoupons)
- [Referrals Import](https://developers.talon.one/Management-API/API-Reference#importReferrals)
- [Loyalty Points Import](https://developers.talon.one/Management-API/API-Reference#importLoyaltyPoints)
- [Giveaway Codes Import](https://developers.talon.one/Management-API/API-Reference#importPoolGiveaways)
Example code snippet demonstrating import coupons using a CSV file:
```java
// ...preparing api client...
// An example could be seen at the repository's README file: https://github.com/talon-one/TalonOneJavaSdk#management-api
try {
Integer applicationId = 1;
Integer campaignId = 184;
File upFile = new File("path/to/coupons.csv");
ModelImport response = api.importCoupons(applicationId, campaignId, upFile);
} catch (FileNotFoundException e) {
System.out.println("CSV file was not found.");
e.printStackTrace();
} catch (Exception e) {
System.out.println("Error while importing coupons.");
System.out.println(e);
}
```
[☝️ Back to Table of Contents](#user-content-toc)
<i id="update-referral"></i>
### Introduce [`updateReferral`](https://developers.talon.one/Management-API/API-Reference#updateReferral) Endpoint
We introduced an endpoint to update referrals in order to allow updating their scheduling, usage limits and custom attributes attached to them.
Please consult [the endpoint reference](https://developers.talon.one/Management-API/API-Reference#updateReferral) in our developer docs for more details.
[☝️ Back to Table of Contents](#user-content-toc)
<i id="integration-api"></i>
## Integration API
<i id="improve-responses"></i>
### Improve Responses Transparency
We are constantly extending and improving our integration API to provide our consumers with the best transparency regarding what exactly has happened within their requests.
We have added new data points to our **v2 endpoints** effects in order to improve the transparency we aspire for:
- If an effect was triggered because of a specific coupon the effect will now include this coupon ID, see [`Effect.md`](https://github.com/talon-one/TalonOneJavaSdk/blob/e63620817d5e7bb07e0b6bd9ef515a6b38257524/docs/Effect.md#L15)
- When a coupon is rejected we attach more details regarding the origin of the failure in [`RejectCouponEffectProps`](https://github.com/talon-one/TalonOneJavaSdk/blob/1042bd65a2a48296d38591f652fa967fe096af1c/docs/RejectCouponEffectProps.md#L12-L14):
- `conditionIndex` - The index of the condition that caused the rejection of the coupon
- `effectIndex` - The index of the effect that caused the rejection of the coupon
- `details` - More details about the failure (if available)
- The same applies for referrals, when a referral is rejected we attach more details regarding the origin of the failure in [`RejectReferralEffectProps`](https://github.com/talon-one/TalonOneJavaSdk/blob/1042bd65a2a48296d38591f652fa967fe096af1c/docs/RejectReferralEffectProps.md#L12-L14):
- `conditionIndex` - The index of the condition that caused the rejection of the referral
- `effectIndex` - The index of the effect that caused the rejection of the referral
- `details` - More details about the failure (if available)
Moreover, we have introduced a new [response content](https://github.com/talon-one/TalonOneJavaSdk/blob/1042bd65a2a48296d38591f652fa967fe096af1c/src/main/java/one/talon/model/IntegrationRequest.java#L61), `RuleFailureReasons`, which when requested will attach to the response a collection containing **all failed rules**, with details (see the [`RuleFailureReason` model](https://github.com/talon-one/TalonOneJavaSdk/blob/1042bd65a2a48296d38591f652fa967fe096af1c/docs/RuleFailureReason.md) to help narrowing down failures and further debugging efforts to a specific single condition or effect that caused the failure.
_One "gotcha" to keep in mind_: in order to maximize transparency, and due to the fact that we do not know in advance which campaign in the application the request targets, the list contains a collection of **all** failure reasons.
Meaning that, it might have "white noise" with data about failures that could be considered as "obvious" to the consumer. Therefore, we suggest always filtering the list by the campaign id that was expected to trigger and did not.
[☝️ Back to Table of Contents](#user-content-toc)
<i id="customer-inventory"></i>
### Extended Customer Inventory Endpoint
We have added a couple of useful data points to our customer inventory to make integration even simpler.
#### 1 parent e636208 commit 712502a
File tree
221 files changed
+14903
-2430
lines changed- api
- docs
- src
- main/java/one/talon
- api
- model
- test/java/one/talon
- api
- model
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
221 files changed
+14903
-2430
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
Large diffs are not rendered by default.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
| 38 | + | |
37 | 39 | | |
38 | 40 | | |
39 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
0 commit comments