Skip to content

Commit 9197865

Browse files
authored
V4.1.0: Dry Runs & Coupons discount limits (#14)
- Introduce "dry runs" for Integration API endpoints (See more details below) - Add support to retrieve coupons as part of requesting customer profile inventories - Add support for setting the `discountLimit` when creating or editing coupons ### Introduce "dry runs" for Integration API endpoints You can read more about the concept and where this feature could apply in your integration and workflow in our developers documentation center: https://developers.talon.one/Integration-API/dry-requests **Please Notice** that all current integration request operations (`trackEvent`, `updateCustomerProfile`, `updateCustomerSession`, `updateCustomerSessionV2` ) expects a boolean flag to determine whether this request is a dry run or not. See code examples in the [README.md](https://github.com/talon-one/TalonOneJavaSdk/blob/v4.1.0/README.md#v1) as for reference. Commit Summary ============= * Initial Commit v4.1.0 * Update readme examples to support the new dry-run parameter
1 parent bac5412 commit 9197865

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+1406
-845
lines changed

README.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Add this dependency to your project's POM:
4949
<dependency>
5050
<groupId>one.talon</groupId>
5151
<artifactId>talon-one-client</artifactId>
52-
<version>4.0.0</version>
52+
<version>4.1.0</version>
5353
<scope>compile</scope>
5454
</dependency>
5555
```
@@ -59,7 +59,7 @@ Add this dependency to your project's POM:
5959
Add this dependency to your project's build file:
6060

6161
```groovy
62-
compile "one.talon:talon-one-client:4.0.0"
62+
compile "one.talon:talon-one-client:4.1.0"
6363
```
6464

6565
### Others
@@ -72,7 +72,7 @@ mvn clean package
7272

7373
Then manually install the following JARs:
7474

75-
* `target/talon-one-client-4.0.0.jar`
75+
* `target/talon-one-client-4.1.0.jar`
7676
* `target/lib/*.jar`
7777

7878
## Getting Started
@@ -124,8 +124,11 @@ public class TalonApiTest {
124124
IntegrationRequest.ResponseContentEnum.CUSTOMERPROFILE
125125
));
126126

127+
// Flag to communicate whether the request is a "dry run"
128+
Boolean dryRun = false;
129+
127130
// Create/update a customer session using `updateCustomerSessionV2` function
128-
IntegrationStateV2 is = iApi.updateCustomerSessionV2("deetdoot", request);
131+
IntegrationStateV2 is = iApi.updateCustomerSessionV2("deetdoot", request, dryRun);
129132
System.out.println(is.toString());
130133

131134
// Parsing the returned effects list, please consult https://developers.talon.one/Integration-API/handling-effects-v2 for the full list of effects and their corresponding properties
@@ -179,8 +182,11 @@ public class TalonApiTest {
179182
customerSession.setState(NewCustomerSession.StateEnum.OPEN);
180183
customerSession.setTotal(new java.math.BigDecimal("42.0"));
181184

185+
// Flag to communicate whether the request is a "dry run"
186+
Boolean dryRun = false;
187+
182188
// Create/update a customer session using `updateCustomerSession` function
183-
IntegrationState ie = iApi.updateCustomerSession("deetdoot", customerSession);
189+
IntegrationState ie = iApi.updateCustomerSession("deetdoot", customerSession, dryRun);
184190
System.out.println(ie.toString());
185191
} catch (Exception e) {
186192
System.out.println(e);
@@ -239,10 +245,10 @@ Class | Method | HTTP request | Description
239245
*IntegrationApi* | [**deleteCouponReservation**](docs/IntegrationApi.md#deleteCouponReservation) | **DELETE** /v1/coupon_reservations/{couponValue} | Delete coupon reservations
240246
*IntegrationApi* | [**deleteCustomerData**](docs/IntegrationApi.md#deleteCustomerData) | **DELETE** /v1/customer_data/{integrationId} | Delete the personal data of a customer.
241247
*IntegrationApi* | [**getCustomerInventory**](docs/IntegrationApi.md#getCustomerInventory) | **GET** /v1/customer_profiles/{integrationId}/inventory | Get an inventory of all data associated with a specific customer profile.
242-
*IntegrationApi* | [**getReservedCoupons**](docs/IntegrationApi.md#getReservedCoupons) | **GET** /v1/coupon_reservations/coupons/{integrationId} | Get all valid reserved coupons
243248
*IntegrationApi* | [**getReservedCustomers**](docs/IntegrationApi.md#getReservedCustomers) | **GET** /v1/coupon_reservations/customerprofiles/{couponValue} | Get the users that have this coupon reserved
244249
*IntegrationApi* | [**trackEvent**](docs/IntegrationApi.md#trackEvent) | **POST** /v1/events | Track an Event
245250
*IntegrationApi* | [**updateCustomerProfile**](docs/IntegrationApi.md#updateCustomerProfile) | **PUT** /v1/customer_profiles/{integrationId} | Update a Customer Profile
251+
*IntegrationApi* | [**updateCustomerProfileV2**](docs/IntegrationApi.md#updateCustomerProfileV2) | **PUT** /v2/customer_profiles/{customerProfileId} | Update a Customer Profile
246252
*IntegrationApi* | [**updateCustomerSession**](docs/IntegrationApi.md#updateCustomerSession) | **PUT** /v1/customer_sessions/{customerSessionId} | Update a Customer Session
247253
*IntegrationApi* | [**updateCustomerSessionV2**](docs/IntegrationApi.md#updateCustomerSessionV2) | **PUT** /v2/customer_sessions/{customerSessionId} | Update a Customer Session
248254
*ManagementApi* | [**addLoyaltyPoints**](docs/ManagementApi.md#addLoyaltyPoints) | **PUT** /v1/loyalty_programs/{programID}/profile/{integrationID}/add_points | Add points in a certain loyalty program for the specified customer
@@ -283,7 +289,6 @@ Class | Method | HTTP request | Description
283289
*ManagementApi* | [**getCampaign**](docs/ManagementApi.md#getCampaign) | **GET** /v1/applications/{applicationId}/campaigns/{campaignId} | Get a Campaign
284290
*ManagementApi* | [**getCampaignAnalytics**](docs/ManagementApi.md#getCampaignAnalytics) | **GET** /v1/applications/{applicationId}/campaigns/{campaignId}/analytics | Get analytics of campaigns
285291
*ManagementApi* | [**getCampaignByAttributes**](docs/ManagementApi.md#getCampaignByAttributes) | **POST** /v1/applications/{applicationId}/campaigns_search | Get a list of all campaigns that match the given attributes
286-
*ManagementApi* | [**getCampaignSet**](docs/ManagementApi.md#getCampaignSet) | **GET** /v1/applications/{applicationId}/campaign_set | List CampaignSet
287292
*ManagementApi* | [**getCampaigns**](docs/ManagementApi.md#getCampaigns) | **GET** /v1/applications/{applicationId}/campaigns | List your Campaigns
288293
*ManagementApi* | [**getChanges**](docs/ManagementApi.md#getChanges) | **GET** /v1/changes | Get audit log for an account
289294
*ManagementApi* | [**getCoupons**](docs/ManagementApi.md#getCoupons) | **GET** /v1/applications/{applicationId}/campaigns/{campaignId}/coupons | List Coupons
@@ -323,7 +328,6 @@ Class | Method | HTTP request | Description
323328
*ManagementApi* | [**updateAdditionalCost**](docs/ManagementApi.md#updateAdditionalCost) | **PUT** /v1/additional_costs/{additionalCostId} | Update an additional cost
324329
*ManagementApi* | [**updateAttribute**](docs/ManagementApi.md#updateAttribute) | **PUT** /v1/attributes/{attributeId} | Update a custom attribute
325330
*ManagementApi* | [**updateCampaign**](docs/ManagementApi.md#updateCampaign) | **PUT** /v1/applications/{applicationId}/campaigns/{campaignId} | Update a Campaign
326-
*ManagementApi* | [**updateCampaignSet**](docs/ManagementApi.md#updateCampaignSet) | **PUT** /v1/applications/{applicationId}/campaign_set | Update a Campaign Set
327331
*ManagementApi* | [**updateCoupon**](docs/ManagementApi.md#updateCoupon) | **PUT** /v1/applications/{applicationId}/campaigns/{campaignId}/coupons/{couponId} | Update a Coupon
328332
*ManagementApi* | [**updateCouponBatch**](docs/ManagementApi.md#updateCouponBatch) | **PUT** /v1/applications/{applicationId}/campaigns/{campaignId}/coupons | Update a Batch of Coupons
329333
*ManagementApi* | [**updateRuleset**](docs/ManagementApi.md#updateRuleset) | **PUT** /v1/applications/{applicationId}/campaigns/{campaignId}/rulesets/{rulesetId} | Update a Ruleset
@@ -385,6 +389,7 @@ Class | Method | HTTP request | Description
385389
- [CustomerInventory](docs/CustomerInventory.md)
386390
- [CustomerProfile](docs/CustomerProfile.md)
387391
- [CustomerProfileSearchQuery](docs/CustomerProfileSearchQuery.md)
392+
- [CustomerProfileUpdate](docs/CustomerProfileUpdate.md)
388393
- [CustomerSession](docs/CustomerSession.md)
389394
- [CustomerSessionV2](docs/CustomerSessionV2.md)
390395
- [DeductLoyaltyPointsEffectProps](docs/DeductLoyaltyPointsEffectProps.md)

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apply plugin: 'eclipse'
33
apply plugin: 'java'
44

55
group = 'one.talon'
6-
version = '4.0.0'
6+
version = '4.1.0'
77

88
buildscript {
99
repositories {

build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ lazy val root = (project in file(".")).
22
settings(
33
organization := "one.talon",
44
name := "talon-one-client",
5-
version := "4.0.0",
5+
version := "4.1.0",
66
scalaVersion := "2.11.4",
77
scalacOptions ++= Seq("-feature"),
88
javacOptions in compile ++= Seq("-Xlint:deprecation"),

docs/Application.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Name | Type | Description | Notes
1818
**caseSensitivity** | [**CaseSensitivityEnum**](#CaseSensitivityEnum) | A string indicating how should campaigns in this application deal with case sensitivity on coupon codes. | [optional]
1919
**attributes** | [**Object**](.md) | Arbitrary properties associated with this campaign | [optional]
2020
**limits** | [**List&lt;LimitConfig&gt;**](LimitConfig.md) | Default limits for campaigns created in this application | [optional]
21+
**campaignPriority** | [**CampaignPriorityEnum**](#CampaignPriorityEnum) | Default priority for campaigns created in this application, can be one of (universal, stackable, exclusive) | [optional]
2122
**attributesSettings** | [**AttributesSettings**](AttributesSettings.md) | | [optional]
2223
**loyaltyPrograms** | [**List&lt;LoyaltyProgram&gt;**](LoyaltyProgram.md) | An array containing all the loyalty programs to which this application is subscribed |
2324

@@ -33,3 +34,13 @@ INSENSITIVE_LOWERCASE | &quot;insensitive-lowercase&quot;
3334

3435

3536

37+
## Enum: CampaignPriorityEnum
38+
39+
Name | Value
40+
---- | -----
41+
UNIVERSAL | &quot;universal&quot;
42+
STACKABLE | &quot;stackable&quot;
43+
EXCLUSIVE | &quot;exclusive&quot;
44+
45+
46+

docs/ApplicationSession.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Name | Type | Description | Notes
1818
**state** | [**StateEnum**](#StateEnum) | Indicating if the customer session is in progress (\&quot;open\&quot;), \&quot;closed\&quot;, or \&quot;cancelled\&quot;. |
1919
**cartItems** | [**List&lt;CartItem&gt;**](CartItem.md) | Serialized JSON representation. |
2020
**discounts** | [**Map&lt;String, BigDecimal&gt;**](BigDecimal.md) | A map of labelled discount values, in the same currency as the session. |
21-
**total** | [**BigDecimal**](BigDecimal.md) | The total sum of the session before any discounts applied. | [optional]
21+
**total** | [**BigDecimal**](BigDecimal.md) | The total sum of the session before any discounts applied. |
2222
**attributes** | [**Object**](.md) | Arbitrary properties associated with this item | [optional]
2323

2424

docs/CampaignSet.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Name | Type | Description | Notes
1010
**id** | **Integer** | Unique ID for this entity. |
1111
**created** | [**OffsetDateTime**](OffsetDateTime.md) | The exact moment this entity was created. |
1212
**applicationId** | **Integer** | The ID of the application that owns this entity. |
13+
**version** | **Integer** | Version of the campaign set |
1314
**set** | [**CampaignSetBranchNode**](CampaignSetBranchNode.md) | |
1415

1516

docs/Coupon.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,15 @@ Name | Type | Description | Notes
1212
**campaignId** | **Integer** | The ID of the campaign that owns this entity. |
1313
**value** | **String** | The actual coupon code. |
1414
**usageLimit** | **Integer** | The number of times a coupon code can be redeemed. This can be set to 0 for no limit, but any campaign usage limits will still apply. |
15+
**discountLimit** | [**BigDecimal**](BigDecimal.md) | The amount of discounts that can be given with this coupon code. | [optional]
1516
**startDate** | [**OffsetDateTime**](OffsetDateTime.md) | Timestamp at which point the coupon becomes valid. | [optional]
1617
**expiryDate** | [**OffsetDateTime**](OffsetDateTime.md) | Expiry date of the coupon. Coupon never expires if this is omitted, zero, or negative. | [optional]
1718
**usageCounter** | **Integer** | The number of times this coupon has been successfully used. |
19+
**discountCounter** | [**BigDecimal**](BigDecimal.md) | The amount of discounts given on rules redeeming this coupon. Only usable if a coupon discount budget was set for this coupon. | [optional]
20+
**discountRemainder** | [**BigDecimal**](BigDecimal.md) | The remaining discount this coupon can give. | [optional]
1821
**attributes** | [**Object**](.md) | Arbitrary properties associated with this item | [optional]
1922
**referralId** | **Integer** | The integration ID of the referring customer (if any) for whom this coupon was created as an effect. | [optional]
20-
**recipientIntegrationId** | **String** | The integration ID of a referred customer profile. | [optional]
23+
**recipientIntegrationId** | **String** | The Integration ID of the customer that is allowed to redeem this coupon. | [optional]
2124
**importId** | **Integer** | The ID of the Import which created this coupon. | [optional]
2225
**reservation** | **Boolean** | This value controls what reservations mean to a coupon. If set to true the coupon reservation is used to mark it as a favourite, if set to false the coupon reservation is used as a requirement of usage. This value defaults to true if not specified. | [optional]
2326
**batchId** | **String** | The id of the batch the coupon belongs to. | [optional]

docs/CouponConstraints.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
Name | Type | Description | Notes
88
------------ | ------------- | ------------- | -------------
99
**usageLimit** | **Integer** | The number of times a coupon code can be redeemed. This can be set to 0 for no limit, but any campaign usage limits will still apply. | [optional]
10+
**discountLimit** | [**BigDecimal**](BigDecimal.md) | The amount of discounts that can be given with this coupon code. | [optional]
1011
**startDate** | [**OffsetDateTime**](OffsetDateTime.md) | Timestamp at which point the coupon becomes valid. | [optional]
1112
**expiryDate** | [**OffsetDateTime**](OffsetDateTime.md) | Expiry date of the coupon. Coupon never expires if this is omitted, zero, or negative. | [optional]
1213

docs/CustomerInventory.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Name | Type | Description | Notes
88
------------ | ------------- | ------------- | -------------
99
**profile** | [**CustomerProfile**](CustomerProfile.md) | | [optional]
1010
**referrals** | [**List&lt;Referral&gt;**](Referral.md) | | [optional]
11+
**coupons** | [**List&lt;Coupon&gt;**](Coupon.md) | | [optional]
1112

1213

1314

docs/CustomerProfileUpdate.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
2+
3+
# CustomerProfileUpdate
4+
5+
## Properties
6+
7+
Name | Type | Description | Notes
8+
------------ | ------------- | ------------- | -------------
9+
**customerProfile** | [**CustomerProfile**](CustomerProfile.md) | |
10+
11+
12+

0 commit comments

Comments
 (0)