Skip to content

Commit

Permalink
v2.2.0: Loyalty Programs pending points & statistics, Introducing Loy…
Browse files Browse the repository at this point in the history
…alty customer inventory, customer profiles v2 integration dry runs (#10)

## Summary

### Integration API
 - Introduce `loyalty` flag in [`getCustomerInventory`](https://developers.talon.one/Integration-API/API-Reference#getCustomerInventory) endpoint to retrieve also profile's loyalty programs subscription and stats upon querying the endpoint
 - Introduce flags to control whether a customer [profile update request v2](https://developers.talon.one/Integration-API/API-Reference#updateCustomerProfileV2) should be a "dry run" or force it to "run rule engine"

#### ⚠️   Deprecation Notice: Integration API@v1 endpoints
This version also introduced the deprecation notices for Integration API@v1 endpoints:
 - [Update a Customer Session (V1)](https://developers.talon.one/Integration-API/API-Reference#updateCustomerSession)
 - [Update a Customer Profile (V1)](https://developers.talon.one/Integration-API/API-Reference#updateCustomerProfile)

These endpoints will be flagged deprecated on _15.07.2021_, meaning support for requests to these endpoints will end on that date. **We will not remove the endpoints**, and they will still be accessible for you to use.

We do encourage migrating to the correspondent v2 endpoints for easier and more granular integration, as well as new features support (See [our developer docs section](https://developers.talon.one/Getting-Started/APIV2) about API V2.0). 

### Loyalty Programs
Introduce Loyalty Program pending points: points that belong to the program's balance but will become active in the future:
 - Introduce [Loyalty Program](https://github.com/talon-one/talon_go/blob/07573d293ffd2df5cf5053699a389337025eb0c4/docs/LoyaltyProgram.md) setting to control default points' pending duration
 - Introduce a couple of new attributes to communicate better a [ledger](https://github.com/talon-one/talon_go/blob/07573d293ffd2df5cf5053699a389337025eb0c4/docs/LoyaltySubLedger.md)'s points status (pending, active, expired and spent)
 - Introduce Loyalty Programs statistics [endpoint]((https://developers.talon.one/Management-API/API-Reference#getLoyaltyStatistics)) to get a loyalty program stats snapshot

#### ⚠️⚠️   Breaking Change: Loyalty Program points addition payload
This version also introduced the ability to set both loyalty points _pending_ and _validity_ durations.
In order to communicate these more clear, we have renamed the former `expiryDuration` attribute of [`LoyaltyPoints`](https://github.com/talon-one/talon_go/pull/10/files?file-filters%5B%5D=.go&hide-deleted-files=true#diff-1ed3738651d0b079312508954b5336517e852ad6e814bd706ff7173d48db280dL23-R24) entity to **`validityDuration`**:
```diff
loyaltyProgramID := "1"
profileIntegrationID := "Customer_Profile_ID"

body := talon.LoyaltyPoints{}
body.SetPoints(42.42)
body.SetName("Points that expire after 3 days")
- body.SetExpiryDuration("72h")
+ body.SetValidityDuration("72h")

res, err = managementClient.ManagementApi.
	AddLoyaltyPoints(managerAuthContext, loyaltyProgramID, profileIntegrationID).
	Body(body).
	Execute()
```

#### ⚠️  Deprecation Notice: Loyalty Program Ledger's `total` property
Please note that we are deprecating the `total` property of the [`LoyaltySubLedger`](https://github.com/talon-one/talon_go/blob/07573d293ffd2df5cf5053699a389337025eb0c4/model_loyalty_sub_ledger.go#L19-L20) entity. In order to be more transparent and express better distinction between a customer's balance in a program (active, pending, and expired points).

We will remove this property in the next version of the SDK, please use the new `totalActivePoints` property instead.

### Sandbox/Live Applications & Account Analytics
Applications now can be flagged as live or sandbox (available only via the web application):
 - This can be seen via the `sandbox` attribute of the [Application entity](https://github.com/talon-one/talon_go/blob/07573d293ffd2df5cf5053699a389337025eb0c4/docs/Application.md#properties)
 - [Account analytics](https://github.com/talon-one/talon_go/blob/07573d293ffd2df5cf5053699a389337025eb0c4/docs/AccountAnalytics.md#properties) now respect this separation and reports new data points: `liveApplications`, `sandboxApplications` and `liveActiveCampaigns`
  • Loading branch information
altJake authored Oct 13, 2020
1 parent 40bb9ac commit 00c521b
Show file tree
Hide file tree
Showing 118 changed files with 9,865 additions and 1,636 deletions.
32 changes: 26 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ The API is available at the same hostname as these docs. For example, if you are
This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client.

- API version: 1.0.0
- Package version: 2.1.1
- Package version: 2.2.0
- Build package: org.openapitools.codegen.languages.GoClientExperimentalCodegen

## Installation
Expand Down Expand Up @@ -343,9 +343,11 @@ Class | Method | HTTP request | Description
*IntegrationApi* | [**GetCustomerInventory**](docs/IntegrationApi.md#getcustomerinventory) | **Get** /v1/customer_profiles/{integrationId}/inventory | Get an inventory of all data associated with a specific customer profile.
*IntegrationApi* | [**GetReservedCustomers**](docs/IntegrationApi.md#getreservedcustomers) | **Get** /v1/coupon_reservations/customerprofiles/{couponValue} | Get the users that have this coupon reserved
*IntegrationApi* | [**TrackEvent**](docs/IntegrationApi.md#trackevent) | **Post** /v1/events | Track an Event
*IntegrationApi* | [**UpdateCustomerProfile**](docs/IntegrationApi.md#updatecustomerprofile) | **Put** /v1/customer_profiles/{integrationId} | Update a Customer Profile
*IntegrationApi* | [**UpdateCustomerProfileV2**](docs/IntegrationApi.md#updatecustomerprofilev2) | **Put** /v2/customer_profiles/{customerProfileId} | Update a Customer Profile
*IntegrationApi* | [**UpdateCustomerSession**](docs/IntegrationApi.md#updatecustomersession) | **Put** /v1/customer_sessions/{customerSessionId} | Update a Customer Session
*IntegrationApi* | [**UpdateCustomerProfile**](docs/IntegrationApi.md#updatecustomerprofile) | **Put** /v1/customer_profiles/{integrationId} | Update a Customer Profile V1
*IntegrationApi* | [**UpdateCustomerProfileAudiences**](docs/IntegrationApi.md#updatecustomerprofileaudiences) | **Post** /v2/customer_audiences | Update a Customer Profile Audiences
*IntegrationApi* | [**UpdateCustomerProfileV2**](docs/IntegrationApi.md#updatecustomerprofilev2) | **Put** /v2/customer_profiles/{integrationId} | Update a Customer Profile
*IntegrationApi* | [**UpdateCustomerProfilesV2**](docs/IntegrationApi.md#updatecustomerprofilesv2) | **Put** /v2/customer_profiles | Update multiple Customer Profiles
*IntegrationApi* | [**UpdateCustomerSession**](docs/IntegrationApi.md#updatecustomersession) | **Put** /v1/customer_sessions/{customerSessionId} | Update a Customer Session V1
*IntegrationApi* | [**UpdateCustomerSessionV2**](docs/IntegrationApi.md#updatecustomersessionv2) | **Put** /v2/customer_sessions/{customerSessionId} | Update a Customer Session
*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
*ManagementApi* | [**CopyCampaignToApplications**](docs/ManagementApi.md#copycampaigntoapplications) | **Post** /v1/applications/{applicationId}/campaigns/{campaignId}/copy | Copy the campaign into every specified application
Expand Down Expand Up @@ -404,6 +406,7 @@ Class | Method | HTTP request | Description
*ManagementApi* | [**GetLoyaltyPoints**](docs/ManagementApi.md#getloyaltypoints) | **Get** /v1/loyalty_programs/{programID}/profile/{integrationID} | get the Loyalty Ledger for this integrationID
*ManagementApi* | [**GetLoyaltyProgram**](docs/ManagementApi.md#getloyaltyprogram) | **Get** /v1/loyalty_programs/{programID} | Get a loyalty program
*ManagementApi* | [**GetLoyaltyPrograms**](docs/ManagementApi.md#getloyaltyprograms) | **Get** /v1/loyalty_programs | List all loyalty Programs
*ManagementApi* | [**GetLoyaltyStatistics**](docs/ManagementApi.md#getloyaltystatistics) | **Get** /v1/loyalty_programs/{programID}/statistics | Get loyalty program statistics by loyalty program ID
*ManagementApi* | [**GetReferrals**](docs/ManagementApi.md#getreferrals) | **Get** /v1/applications/{applicationId}/campaigns/{campaignId}/referrals | List Referrals (with total count)
*ManagementApi* | [**GetReferralsWithoutTotalCount**](docs/ManagementApi.md#getreferralswithouttotalcount) | **Get** /v1/applications/{applicationId}/campaigns/{campaignId}/referrals/no_total | List Referrals
*ManagementApi* | [**GetRole**](docs/ManagementApi.md#getrole) | **Get** /v1/roles/{roleId} | Get information for the specified role.
Expand Down Expand Up @@ -456,12 +459,16 @@ Class | Method | HTTP request | Description
- [Attribute](docs/Attribute.md)
- [AttributesMandatory](docs/AttributesMandatory.md)
- [AttributesSettings](docs/AttributesSettings.md)
- [Audience](docs/Audience.md)
- [AudienceMembership](docs/AudienceMembership.md)
- [BaseSamlConnection](docs/BaseSamlConnection.md)
- [Binding](docs/Binding.md)
- [Campaign](docs/Campaign.md)
- [CampaignAnalytics](docs/CampaignAnalytics.md)
- [CampaignCopy](docs/CampaignCopy.md)
- [CampaignEntity](docs/CampaignEntity.md)
- [CampaignGroup](docs/CampaignGroup.md)
- [CampaignGroupEntity](docs/CampaignGroupEntity.md)
- [CampaignSearch](docs/CampaignSearch.md)
- [CampaignSet](docs/CampaignSet.md)
- [CampaignSetBranchNode](docs/CampaignSetBranchNode.md)
Expand All @@ -484,15 +491,18 @@ Class | Method | HTTP request | Description
- [CustomerAnalytics](docs/CustomerAnalytics.md)
- [CustomerInventory](docs/CustomerInventory.md)
- [CustomerProfile](docs/CustomerProfile.md)
- [CustomerProfileAudienceRequest](docs/CustomerProfileAudienceRequest.md)
- [CustomerProfileAudienceRequestItem](docs/CustomerProfileAudienceRequestItem.md)
- [CustomerProfileIntegrationRequestV2](docs/CustomerProfileIntegrationRequestV2.md)
- [CustomerProfileSearchQuery](docs/CustomerProfileSearchQuery.md)
- [CustomerProfileUpdate](docs/CustomerProfileUpdate.md)
- [CustomerSession](docs/CustomerSession.md)
- [CustomerSessionV2](docs/CustomerSessionV2.md)
- [DeductLoyaltyPointsEffectProps](docs/DeductLoyaltyPointsEffectProps.md)
- [Effect](docs/Effect.md)
- [EffectEntity](docs/EffectEntity.md)
- [EmailEntity](docs/EmailEntity.md)
- [Entity](docs/Entity.md)
- [EntityWithTalangVisibleId](docs/EntityWithTalangVisibleId.md)
- [Environment](docs/Environment.md)
- [ErrorEffectProps](docs/ErrorEffectProps.md)
- [ErrorResponse](docs/ErrorResponse.md)
Expand All @@ -503,6 +513,7 @@ Class | Method | HTTP request | Description
- [FeatureFlag](docs/FeatureFlag.md)
- [FeatureFlags](docs/FeatureFlags.md)
- [FeaturesFeed](docs/FeaturesFeed.md)
- [FeedNotification](docs/FeedNotification.md)
- [FuncArgDef](docs/FuncArgDef.md)
- [FunctionDef](docs/FunctionDef.md)
- [Import](docs/Import.md)
Expand Down Expand Up @@ -556,19 +567,24 @@ Class | Method | HTTP request | Description
- [LoyaltyProgram](docs/LoyaltyProgram.md)
- [LoyaltyProgramBalance](docs/LoyaltyProgramBalance.md)
- [LoyaltyProgramLedgers](docs/LoyaltyProgramLedgers.md)
- [LoyaltyStatistics](docs/LoyaltyStatistics.md)
- [LoyaltySubLedger](docs/LoyaltySubLedger.md)
- [ManagerConfig](docs/ManagerConfig.md)
- [Meta](docs/Meta.md)
- [MiscUpdateUserLatestFeature](docs/MiscUpdateUserLatestFeature.md)
- [MultiApplicationEntity](docs/MultiApplicationEntity.md)
- [MultipleCustomerProfileIntegrationRequest](docs/MultipleCustomerProfileIntegrationRequest.md)
- [MultipleCustomerProfileIntegrationRequestItem](docs/MultipleCustomerProfileIntegrationRequestItem.md)
- [MultipleCustomerProfileIntegrationResponseV2](docs/MultipleCustomerProfileIntegrationResponseV2.md)
- [MutableEntity](docs/MutableEntity.md)
- [NewAccount](docs/NewAccount.md)
- [NewAccountSignUp](docs/NewAccountSignUp.md)
- [NewAdditionalCost](docs/NewAdditionalCost.md)
- [NewApplication](docs/NewApplication.md)
- [NewApplicationApiKey](docs/NewApplicationApiKey.md)
- [NewAttribute](docs/NewAttribute.md)
- [NewAudience](docs/NewAudience.md)
- [NewCampaign](docs/NewCampaign.md)
- [NewCampaignGroup](docs/NewCampaignGroup.md)
- [NewCampaignSet](docs/NewCampaignSet.md)
- [NewCoupons](docs/NewCoupons.md)
- [NewCustomerProfile](docs/NewCustomerProfile.md)
Expand Down Expand Up @@ -619,14 +635,18 @@ Class | Method | HTTP request | Description
- [UpdateAccount](docs/UpdateAccount.md)
- [UpdateApplication](docs/UpdateApplication.md)
- [UpdateAttributeEffectProps](docs/UpdateAttributeEffectProps.md)
- [UpdateAudience](docs/UpdateAudience.md)
- [UpdateCampaign](docs/UpdateCampaign.md)
- [UpdateCampaignGroup](docs/UpdateCampaignGroup.md)
- [UpdateCoupon](docs/UpdateCoupon.md)
- [UpdateCouponBatch](docs/UpdateCouponBatch.md)
- [UpdateLoyaltyProgram](docs/UpdateLoyaltyProgram.md)
- [UpdateRole](docs/UpdateRole.md)
- [UpdateUser](docs/UpdateUser.md)
- [UpdateUserLatestFeedTimestamp](docs/UpdateUserLatestFeedTimestamp.md)
- [User](docs/User.md)
- [UserEntity](docs/UserEntity.md)
- [UserFeedNotifications](docs/UserFeedNotifications.md)
- [Webhook](docs/Webhook.md)
- [WebhookActivationLogEntry](docs/WebhookActivationLogEntry.md)
- [WebhookLogEntry](docs/WebhookLogEntry.md)
Expand Down
Loading

0 comments on commit 00c521b

Please sign in to comment.