Skip to content

Releases: talon-one/talon_one.js

v4.3.0: Multiple personal coupons creation endpoint, Loyalty and Referrals counters and Export Endpoints

03 Feb 17:43
bd62e8f
Compare
Choose a tag to compare

Summary

Management API

Introduce createCouponsForMultipleRecipients Endpoint

An endpoint to allow creation of multiple coupons of the same configuration for up to 1,000 recipients at once.

☝️ Back to Table of Contents

Expose export endpoints as integral part of the SDK

All of our CSV export endpoints are accessible via the Web Application from the corresponding entity pages (refer to our Help Center for an example regarding Coupons).

Now these are also available endpoints as part of the SDK (links to our developer docs):

Example code snippet demonstrating consuming and printing the lines of a Customer Loyalty Balance Export using the csv-parse package:

const TalonOne = require('talon_one')
const csvParse = require('csv-parse')

// ...preparing api client...
// An example could be seen at the repository's README file: https://github.com/talon-one/talon_one.js#management-api

managerApi.exportLoyaltyBalance('1')
  .then((data) => {
    return new Promise((resolve, reject) => {
      csvParse(data, {
        columns: true,
        skipEmptyLines: true,
      }, (err, output) => {
        if (err) {
          return reject(err)
        }

        resolve(output)
      })
    })
  })
  .then((records) => {
    // process data using parsed records...
    records.forEach(record => {
      console.log(record) /* outputs:
      { 
        loyaltyProgramID: '1',
        loyaltySubledger: '',
        profileIntegrationID: 'customer_1',
        currentBalance: '34.89',
        pendingBalance: '42.1',
        expiredBalance: '0',
        spentBalance: '10'
      }
      */
    })
  })
  .catch(err => console.log(`Error while exporting and processing csv:\n${JSON.stringify(err, null, 2)}`))

☝️ Back to Table of Contents

Expose destroySession Endpoint

Expose an existing endpoint to allow destroying a bearer token used in the context of the management-api.
This endpoint imitates a "logout" function and will make the attached token invalid for consequent requests.

☝️ Back to Table of Contents

Introduce loyalty effects related and referrals creation counters on Campaign entities

As part of the newly added budgets to campaigns (see relevant Help Center Section), we have added new counters on campaigns with regard to loyalty and referrals:

  • createdLoyaltyPointsCount : Total number of loyalty points created by rules in this campaign
  • createdLoyaltyPointsEffectCount : Total number of loyalty point creation effects triggered by rules in this campaign
  • redeemedLoyaltyPointsCount : Total number of loyalty points redeemed by rules in this campaign
  • redeemedLoyaltyPointsEffectCount : Total number of loyalty point redemption effects triggered by rules in this campaign
  • referralCreationCount : Total number of referrals created by rules in this campaign

☝️ Back to Table of Contents

Integration API

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
  • When a coupon is rejected we attach more details regarding the origin of the failure in RejectCouponEffectProps:
    • 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:
    • 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, ruleFailureReasons, which when requested will attach to the response a collection containing all failed rules, with details (see the ruleFailureReason model 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

Attach Loyalty Program ID in responses

When the consumer requires that the response will contain the details of loyalty programs involved in processing the requests, we now attach the identifier of the loyalty program to the returned loyaltyProgramLedgers models.

The idea behind attaching the identifier is to help streamline further potential requests to our Management API with regard to details about a Loyalty Program, for example getLoyaltyStatistics or getLoyaltyPoints, that require the program identifier as part of the URI of the endpoint.

☝️ Back to Table of Contents

⚠️ 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:

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 about API V2.0).

☝️ Back to Table of Contents

Improve Typescript definitions for optional request p...

Read more

v4.2.0: Typescript definitions files, Loyalty Programs pending points & statistics, Introducing Loyalty customer inventory

08 Oct 16:54
58deea2
Compare
Choose a tag to compare

Summary

Integration API

  • Introduce loyalty flag in 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 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:

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 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 setting to control default points' pending duration
  • Introduce a couple of new attributes to communicate better a ledger's points status (pending, active, expired and spent)
  • Introduce Loyalty Programs statistics endpoint 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 entity to validityDuration:

  * Indicates the duration after which the added loyalty points should expire. The format is a number followed by one letter indicating the unit, like '1h' or '40m' or '30d'.
- * @member {String} expiryDuration
+ * @member {String} validityDuration

⚠️ Deprecation Notice: Loyalty Program Ledger's total property

Please note that we are deprecating the total property of the LoyaltySubLedger 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
  • Account analytics now respect this separation and reports new data points: liveApplications, sandboxApplications and liveActiveCampaigns

Publishing Typescript Declaration Files 🎉

From version 4.2.0 we will start supply typescript declaration files as part of the package.
Those are based and emitted from the JSDoc comments and are not always complete. However, they provide the editor experience of Typescript-powered editors while we are working on full featured Typescript SDK package.

Thanks a lot to @dpoetzschke for the help on this topic!

v4.1.0: Dry Runs & Coupons discount limits

20 May 16:35
86aeccf
Compare
Choose a tag to compare
  • 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

v4.0.0: Integration API V2

31 Mar 14:26
1623f20
Compare
Choose a tag to compare

v3.4.0

19 Dec 14:19
a9d2f23
Compare
Choose a tag to compare

v3.3.0

27 Nov 18:08
d5ba173
Compare
Choose a tag to compare
  • More filtering parameters when querying changes endpoint
  • The full Coupon object is now returned as part of an integration response
  • Support for new limit configuration of amount of give discount effects

v3.2.0

01 Oct 14:03
980431f
Compare
Choose a tag to compare
  • Add ReferralRejectionReason object and integration response properties
  • Add users emails notifications subscriptions
  • Remove stale usedAt and locked properties from Webhooks and Attributes

v3.1.2

11 Sep 12:20
275a596
Compare
Choose a tag to compare
  • SessionId property of Event object returned from integration API is optional

v3.1.1

04 Sep 15:30
320c20c
Compare
Choose a tag to compare
  • Remove ApplicationStorages deprecation
  • LoyaltyMemberships of Profile entity are optional

v3.1.0

29 Aug 16:55
ffc8fb1
Compare
Choose a tag to compare
  • Fix bug in v1/coupon_reservations/coupons/{integrationId} endpoint
  • Add support for loyalty programs sub-ledgers feature