Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
v2.4.0: Customer Inventory Enhancements, Referral Updates and Import …
…Endpoints <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) - [Extended Customer Inventory Endpoint](#user-content-customer-inventory) - [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: ```go // ...preparing api client... // An example could be seen at the repository's README file: https://github.com/talon-one/talon_go#management-api referralsCSVFileContents, err := ioutil.ReadFile("/path/to/import-referrals.csv") if err != nil { fmt.Printf("Error occurred while reading referrals csv: %s", err) // handle error / return / panic return } applicationId := 1 campaignId := 2 importSummary, _, err := managementClient.ManagementApi. ImportReferrals(managerAuthContext, applicationId, campaignId). UpFile(string(referralsFile)). Execute() ``` [☝️ 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="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. The customer inventory endpoint now has the ability to return giveaway codes that belong to the profile in query. In order to learn more about setting up such campaigns refer to [this help center article](https://help.talon.one/hc/en-us/articles/360020631099-Giveaway-Campaigns) and [this developer docs tutorial](https://developers.talon.one/Tutorials/creating-giveaways). We have also extended the coupons objects that are returned as part of the inventory and attached these two useful data-points to each returned coupon: - `profileRedemptionCount` - holds the number of times the coupon was redeemed by the profile - `state` - holds the state of the coupon and can be one of the below values: - **_active_**: reserved coupons that are neither pending nor used nor expired, and have a non-exhausted limit counter - **_used_**: coupons that are not pending, and have reached their redemption limit or were redeemed by the profile before expiration - **_expired_**: all non-pending, non-active, non-used coupons that were not redeemed by the profile - **_pending_**: coupons that have a start date in the future [☝️ Back to Table of Contents](#user-content-toc) <i id="deprecation-reminder"></i> ###⚠️ A reminder of The Deprecation Notice: Integration API@v1 endpoints The deprecation was introduced already in the last release of the SDK, here is a kind reminder of the deprecation notices for Integration API@v1 endpoints: - [Update a Customer Session (V1)](https://github.com/talon-one/talon_go/blob/master/docs/IntegrationApi.md#UpdateCustomerSession) - [Update a Customer Profile (V1)](https://github.com/talon-one/talon_go/blob/master/docs/IntegrationApi.md#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 highly 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). [☝️ Back to Table of Contents](#user-content-toc)
- Loading branch information