# TalonOne.IntegrationApi All URIs are relative to *https://yourbaseurl.talon.one* Method | HTTP request | Description ------------- | ------------- | ------------- [**activateLoyaltyPoints**](IntegrationApi.md#activateLoyaltyPoints) | **POST** /v1/loyalty_programs/{loyaltyProgramId}/activate_points | Activate loyalty points [**bestPriorPrice**](IntegrationApi.md#bestPriorPrice) | **POST** /v1/best_prior_price | Fetch best prior price [**createAudienceV2**](IntegrationApi.md#createAudienceV2) | **POST** /v2/audiences | Create audience [**createCouponReservation**](IntegrationApi.md#createCouponReservation) | **POST** /v1/coupon_reservations/{couponValue} | Create coupon reservation [**createReferral**](IntegrationApi.md#createReferral) | **POST** /v1/referrals | Create referral code for an advocate [**createReferralsForMultipleAdvocates**](IntegrationApi.md#createReferralsForMultipleAdvocates) | **POST** /v1/referrals_for_multiple_advocates | Create referral codes for multiple advocates [**deleteAudienceMembershipsV2**](IntegrationApi.md#deleteAudienceMembershipsV2) | **DELETE** /v2/audiences/{audienceId}/memberships | Delete audience memberships [**deleteAudienceV2**](IntegrationApi.md#deleteAudienceV2) | **DELETE** /v2/audiences/{audienceId} | Delete audience [**deleteCouponReservation**](IntegrationApi.md#deleteCouponReservation) | **DELETE** /v1/coupon_reservations/{couponValue} | Delete coupon reservations [**deleteCustomerData**](IntegrationApi.md#deleteCustomerData) | **DELETE** /v1/customer_data/{integrationId} | Delete customer's personal data [**deleteLoyaltyTransactionsFromLedgers**](IntegrationApi.md#deleteLoyaltyTransactionsFromLedgers) | **POST** /v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/delete_transactions | Delete customer's transactions from loyalty ledgers [**generateLoyaltyCard**](IntegrationApi.md#generateLoyaltyCard) | **POST** /v1/loyalty_programs/{loyaltyProgramId}/cards | Generate loyalty card [**getCustomerAchievementHistory**](IntegrationApi.md#getCustomerAchievementHistory) | **GET** /v1/customer_profiles/{integrationId}/achievements/{achievementId} | List customer's achievement history [**getCustomerAchievements**](IntegrationApi.md#getCustomerAchievements) | **GET** /v1/customer_profiles/{integrationId}/achievements | List customer's available achievements [**getCustomerInventory**](IntegrationApi.md#getCustomerInventory) | **GET** /v1/customer_profiles/{integrationId}/inventory | List customer data [**getCustomerSession**](IntegrationApi.md#getCustomerSession) | **GET** /v2/customer_sessions/{customerSessionId} | Get customer session [**getEventV3**](IntegrationApi.md#getEventV3) | **GET** /v3/events/{integrationId} | Get advanced event [**getLoyaltyBalances**](IntegrationApi.md#getLoyaltyBalances) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/balances | Get customer's loyalty balances [**getLoyaltyCardBalances**](IntegrationApi.md#getLoyaltyCardBalances) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/balances | Get card's point balances [**getLoyaltyCardPoints**](IntegrationApi.md#getLoyaltyCardPoints) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/points | List card's unused loyalty points [**getLoyaltyCardTransactions**](IntegrationApi.md#getLoyaltyCardTransactions) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/transactions | List card's transactions [**getLoyaltyProgramProfilePoints**](IntegrationApi.md#getLoyaltyProgramProfilePoints) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/points | List customer's unused loyalty points [**getLoyaltyProgramProfileTransactions**](IntegrationApi.md#getLoyaltyProgramProfileTransactions) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/transactions | List customer's loyalty transactions [**getReservedCustomers**](IntegrationApi.md#getReservedCustomers) | **GET** /v1/coupon_reservations/customerprofiles/{couponValue} | List customers that have this coupon reserved [**integrationGetAllCampaigns**](IntegrationApi.md#integrationGetAllCampaigns) | **GET** /v1/integration/campaigns | List all running campaigns [**integrationRewardsCatalog**](IntegrationApi.md#integrationRewardsCatalog) | **GET** /v1/rewards/catalog | List rewards in the catalog [**joinLoyaltyProgram**](IntegrationApi.md#joinLoyaltyProgram) | **POST** /v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/join | Join customer profile to loyalty program [**linkLoyaltyCardToProfile**](IntegrationApi.md#linkLoyaltyCardToProfile) | **POST** /v2/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/link_profile | Link customer profile to card [**reopenCustomerSession**](IntegrationApi.md#reopenCustomerSession) | **PUT** /v2/customer_sessions/{customerSessionId}/reopen | Reopen customer session [**returnCartItems**](IntegrationApi.md#returnCartItems) | **POST** /v2/customer_sessions/{customerSessionId}/returns | Return cart items [**syncCatalog**](IntegrationApi.md#syncCatalog) | **PUT** /v1/catalogs/{catalogId}/sync | Sync cart item catalog [**trackEventV2**](IntegrationApi.md#trackEventV2) | **POST** /v2/events | Track event [**trackEventV3**](IntegrationApi.md#trackEventV3) | **POST** /v3/events | Track advanced event [**unlinkLoyaltyCardFromProfile**](IntegrationApi.md#unlinkLoyaltyCardFromProfile) | **POST** /v2/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/unlink_profile | Unlink customer profile from a loyalty card [**unlockReward**](IntegrationApi.md#unlockReward) | **POST** /v1/rewards/{rewardId}/unlock | Unlock a reward [**updateAudienceCustomersAttributes**](IntegrationApi.md#updateAudienceCustomersAttributes) | **PUT** /v2/audience_customers/{audienceId}/attributes | Update profile attributes for all customers in audience [**updateAudienceV2**](IntegrationApi.md#updateAudienceV2) | **PUT** /v2/audiences/{audienceId} | Update audience name [**updateCustomerProfileAudiences**](IntegrationApi.md#updateCustomerProfileAudiences) | **POST** /v2/customer_audiences | Update multiple customer profiles' audiences [**updateCustomerProfileV2**](IntegrationApi.md#updateCustomerProfileV2) | **PUT** /v2/customer_profiles/{integrationId} | Update customer profile [**updateCustomerProfilesV2**](IntegrationApi.md#updateCustomerProfilesV2) | **PUT** /v2/customer_profiles | Update multiple customer profiles [**updateCustomerSessionV2**](IntegrationApi.md#updateCustomerSessionV2) | **PUT** /v2/customer_sessions/{customerSessionId} | Update customer session ## activateLoyaltyPoints > ActivateLoyaltyPointsResponse activateLoyaltyPoints(loyaltyProgramId, body) Activate loyalty points Activate points when a defined action occurs. You can activate pending points using one of the following parameters: - `sessionId`: Activates all points earned in the specified session. - `transactionUUIDs`: Activates points earned in the transactions specified by the given UUIDs. ### Example ```javascript import TalonOne from 'talon_one'; let defaultClient = TalonOne.ApiClient.instance; // Configure API key authorization: api_key_v1 let api_key_v1 = defaultClient.authentications['api_key_v1']; api_key_v1.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //api_key_v1.apiKeyPrefix = 'Token'; let apiInstance = new TalonOne.IntegrationApi(); let loyaltyProgramId = 789; // Number | The identifier for the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. let body = new TalonOne.ActivateLoyaltyPoints(); // ActivateLoyaltyPoints | body apiInstance.activateLoyaltyPoints(loyaltyProgramId, body).then((data) => { console.log('API called successfully. Returned data: ' + data); }, (error) => { console.error(error); }); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **loyaltyProgramId** | **Number**| The identifier for the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. | **body** | [**ActivateLoyaltyPoints**](ActivateLoyaltyPoints.md)| body | ### Return type [**ActivateLoyaltyPointsResponse**](ActivateLoyaltyPointsResponse.md) ### Authorization [api_key_v1](../README.md#api_key_v1) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ## bestPriorPrice > [BestPriorPrice] bestPriorPrice(body) Fetch best prior price Returns the best prior price based on historical pricing data for the specified SKUs within a defined timeframe. ### Example ```javascript import TalonOne from 'talon_one'; let defaultClient = TalonOne.ApiClient.instance; // Configure API key authorization: api_key_v1 let api_key_v1 = defaultClient.authentications['api_key_v1']; api_key_v1.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //api_key_v1.apiKeyPrefix = 'Token'; // Configure API key authorization: management_key let management_key = defaultClient.authentications['management_key']; management_key.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //management_key.apiKeyPrefix = 'Token'; // Configure API key authorization: manager_auth let manager_auth = defaultClient.authentications['manager_auth']; manager_auth.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //manager_auth.apiKeyPrefix = 'Token'; let apiInstance = new TalonOne.IntegrationApi(); let body = new TalonOne.BestPriorPriceRequest(); // BestPriorPriceRequest | body apiInstance.bestPriorPrice(body).then((data) => { console.log('API called successfully. Returned data: ' + data); }, (error) => { console.error(error); }); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**BestPriorPriceRequest**](BestPriorPriceRequest.md)| body | ### Return type [**[BestPriorPrice]**](BestPriorPrice.md) ### Authorization [api_key_v1](../README.md#api_key_v1), [management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ## createAudienceV2 > Audience createAudienceV2(body) Create audience Create an audience. The audience can be created directly from scratch or can come from third party platforms. > [!note] Audiences can also be created from scratch via the Campaign Manager. See the [docs](https://docs.talon.one/docs/product/audiences/creating-audiences). To create an audience from an existing audience from a [technology partner](https://docs.talon.one/docs/dev/technology-partners/overview): 1. Set the `integration` property to `mparticle`, `segment` etc., depending on a third-party platform. 1. Set `integrationId` to the ID of this audience in a third-party platform. To create an audience from an existing audience in another platform: 1. Do not use the `integration` property. 1. Set `integrationId` to the ID of this audience in the 3rd-party platform. To create an audience from scratch, only set the `name` property. Once you create your first audience, audience-specific rule conditions are enabled in the Rule Builder. ### Example ```javascript import TalonOne from 'talon_one'; let defaultClient = TalonOne.ApiClient.instance; // Configure API key authorization: api_key_v1 let api_key_v1 = defaultClient.authentications['api_key_v1']; api_key_v1.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //api_key_v1.apiKeyPrefix = 'Token'; let apiInstance = new TalonOne.IntegrationApi(); let body = new TalonOne.NewAudience(); // NewAudience | body apiInstance.createAudienceV2(body).then((data) => { console.log('API called successfully. Returned data: ' + data); }, (error) => { console.error(error); }); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**NewAudience**](NewAudience.md)| body | ### Return type [**Audience**](Audience.md) ### Authorization [api_key_v1](../README.md#api_key_v1) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ## createCouponReservation > Coupon createCouponReservation(couponValue, body) Create coupon reservation Create a coupon reservation for the specified customer profiles on the specified coupon. You can also create a reservation via the Campaign Manager using the [Create coupon code reservation](https://docs.talon.one/docs/product/rules/effects/using-effects#reserving-a-coupon-code) effect. > [!note] **Note** > - If the **Reservation mandatory** option was selected when creating the > specified coupon, the endpoint creates a **hard** reservation, meaning only users who have > this coupon code reserved can redeem it. > > Otherwise, the endpoint creates a **soft** reservation, meaning the coupon > is associated with the specified customer profiles (they show up when using > the [List customer data](https://docs.talon.one/integration-api#tag/Customer-profiles/operation/getCustomerInventory) > endpoint), but any user can redeem it. > > This can be useful, for example, to display a _coupon wallet_ for customers > when they visit your store. > - If the **Coupon visibility** option was selected when creating the > specified coupon, the coupon code is implicitly soft-reserved for all customers, and the code > will be returned for all customer profiles in the [List customer > data](https://docs.talon.one/integration-api#tag/Customer-profiles/operation/getCustomerInventory) endpoint. > - This endpoint overrides the coupon reservation limit set when > [the coupon is created](https://docs.talon.one/docs/product/campaigns/coupons/creating-coupons). To ensure that coupons cannot be reserved after the reservation limit is reached, use the [Create coupon code reservation](https://docs.talon.one/docs/product/rules/effects/using-effects#reserving-a-coupon-code) effect in the Rule Builder and the [Update customer session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint. To delete a reservation, use the [Delete reservation](https://docs.talon.one/integration-api#tag/Coupons/operation/deleteCouponReservation) endpoint. ### Example ```javascript import TalonOne from 'talon_one'; let defaultClient = TalonOne.ApiClient.instance; // Configure API key authorization: api_key_v1 let api_key_v1 = defaultClient.authentications['api_key_v1']; api_key_v1.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //api_key_v1.apiKeyPrefix = 'Token'; let apiInstance = new TalonOne.IntegrationApi(); let couponValue = "couponValue_example"; // String | The code of the coupon. **Important:** The coupon code requires [URL encoding](https://www.w3schools.com/tags//ref_urlencode.asp) if it contains special characters. For example, you must encode `SUMMER25%OFF` as `SUMMER25%25OFF`. let body = new TalonOne.CouponReservations(); // CouponReservations | body apiInstance.createCouponReservation(couponValue, body).then((data) => { console.log('API called successfully. Returned data: ' + data); }, (error) => { console.error(error); }); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **couponValue** | **String**| The code of the coupon. **Important:** The coupon code requires [URL encoding](https://www.w3schools.com/tags//ref_urlencode.asp) if it contains special characters. For example, you must encode `SUMMER25%OFF` as `SUMMER25%25OFF`. | **body** | [**CouponReservations**](CouponReservations.md)| body | ### Return type [**Coupon**](Coupon.md) ### Authorization [api_key_v1](../README.md#api_key_v1) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ## createReferral > Referral createReferral(body) Create referral code for an advocate Creates a referral code for an advocate. The code will be valid for the referral campaign for which is created, indicated in the `campaignId` parameter, and will be associated with the profile specified in the `advocateProfileIntegrationId` parameter as the advocate's profile. > [!note] Any [referral limits](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-budgets#referral-limits) > set are ignored when you use this endpoint. ### Example ```javascript import TalonOne from 'talon_one'; let defaultClient = TalonOne.ApiClient.instance; // Configure API key authorization: api_key_v1 let api_key_v1 = defaultClient.authentications['api_key_v1']; api_key_v1.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //api_key_v1.apiKeyPrefix = 'Token'; let apiInstance = new TalonOne.IntegrationApi(); let body = new TalonOne.NewReferral(); // NewReferral | body apiInstance.createReferral(body).then((data) => { console.log('API called successfully. Returned data: ' + data); }, (error) => { console.error(error); }); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**NewReferral**](NewReferral.md)| body | ### Return type [**Referral**](Referral.md) ### Authorization [api_key_v1](../README.md#api_key_v1) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ## createReferralsForMultipleAdvocates > InlineResponse201 createReferralsForMultipleAdvocates(body, opts) Create referral codes for multiple advocates Creates unique referral codes for multiple advocates. The code will be valid for the referral campaign for which it is created, indicated in the `campaignId` parameter, and one referral code will be associated with one advocate using the profile specified in the `advocateProfileIntegrationId` parameter as the advocate's profile. > [!note] Any [referral limits](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-budgets#referral-limits) > set are ignored when you use this endpoint. ### Example ```javascript import TalonOne from 'talon_one'; let defaultClient = TalonOne.ApiClient.instance; // Configure API key authorization: api_key_v1 let api_key_v1 = defaultClient.authentications['api_key_v1']; api_key_v1.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //api_key_v1.apiKeyPrefix = 'Token'; let apiInstance = new TalonOne.IntegrationApi(); let body = new TalonOne.NewReferralsForMultipleAdvocates(); // NewReferralsForMultipleAdvocates | body let opts = { 'silent': "'yes'" // String | Possible values: `yes` or `no`. - `yes`: Increases the performance of the API call by returning a 204 response. - `no`: Returns a 200 response that contains the updated customer profiles. }; apiInstance.createReferralsForMultipleAdvocates(body, opts).then((data) => { console.log('API called successfully. Returned data: ' + data); }, (error) => { console.error(error); }); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**NewReferralsForMultipleAdvocates**](NewReferralsForMultipleAdvocates.md)| body | **silent** | **String**| Possible values: `yes` or `no`. - `yes`: Increases the performance of the API call by returning a 204 response. - `no`: Returns a 200 response that contains the updated customer profiles. | [optional] [default to 'yes'] ### Return type [**InlineResponse201**](InlineResponse201.md) ### Authorization [api_key_v1](../README.md#api_key_v1) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ## deleteAudienceMembershipsV2 > deleteAudienceMembershipsV2(audienceId) Delete audience memberships Remove all members from this audience. ### Example ```javascript import TalonOne from 'talon_one'; let defaultClient = TalonOne.ApiClient.instance; // Configure API key authorization: api_key_v1 let api_key_v1 = defaultClient.authentications['api_key_v1']; api_key_v1.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //api_key_v1.apiKeyPrefix = 'Token'; let apiInstance = new TalonOne.IntegrationApi(); let audienceId = 789; // Number | The ID of the audience. apiInstance.deleteAudienceMembershipsV2(audienceId).then(() => { console.log('API called successfully.'); }, (error) => { console.error(error); }); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **audienceId** | **Number**| The ID of the audience. | ### Return type null (empty response body) ### Authorization [api_key_v1](../README.md#api_key_v1) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ## deleteAudienceV2 > deleteAudienceV2(audienceId) Delete audience Delete an audience. > [!warning] This endpoint also removes any associations recorded between a customer profile and this audience. > [!note] Audiences can also be deleted via the Campaign Manager. See the [docs](https://docs.talon.one/docs/product/audiences/managing-audiences#deleting-an-audience). The audience isn't deleted if any experiment variant uses it. The response identifies each blocking experiment by its Campaign Manager path. ### Example ```javascript import TalonOne from 'talon_one'; let defaultClient = TalonOne.ApiClient.instance; // Configure API key authorization: api_key_v1 let api_key_v1 = defaultClient.authentications['api_key_v1']; api_key_v1.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //api_key_v1.apiKeyPrefix = 'Token'; let apiInstance = new TalonOne.IntegrationApi(); let audienceId = 789; // Number | The ID of the audience. apiInstance.deleteAudienceV2(audienceId).then(() => { console.log('API called successfully.'); }, (error) => { console.error(error); }); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **audienceId** | **Number**| The ID of the audience. | ### Return type null (empty response body) ### Authorization [api_key_v1](../README.md#api_key_v1) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ## deleteCouponReservation > deleteCouponReservation(couponValue, body) Delete coupon reservations Remove all the coupon reservations from the provided customer profile integration IDs and the provided coupon code. ### Example ```javascript import TalonOne from 'talon_one'; let defaultClient = TalonOne.ApiClient.instance; // Configure API key authorization: api_key_v1 let api_key_v1 = defaultClient.authentications['api_key_v1']; api_key_v1.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //api_key_v1.apiKeyPrefix = 'Token'; let apiInstance = new TalonOne.IntegrationApi(); let couponValue = "couponValue_example"; // String | The code of the coupon. **Important:** The coupon code requires [URL encoding](https://www.w3schools.com/tags//ref_urlencode.asp) if it contains special characters. For example, you must encode `SUMMER25%OFF` as `SUMMER25%25OFF`. let body = new TalonOne.CouponReservations(); // CouponReservations | body apiInstance.deleteCouponReservation(couponValue, body).then(() => { console.log('API called successfully.'); }, (error) => { console.error(error); }); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **couponValue** | **String**| The code of the coupon. **Important:** The coupon code requires [URL encoding](https://www.w3schools.com/tags//ref_urlencode.asp) if it contains special characters. For example, you must encode `SUMMER25%OFF` as `SUMMER25%25OFF`. | **body** | [**CouponReservations**](CouponReservations.md)| body | ### Return type null (empty response body) ### Authorization [api_key_v1](../README.md#api_key_v1) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ## deleteCustomerData > deleteCustomerData(integrationId) Delete customer's personal data Delete all attributes on the customer profile and on entities that reference this customer profile. > [!warning] **Warning** > - Customer data is deleted from all Applications in the > [environment](https://docs.talon.one/docs/product/applications/overview#application-environments) > that the API key belongs to. For example, if you use this endpoint with an API key that belongs > to a sandbox Application, customer data will be deleted from all sandbox Applications. > This is because customer data is shared between Applications from the same environment. > - To preserve performance, we recommend avoiding deleting customer data > during peak-traffic hours. ### Example ```javascript import TalonOne from 'talon_one'; let defaultClient = TalonOne.ApiClient.instance; // Configure API key authorization: api_key_v1 let api_key_v1 = defaultClient.authentications['api_key_v1']; api_key_v1.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //api_key_v1.apiKeyPrefix = 'Token'; let apiInstance = new TalonOne.IntegrationApi(); let integrationId = "integrationId_example"; // String | The integration ID of the customer profile. You can get the `integrationId` of a profile using: - A customer session integration ID with the [Update customer session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint. - The Management API with the [List application's customers](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationCustomers) endpoint. apiInstance.deleteCustomerData(integrationId).then(() => { console.log('API called successfully.'); }, (error) => { console.error(error); }); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **integrationId** | **String**| The integration ID of the customer profile. You can get the `integrationId` of a profile using: - A customer session integration ID with the [Update customer session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint. - The Management API with the [List application's customers](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationCustomers) endpoint. | ### Return type null (empty response body) ### Authorization [api_key_v1](../README.md#api_key_v1) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ## deleteLoyaltyTransactionsFromLedgers > deleteLoyaltyTransactionsFromLedgers(loyaltyProgramId, integrationId, body) Delete customer's transactions from loyalty ledgers Delete a customer's transactions in all loyalty ledgers or a specified ledger. > [!note] To retrieve loyalty transaction logs for a specific customer in a given loyalty program, > use the [List customer's loyalty transactions](https://docs.talon.one/integration-api#tag/Loyalty/operation/getLoyaltyProgramProfileTransactions) > endpoint. ### Example ```javascript import TalonOne from 'talon_one'; let defaultClient = TalonOne.ApiClient.instance; // Configure API key authorization: api_key_v1 let api_key_v1 = defaultClient.authentications['api_key_v1']; api_key_v1.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //api_key_v1.apiKeyPrefix = 'Token'; let apiInstance = new TalonOne.IntegrationApi(); let loyaltyProgramId = 789; // Number | Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. let integrationId = "integrationId_example"; // String | The integration ID of the customer profile. You can get the `integrationId` of a profile using: - A customer session integration ID with the [Update customer session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint. - The Management API with the [List application's customers](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationCustomers) endpoint. let body = new TalonOne.DeleteLoyaltyTransactionsRequest(); // DeleteLoyaltyTransactionsRequest | apiInstance.deleteLoyaltyTransactionsFromLedgers(loyaltyProgramId, integrationId, body).then(() => { console.log('API called successfully.'); }, (error) => { console.error(error); }); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **loyaltyProgramId** | **Number**| Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. | **integrationId** | **String**| The integration ID of the customer profile. You can get the `integrationId` of a profile using: - A customer session integration ID with the [Update customer session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint. - The Management API with the [List application's customers](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationCustomers) endpoint. | **body** | [**DeleteLoyaltyTransactionsRequest**](DeleteLoyaltyTransactionsRequest.md)| | ### Return type null (empty response body) ### Authorization [api_key_v1](../README.md#api_key_v1) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ## generateLoyaltyCard > LoyaltyCard generateLoyaltyCard(loyaltyProgramId, body) Generate loyalty card Generate a loyalty card in a specified [card-based loyalty program](https://docs.talon.one/docs/product/loyalty-programs/card-based/card-based-overview). To link the card to one or more customer profiles, use the `customerProfileIds` parameter in the request body. > [!note] **Note** > - The number of customer profiles linked to the loyalty card cannot exceed > the loyalty program's `usersPerCardLimit`. To find the program's limit, use > the [Get loyalty program](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyProgram) > endpoint. > - If the loyalty program has a defined code format, it will be used for the > loyalty card identifier. ### Example ```javascript import TalonOne from 'talon_one'; let defaultClient = TalonOne.ApiClient.instance; // Configure API key authorization: api_key_v1 let api_key_v1 = defaultClient.authentications['api_key_v1']; api_key_v1.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //api_key_v1.apiKeyPrefix = 'Token'; let apiInstance = new TalonOne.IntegrationApi(); let loyaltyProgramId = 789; // Number | Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. let body = new TalonOne.GenerateLoyaltyCard(); // GenerateLoyaltyCard | body apiInstance.generateLoyaltyCard(loyaltyProgramId, body).then((data) => { console.log('API called successfully. Returned data: ' + data); }, (error) => { console.error(error); }); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **loyaltyProgramId** | **Number**| Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. | **body** | [**GenerateLoyaltyCard**](GenerateLoyaltyCard.md)| body | ### Return type [**LoyaltyCard**](LoyaltyCard.md) ### Authorization [api_key_v1](../README.md#api_key_v1) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ## getCustomerAchievementHistory > InlineResponse2003 getCustomerAchievementHistory(integrationId, achievementId, opts) List customer's achievement history Retrieve all progress history of a given customer in the given achievement. ### Example ```javascript import TalonOne from 'talon_one'; let defaultClient = TalonOne.ApiClient.instance; // Configure API key authorization: api_key_v1 let api_key_v1 = defaultClient.authentications['api_key_v1']; api_key_v1.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //api_key_v1.apiKeyPrefix = 'Token'; let apiInstance = new TalonOne.IntegrationApi(); let integrationId = "integrationId_example"; // String | The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. let achievementId = 789; // Number | The achievement identifier. let opts = { 'progressStatus': ["null"], // [String] | Filter by customer progress status in the achievement. 'startDate': new Date("2013-10-20T19:20:30+01:00"), // Date | Timestamp that filters the results to only contain achievements created on or after the start date. 'endDate': new Date("2013-10-20T19:20:30+01:00"), // Date | Timestamp that filters the results to only contain achievements created before or on the end date. 'pageSize': 1000, // Number | The number of items in the response. 'skip': 789 // Number | The number of items to skip when paging through large result sets. }; apiInstance.getCustomerAchievementHistory(integrationId, achievementId, opts).then((data) => { console.log('API called successfully. Returned data: ' + data); }, (error) => { console.error(error); }); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **integrationId** | **String**| The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. | **achievementId** | **Number**| The achievement identifier. | **progressStatus** | [**[String]**](String.md)| Filter by customer progress status in the achievement. | [optional] **startDate** | **Date**| Timestamp that filters the results to only contain achievements created on or after the start date. | [optional] **endDate** | **Date**| Timestamp that filters the results to only contain achievements created before or on the end date. | [optional] **pageSize** | **Number**| The number of items in the response. | [optional] [default to 1000] **skip** | **Number**| The number of items to skip when paging through large result sets. | [optional] ### Return type [**InlineResponse2003**](InlineResponse2003.md) ### Authorization [api_key_v1](../README.md#api_key_v1) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ## getCustomerAchievements > InlineResponse2002 getCustomerAchievements(integrationId, opts) List customer's available achievements Retrieve all the achievements available to a given customer and their progress in them. ### Example ```javascript import TalonOne from 'talon_one'; let defaultClient = TalonOne.ApiClient.instance; // Configure API key authorization: api_key_v1 let api_key_v1 = defaultClient.authentications['api_key_v1']; api_key_v1.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //api_key_v1.apiKeyPrefix = 'Token'; let apiInstance = new TalonOne.IntegrationApi(); let integrationId = "integrationId_example"; // String | The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. let opts = { 'campaignIds': ["null"], // [String] | Filter by one or more Campaign IDs, separated by a comma. **Note:** If no campaigns are specified, data for all the campaigns in the Application is returned. 'achievementIds': ["null"], // [String] | Filter by one or more Achievement IDs, separated by a comma. **Note:** If no achievements are specified, data for all the achievements in the Application is returned. 'achievementStatus': ["null"], // [String] | Filter by status of the achievement. **Note:** If the achievement status is not specified, only data for all active achievements in the Application is returned. 'currentProgressStatus': ["null"], // [String] | Filter by customer progress status in the achievement. 'pageSize': 1000, // Number | The number of items in the response. 'skip': 789 // Number | The number of items to skip when paging through large result sets. }; apiInstance.getCustomerAchievements(integrationId, opts).then((data) => { console.log('API called successfully. Returned data: ' + data); }, (error) => { console.error(error); }); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **integrationId** | **String**| The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. | **campaignIds** | [**[String]**](String.md)| Filter by one or more Campaign IDs, separated by a comma. **Note:** If no campaigns are specified, data for all the campaigns in the Application is returned. | [optional] **achievementIds** | [**[String]**](String.md)| Filter by one or more Achievement IDs, separated by a comma. **Note:** If no achievements are specified, data for all the achievements in the Application is returned. | [optional] **achievementStatus** | [**[String]**](String.md)| Filter by status of the achievement. **Note:** If the achievement status is not specified, only data for all active achievements in the Application is returned. | [optional] **currentProgressStatus** | [**[String]**](String.md)| Filter by customer progress status in the achievement. | [optional] **pageSize** | **Number**| The number of items in the response. | [optional] [default to 1000] **skip** | **Number**| The number of items to skip when paging through large result sets. | [optional] ### Return type [**InlineResponse2002**](InlineResponse2002.md) ### Authorization [api_key_v1](../README.md#api_key_v1) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ## getCustomerInventory > CustomerInventory getCustomerInventory(integrationId, opts) List customer data Return the customer inventory regarding entities referencing this customer profile's `integrationId`. Typical entities returned are: customer profile information, referral codes, loyalty points, loyalty cards and reserved coupons. Reserved coupons also include redeemed coupons. ### Example ```javascript import TalonOne from 'talon_one'; let defaultClient = TalonOne.ApiClient.instance; // Configure API key authorization: api_key_v1 let api_key_v1 = defaultClient.authentications['api_key_v1']; api_key_v1.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //api_key_v1.apiKeyPrefix = 'Token'; let apiInstance = new TalonOne.IntegrationApi(); let integrationId = "integrationId_example"; // String | The integration ID of the customer profile. You can get the `integrationId` of a profile using: - A customer session integration ID with the [Update customer session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint. - The Management API with the [List application's customers](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationCustomers) endpoint. let opts = { 'profile': true, // Boolean | Set to `true` to include customer profile information in the response. 'referrals': true, // Boolean | Set to `true` to include referral information in the response. 'coupons': true, // Boolean | Set to `true` to include coupon information in the response. 'loyalty': true, // Boolean | Set to `true` to include loyalty information in the response. 'giveaways': true, // Boolean | Set to `true` to include giveaways information in the response. 'achievements': true, // Boolean | Set to `true` to include achievement information in the response. 'unlockedRewards': true // Boolean | Set to `true` to include `unlocked` rewards that have not been `used` in the response. }; apiInstance.getCustomerInventory(integrationId, opts).then((data) => { console.log('API called successfully. Returned data: ' + data); }, (error) => { console.error(error); }); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **integrationId** | **String**| The integration ID of the customer profile. You can get the `integrationId` of a profile using: - A customer session integration ID with the [Update customer session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint. - The Management API with the [List application's customers](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationCustomers) endpoint. | **profile** | **Boolean**| Set to `true` to include customer profile information in the response. | [optional] **referrals** | **Boolean**| Set to `true` to include referral information in the response. | [optional] **coupons** | **Boolean**| Set to `true` to include coupon information in the response. | [optional] **loyalty** | **Boolean**| Set to `true` to include loyalty information in the response. | [optional] **giveaways** | **Boolean**| Set to `true` to include giveaways information in the response. | [optional] **achievements** | **Boolean**| Set to `true` to include achievement information in the response. | [optional] **unlockedRewards** | **Boolean**| Set to `true` to include `unlocked` rewards that have not been `used` in the response. | [optional] ### Return type [**CustomerInventory**](CustomerInventory.md) ### Authorization [api_key_v1](../README.md#api_key_v1) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ## getCustomerSession > IntegrationCustomerSessionResponse getCustomerSession(customerSessionId) Get customer session Get the details of the given customer session. You can get the same data via other endpoints that also apply changes, which can help you save requests and increase performance. See: - [Update customer session](#tag/Customer-sessions/operation/updateCustomerSessionV2) - [Update customer profile](#tag/Customer-profiles/operation/updateCustomerProfileV2) ### Example ```javascript import TalonOne from 'talon_one'; let defaultClient = TalonOne.ApiClient.instance; // Configure API key authorization: api_key_v1 let api_key_v1 = defaultClient.authentications['api_key_v1']; api_key_v1.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //api_key_v1.apiKeyPrefix = 'Token'; let apiInstance = new TalonOne.IntegrationApi(); let customerSessionId = "customerSessionId_example"; // String | The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint. **Notes**: - There is no length limit for this ID. - It must be URL-encoded. For example, replace spaces with `%20`. [Learn more](https://www.w3schools.com/tags/ref_urlencode.asp). apiInstance.getCustomerSession(customerSessionId).then((data) => { console.log('API called successfully. Returned data: ' + data); }, (error) => { console.error(error); }); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **customerSessionId** | **String**| The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint. **Notes**: - There is no length limit for this ID. - It must be URL-encoded. For example, replace spaces with `%20`. [Learn more](https://www.w3schools.com/tags/ref_urlencode.asp). | ### Return type [**IntegrationCustomerSessionResponse**](IntegrationCustomerSessionResponse.md) ### Authorization [api_key_v1](../README.md#api_key_v1) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ## getEventV3 > EventV3 getEventV3(integrationId) Get advanced event Retrieve an advanced event by its identifier. ### Example ```javascript import TalonOne from 'talon_one'; let defaultClient = TalonOne.ApiClient.instance; // Configure API key authorization: api_key_v1 let api_key_v1 = defaultClient.authentications['api_key_v1']; api_key_v1.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //api_key_v1.apiKeyPrefix = 'Token'; let apiInstance = new TalonOne.IntegrationApi(); let integrationId = "integrationId_example"; // String | The unique ID of the advanced event. apiInstance.getEventV3(integrationId).then((data) => { console.log('API called successfully. Returned data: ' + data); }, (error) => { console.error(error); }); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **integrationId** | **String**| The unique ID of the advanced event. | ### Return type [**EventV3**](EventV3.md) ### Authorization [api_key_v1](../README.md#api_key_v1) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ## getLoyaltyBalances > LoyaltyBalancesWithTiers getLoyaltyBalances(loyaltyProgramId, integrationId, opts) Get customer's loyalty balances Retrieve loyalty ledger balances for the given Integration ID in the specified loyalty program. You can filter balances by date and subledger ID, and include tier-related information in the response. > [!note] If no filtering options are applied, you retrieve all loyalty > balances on the current date for the given integration ID. Loyalty balances are calculated when Talon.One receives your request using the points stored in our database, so retrieving a large number of balances at once can impact performance. For more information, see: - [Managing card-based loyalty program data](https://docs.talon.one/docs/product/loyalty-programs/card-based/managing-loyalty-cards) - [Managing profile-based loyalty program data](https://docs.talon.one/docs/product/loyalty-programs/profile-based/managing-pb-lp-data) ### Example ```javascript import TalonOne from 'talon_one'; let defaultClient = TalonOne.ApiClient.instance; // Configure API key authorization: api_key_v1 let api_key_v1 = defaultClient.authentications['api_key_v1']; api_key_v1.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //api_key_v1.apiKeyPrefix = 'Token'; let apiInstance = new TalonOne.IntegrationApi(); let loyaltyProgramId = 789; // Number | Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. let integrationId = "integrationId_example"; // String | The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. let opts = { 'endDate': new Date("2013-10-20T19:20:30+01:00"), // Date | Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. > [!note] **Note** > - This must be an RFC3339 timestamp string. > - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting > considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. 'subledgerId': "subledgerId_example", // String | The ID of the subledger by which we filter the data. 'includeTiers': false, // Boolean | Indicates whether tier information is included in the response. When set to `true`, the response includes information about the current tier and the number of points required to move to next tier. 'includeProjectedTier': false // Boolean | Indicates whether the customer's projected tier information is included in the response. When set to `true`, the response includes information about the customer's active points and the name of the projected tier. **Note** We recommend filtering by `subledgerId` for better performance. }; apiInstance.getLoyaltyBalances(loyaltyProgramId, integrationId, opts).then((data) => { console.log('API called successfully. Returned data: ' + data); }, (error) => { console.error(error); }); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **loyaltyProgramId** | **Number**| Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. | **integrationId** | **String**| The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. | **endDate** | **Date**| Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. > [!note] **Note** > - This must be an RFC3339 timestamp string. > - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting > considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. | [optional] **subledgerId** | **String**| The ID of the subledger by which we filter the data. | [optional] **includeTiers** | **Boolean**| Indicates whether tier information is included in the response. When set to `true`, the response includes information about the current tier and the number of points required to move to next tier. | [optional] [default to false] **includeProjectedTier** | **Boolean**| Indicates whether the customer's projected tier information is included in the response. When set to `true`, the response includes information about the customer's active points and the name of the projected tier. **Note** We recommend filtering by `subledgerId` for better performance. | [optional] [default to false] ### Return type [**LoyaltyBalancesWithTiers**](LoyaltyBalancesWithTiers.md) ### Authorization [api_key_v1](../README.md#api_key_v1) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ## getLoyaltyCardBalances > LoyaltyCardBalances getLoyaltyCardBalances(loyaltyProgramId, loyaltyCardId, opts) Get card's point balances Retrieve loyalty balances for the given loyalty card in the specified loyalty program with filtering options applied. If no filtering options are applied, all loyalty balances for the given loyalty card are returned. ### Example ```javascript import TalonOne from 'talon_one'; let defaultClient = TalonOne.ApiClient.instance; // Configure API key authorization: api_key_v1 let api_key_v1 = defaultClient.authentications['api_key_v1']; api_key_v1.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //api_key_v1.apiKeyPrefix = 'Token'; let apiInstance = new TalonOne.IntegrationApi(); let loyaltyProgramId = 789; // Number | Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. let loyaltyCardId = "loyaltyCardId_example"; // String | Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. **Important**: The loyalty card ID requires [URL encoding](https://www.w3schools.com/tags//ref_urlencode.asp) if it contains special characters. For example, you must encode `NewCard2026%` as `NewCard2026%25`. let opts = { 'endDate': new Date("2013-10-20T19:20:30+01:00"), // Date | Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. > [!note] **Note** > - This must be an RFC3339 timestamp string. > - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting > considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. 'subledgerId': ["null"] // [String] | Filter results by one or more subledger IDs. Must be exact match. }; apiInstance.getLoyaltyCardBalances(loyaltyProgramId, loyaltyCardId, opts).then((data) => { console.log('API called successfully. Returned data: ' + data); }, (error) => { console.error(error); }); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **loyaltyProgramId** | **Number**| Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. | **loyaltyCardId** | **String**| Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. **Important**: The loyalty card ID requires [URL encoding](https://www.w3schools.com/tags//ref_urlencode.asp) if it contains special characters. For example, you must encode `NewCard2026%` as `NewCard2026%25`. | **endDate** | **Date**| Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. > [!note] **Note** > - This must be an RFC3339 timestamp string. > - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting > considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. | [optional] **subledgerId** | [**[String]**](String.md)| Filter results by one or more subledger IDs. Must be exact match. | [optional] ### Return type [**LoyaltyCardBalances**](LoyaltyCardBalances.md) ### Authorization [api_key_v1](../README.md#api_key_v1) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ## getLoyaltyCardPoints > InlineResponse2006 getLoyaltyCardPoints(loyaltyProgramId, loyaltyCardId, opts) List card's unused loyalty points Get paginated results of loyalty points for a given loyalty card identifier in a card-based loyalty program. This endpoint returns only the balances of unused points on a loyalty card. You can filter points by status: - `active`: Points ready to be redeemed. - `pending`: Points with a start date in the future. - `expired`: Points with an expiration date in the past. ### Example ```javascript import TalonOne from 'talon_one'; let defaultClient = TalonOne.ApiClient.instance; // Configure API key authorization: api_key_v1 let api_key_v1 = defaultClient.authentications['api_key_v1']; api_key_v1.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //api_key_v1.apiKeyPrefix = 'Token'; let apiInstance = new TalonOne.IntegrationApi(); let loyaltyProgramId = 789; // Number | Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. let loyaltyCardId = "loyaltyCardId_example"; // String | Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. **Important**: The loyalty card ID requires [URL encoding](https://www.w3schools.com/tags//ref_urlencode.asp) if it contains special characters. For example, you must encode `NewCard2026%` as `NewCard2026%25`. let opts = { 'status': "'active'", // String | Filter points based on their status. 'subledgerId': ["null"], // [String] | Filter results by one or more subledger IDs. Must be exact match. 'customerSessionIDs': ["null"], // [String] | Filter the results by a list of customer session IDs. To include multiple IDs, repeat the parameter for each one, for example, `?customerSessionIDs=id1&customerSessionIDs=id2`. The response contains only data associated with the specified sessions. 'transactionUUIDs': ["null"], // [String] | Filter the results by a list of transaction UUIDs. To include multiple IDs, repeat the parameter for each one, for example, `?transactionUUIDs=uuid1&transactionUUIDs=uuid2`. The response contains only data associated with the specified transactions. 'pageSize': 50, // Number | The number of items in the response. 'skip': 789, // Number | The number of items to skip when paging through large result sets. 'sort': "sort_example" // String | The field by which results should be sorted. You can enter one of the following values: - `startDate`: Sorts the results by the start date of the points. - `expiryDate`: Sorts the results by the expiry date of the points. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** You can only sort by one field at a time. }; apiInstance.getLoyaltyCardPoints(loyaltyProgramId, loyaltyCardId, opts).then((data) => { console.log('API called successfully. Returned data: ' + data); }, (error) => { console.error(error); }); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **loyaltyProgramId** | **Number**| Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. | **loyaltyCardId** | **String**| Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. **Important**: The loyalty card ID requires [URL encoding](https://www.w3schools.com/tags//ref_urlencode.asp) if it contains special characters. For example, you must encode `NewCard2026%` as `NewCard2026%25`. | **status** | **String**| Filter points based on their status. | [optional] [default to 'active'] **subledgerId** | [**[String]**](String.md)| Filter results by one or more subledger IDs. Must be exact match. | [optional] **customerSessionIDs** | [**[String]**](String.md)| Filter the results by a list of customer session IDs. To include multiple IDs, repeat the parameter for each one, for example, `?customerSessionIDs=id1&customerSessionIDs=id2`. The response contains only data associated with the specified sessions. | [optional] **transactionUUIDs** | [**[String]**](String.md)| Filter the results by a list of transaction UUIDs. To include multiple IDs, repeat the parameter for each one, for example, `?transactionUUIDs=uuid1&transactionUUIDs=uuid2`. The response contains only data associated with the specified transactions. | [optional] **pageSize** | **Number**| The number of items in the response. | [optional] [default to 50] **skip** | **Number**| The number of items to skip when paging through large result sets. | [optional] **sort** | **String**| The field by which results should be sorted. You can enter one of the following values: - `startDate`: Sorts the results by the start date of the points. - `expiryDate`: Sorts the results by the expiry date of the points. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** You can only sort by one field at a time. | [optional] ### Return type [**InlineResponse2006**](InlineResponse2006.md) ### Authorization [api_key_v1](../README.md#api_key_v1) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ## getLoyaltyCardTransactions > InlineResponse2004 getLoyaltyCardTransactions(loyaltyProgramId, loyaltyCardId, opts) List card's transactions Retrieve loyalty transaction logs for the given loyalty card in the specified loyalty program with filtering options applied. If no filtering options are applied, the last 50 loyalty transactions for the given loyalty card are returned. ### Example ```javascript import TalonOne from 'talon_one'; let defaultClient = TalonOne.ApiClient.instance; // Configure API key authorization: api_key_v1 let api_key_v1 = defaultClient.authentications['api_key_v1']; api_key_v1.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //api_key_v1.apiKeyPrefix = 'Token'; let apiInstance = new TalonOne.IntegrationApi(); let loyaltyProgramId = 789; // Number | Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. let loyaltyCardId = "loyaltyCardId_example"; // String | Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. **Important**: The loyalty card ID requires [URL encoding](https://www.w3schools.com/tags//ref_urlencode.asp) if it contains special characters. For example, you must encode `NewCard2026%` as `NewCard2026%25`. let opts = { 'subledgerId': ["null"], // [String] | Filter results by one or more subledger IDs. Must be exact match. 'loyaltyTransactionType': "loyaltyTransactionType_example", // String | Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. 'startDate': new Date("2013-10-20T19:20:30+01:00"), // Date | Date and time from which results are returned. Results are filtered by transaction creation date. > [!note] **Note** > - This must be an RFC3339 timestamp string. > - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting > considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. 'endDate': new Date("2013-10-20T19:20:30+01:00"), // Date | Date and time by which results are returned. Results are filtered by transaction creation date. > [!note] **Note** > - This must be an RFC3339 timestamp string. > - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting > considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. 'customerSessionIDs': ["null"], // [String] | Filter the results by a list of customer session IDs. To include multiple IDs, repeat the parameter for each one, for example, `?customerSessionIDs=id1&customerSessionIDs=id2`. The response contains only data associated with the specified sessions. 'transactionUUIDs': ["null"], // [String] | Filter the results by a list of transaction UUIDs. To include multiple IDs, repeat the parameter for each one, for example, `?transactionUUIDs=uuid1&transactionUUIDs=uuid2`. The response contains only data associated with the specified transactions. 'pageSize': 50, // Number | The number of items in the response. 'skip': 789, // Number | The number of items to skip when paging through large result sets. 'awaitsActivation': true // Boolean | If `true`: Filters results to include only point transactions that have action-based activation and have not expired. If `false`: Returns a `400` response. }; apiInstance.getLoyaltyCardTransactions(loyaltyProgramId, loyaltyCardId, opts).then((data) => { console.log('API called successfully. Returned data: ' + data); }, (error) => { console.error(error); }); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **loyaltyProgramId** | **Number**| Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. | **loyaltyCardId** | **String**| Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. **Important**: The loyalty card ID requires [URL encoding](https://www.w3schools.com/tags//ref_urlencode.asp) if it contains special characters. For example, you must encode `NewCard2026%` as `NewCard2026%25`. | **subledgerId** | [**[String]**](String.md)| Filter results by one or more subledger IDs. Must be exact match. | [optional] **loyaltyTransactionType** | **String**| Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. | [optional] **startDate** | **Date**| Date and time from which results are returned. Results are filtered by transaction creation date. > [!note] **Note** > - This must be an RFC3339 timestamp string. > - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting > considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. | [optional] **endDate** | **Date**| Date and time by which results are returned. Results are filtered by transaction creation date. > [!note] **Note** > - This must be an RFC3339 timestamp string. > - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting > considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. | [optional] **customerSessionIDs** | [**[String]**](String.md)| Filter the results by a list of customer session IDs. To include multiple IDs, repeat the parameter for each one, for example, `?customerSessionIDs=id1&customerSessionIDs=id2`. The response contains only data associated with the specified sessions. | [optional] **transactionUUIDs** | [**[String]**](String.md)| Filter the results by a list of transaction UUIDs. To include multiple IDs, repeat the parameter for each one, for example, `?transactionUUIDs=uuid1&transactionUUIDs=uuid2`. The response contains only data associated with the specified transactions. | [optional] **pageSize** | **Number**| The number of items in the response. | [optional] [default to 50] **skip** | **Number**| The number of items to skip when paging through large result sets. | [optional] **awaitsActivation** | **Boolean**| If `true`: Filters results to include only point transactions that have action-based activation and have not expired. If `false`: Returns a `400` response. | [optional] ### Return type [**InlineResponse2004**](InlineResponse2004.md) ### Authorization [api_key_v1](../README.md#api_key_v1) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ## getLoyaltyProgramProfilePoints > InlineResponse2007 getLoyaltyProgramProfilePoints(loyaltyProgramId, integrationId, opts) List customer's unused loyalty points Get paginated results of loyalty points for a given Integration ID in the specified profile-based loyalty program. This endpoint returns only the balances of unused points linked to a customer profile. You can filter points by status: - `active`: Points ready to be redeemed. - `pending`: Points with a start date in the future. - `expired`: Points with an expiration date in the past. ### Example ```javascript import TalonOne from 'talon_one'; let defaultClient = TalonOne.ApiClient.instance; // Configure API key authorization: api_key_v1 let api_key_v1 = defaultClient.authentications['api_key_v1']; api_key_v1.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //api_key_v1.apiKeyPrefix = 'Token'; let apiInstance = new TalonOne.IntegrationApi(); let loyaltyProgramId = 789; // Number | Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. let integrationId = "integrationId_example"; // String | The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. let opts = { 'status': "'active'", // String | Filter points based on their status. 'subledgerId': ["null"], // [String] | Filter the results by a list of subledger IDs. To include multiple IDs, repeat the parameter for each one, for example, `?subledgerId=id1&subledgerId=id2`. The response contains only data associated with the specified subledgers. 'customerSessionIDs': ["null"], // [String] | Filter the results by a list of customer session IDs. To include multiple IDs, repeat the parameter for each one, for example, `?customerSessionIDs=id1&customerSessionIDs=id2`. The response contains only data associated with the specified sessions. 'transactionUUIDs': ["null"], // [String] | Filter the results by a list of transaction UUIDs. To include multiple IDs, repeat the parameter for each one, for example, `?transactionUUIDs=uuid1&transactionUUIDs=uuid2`. The response contains only data associated with the specified transactions. 'pageSize': 50, // Number | The number of items in the response. 'skip': 789, // Number | The number of items to skip when paging through large result sets. 'sort': "sort_example" // String | The field by which results should be sorted. You can enter one of the following values: - `startDate`: Sorts the results by the start date of the points. - `expiryDate`: Sorts the results by the expiry date of the points. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** You can only sort by one field at a time. }; apiInstance.getLoyaltyProgramProfilePoints(loyaltyProgramId, integrationId, opts).then((data) => { console.log('API called successfully. Returned data: ' + data); }, (error) => { console.error(error); }); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **loyaltyProgramId** | **Number**| Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. | **integrationId** | **String**| The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. | **status** | **String**| Filter points based on their status. | [optional] [default to 'active'] **subledgerId** | [**[String]**](String.md)| Filter the results by a list of subledger IDs. To include multiple IDs, repeat the parameter for each one, for example, `?subledgerId=id1&subledgerId=id2`. The response contains only data associated with the specified subledgers. | [optional] **customerSessionIDs** | [**[String]**](String.md)| Filter the results by a list of customer session IDs. To include multiple IDs, repeat the parameter for each one, for example, `?customerSessionIDs=id1&customerSessionIDs=id2`. The response contains only data associated with the specified sessions. | [optional] **transactionUUIDs** | [**[String]**](String.md)| Filter the results by a list of transaction UUIDs. To include multiple IDs, repeat the parameter for each one, for example, `?transactionUUIDs=uuid1&transactionUUIDs=uuid2`. The response contains only data associated with the specified transactions. | [optional] **pageSize** | **Number**| The number of items in the response. | [optional] [default to 50] **skip** | **Number**| The number of items to skip when paging through large result sets. | [optional] **sort** | **String**| The field by which results should be sorted. You can enter one of the following values: - `startDate`: Sorts the results by the start date of the points. - `expiryDate`: Sorts the results by the expiry date of the points. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** You can only sort by one field at a time. | [optional] ### Return type [**InlineResponse2007**](InlineResponse2007.md) ### Authorization [api_key_v1](../README.md#api_key_v1) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ## getLoyaltyProgramProfileTransactions > InlineResponse2005 getLoyaltyProgramProfileTransactions(loyaltyProgramId, integrationId, opts) List customer's loyalty transactions Retrieve paginated results of loyalty transaction logs for the given Integration ID in the specified loyalty program. You can filter transactions by date. If no filters are applied, the last 50 loyalty transactions for the given integration ID are returned. > [!note] To retrieve all loyalty program transaction logs in a given > loyalty program, use the [List loyalty program transactions](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyProgramTransactions) > endpoint. ### Example ```javascript import TalonOne from 'talon_one'; let defaultClient = TalonOne.ApiClient.instance; // Configure API key authorization: api_key_v1 let api_key_v1 = defaultClient.authentications['api_key_v1']; api_key_v1.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //api_key_v1.apiKeyPrefix = 'Token'; let apiInstance = new TalonOne.IntegrationApi(); let loyaltyProgramId = 789; // Number | Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. let integrationId = "integrationId_example"; // String | The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. let opts = { 'customerSessionIDs': ["null"], // [String] | Filter the results by a list of customer session IDs. To include multiple IDs, repeat the parameter for each one, for example, `?customerSessionIDs=id1&customerSessionIDs=id2`. The response contains only data associated with the specified sessions. 'transactionUUIDs': ["null"], // [String] | Filter the results by a list of transaction UUIDs. To include multiple IDs, repeat the parameter for each one, for example, `?transactionUUIDs=uuid1&transactionUUIDs=uuid2`. The response contains only data associated with the specified transactions. 'subledgerId': ["null"], // [String] | Filter the results by a list of subledger IDs. To include multiple IDs, repeat the parameter for each one, for example, `?subledgerId=id1&subledgerId=id2`. The response contains only data associated with the specified subledgers. 'loyaltyTransactionType': "loyaltyTransactionType_example", // String | Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. 'startDate': new Date("2013-10-20T19:20:30+01:00"), // Date | Date and time from which results are returned. Results are filtered by transaction creation date. > [!note] **Note** > - This must be an RFC3339 timestamp string. > - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting > considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. 'endDate': new Date("2013-10-20T19:20:30+01:00"), // Date | Date and time by which results are returned. Results are filtered by transaction creation date. > [!note] **Note** > - This must be an RFC3339 timestamp string. > - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting > considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. 'pageSize': 50, // Number | The number of items in the response. 'skip': 789, // Number | The number of items to skip when paging through large result sets. 'awaitsActivation': true // Boolean | If `true`: Filters results to include only point transactions that have action-based activation and have not expired. If `false`: Returns a `400` response. }; apiInstance.getLoyaltyProgramProfileTransactions(loyaltyProgramId, integrationId, opts).then((data) => { console.log('API called successfully. Returned data: ' + data); }, (error) => { console.error(error); }); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **loyaltyProgramId** | **Number**| Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. | **integrationId** | **String**| The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. | **customerSessionIDs** | [**[String]**](String.md)| Filter the results by a list of customer session IDs. To include multiple IDs, repeat the parameter for each one, for example, `?customerSessionIDs=id1&customerSessionIDs=id2`. The response contains only data associated with the specified sessions. | [optional] **transactionUUIDs** | [**[String]**](String.md)| Filter the results by a list of transaction UUIDs. To include multiple IDs, repeat the parameter for each one, for example, `?transactionUUIDs=uuid1&transactionUUIDs=uuid2`. The response contains only data associated with the specified transactions. | [optional] **subledgerId** | [**[String]**](String.md)| Filter the results by a list of subledger IDs. To include multiple IDs, repeat the parameter for each one, for example, `?subledgerId=id1&subledgerId=id2`. The response contains only data associated with the specified subledgers. | [optional] **loyaltyTransactionType** | **String**| Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. | [optional] **startDate** | **Date**| Date and time from which results are returned. Results are filtered by transaction creation date. > [!note] **Note** > - This must be an RFC3339 timestamp string. > - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting > considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. | [optional] **endDate** | **Date**| Date and time by which results are returned. Results are filtered by transaction creation date. > [!note] **Note** > - This must be an RFC3339 timestamp string. > - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting > considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. | [optional] **pageSize** | **Number**| The number of items in the response. | [optional] [default to 50] **skip** | **Number**| The number of items to skip when paging through large result sets. | [optional] **awaitsActivation** | **Boolean**| If `true`: Filters results to include only point transactions that have action-based activation and have not expired. If `false`: Returns a `400` response. | [optional] ### Return type [**InlineResponse2005**](InlineResponse2005.md) ### Authorization [api_key_v1](../README.md#api_key_v1) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ## getReservedCustomers > InlineResponse2001 getReservedCustomers(couponValue) List customers that have this coupon reserved Return all customers that have this coupon marked as reserved. This includes hard and soft reservations. ### Example ```javascript import TalonOne from 'talon_one'; let defaultClient = TalonOne.ApiClient.instance; // Configure API key authorization: api_key_v1 let api_key_v1 = defaultClient.authentications['api_key_v1']; api_key_v1.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //api_key_v1.apiKeyPrefix = 'Token'; let apiInstance = new TalonOne.IntegrationApi(); let couponValue = "couponValue_example"; // String | The code of the coupon. **Important:** The coupon code requires [URL encoding](https://www.w3schools.com/tags//ref_urlencode.asp) if it contains special characters. For example, you must encode `SUMMER25%OFF` as `SUMMER25%25OFF`. apiInstance.getReservedCustomers(couponValue).then((data) => { console.log('API called successfully. Returned data: ' + data); }, (error) => { console.error(error); }); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **couponValue** | **String**| The code of the coupon. **Important:** The coupon code requires [URL encoding](https://www.w3schools.com/tags//ref_urlencode.asp) if it contains special characters. For example, you must encode `SUMMER25%OFF` as `SUMMER25%25OFF`. | ### Return type [**InlineResponse2001**](InlineResponse2001.md) ### Authorization [api_key_v1](../README.md#api_key_v1) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ## integrationGetAllCampaigns > InlineResponse200 integrationGetAllCampaigns(opts) List all running campaigns Retrieve all running campaigns for the specified Application. You can filter the results by providing specific campaign IDs or a range of start and end dates. ### Example ```javascript import TalonOne from 'talon_one'; let defaultClient = TalonOne.ApiClient.instance; // Configure API key authorization: api_key_v1 let api_key_v1 = defaultClient.authentications['api_key_v1']; api_key_v1.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //api_key_v1.apiKeyPrefix = 'Token'; let apiInstance = new TalonOne.IntegrationApi(); let opts = { 'pageSize': 50, // Number | The number of items in the response. 'skip': 789, // Number | The number of items to skip when paging through large result sets. 'campaignIds': ["null"], // [String] | Filter by one or more campaign IDs, separated by a comma. **Note:** If no campaigns are specified, data for all the campaigns in the Application is returned. 'startAfter': new Date("2013-10-20T19:20:30+01:00"), // Date | Filter results to only include campaigns that start on or after the specified timestamp. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. 'startBefore': new Date("2013-10-20T19:20:30+01:00"), // Date | Filter results to only include campaigns that start on or before the specified timestamp. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. 'endAfter': new Date("2013-10-20T19:20:30+01:00"), // Date | Filter results to only include campaigns that end on or after the specified timestamp. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. 'endBefore': new Date("2013-10-20T19:20:30+01:00"), // Date | Filter results to only include campaigns that end on or before the specified timestamp. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. 'storeId': 789, // Number | Filter results to campaigns linked to the specified store ID. 'audienceId': 789 // Number | Filter results to campaigns linked to the specified audience ID. }; apiInstance.integrationGetAllCampaigns(opts).then((data) => { console.log('API called successfully. Returned data: ' + data); }, (error) => { console.error(error); }); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **pageSize** | **Number**| The number of items in the response. | [optional] [default to 50] **skip** | **Number**| The number of items to skip when paging through large result sets. | [optional] **campaignIds** | [**[String]**](String.md)| Filter by one or more campaign IDs, separated by a comma. **Note:** If no campaigns are specified, data for all the campaigns in the Application is returned. | [optional] **startAfter** | **Date**| Filter results to only include campaigns that start on or after the specified timestamp. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. | [optional] **startBefore** | **Date**| Filter results to only include campaigns that start on or before the specified timestamp. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. | [optional] **endAfter** | **Date**| Filter results to only include campaigns that end on or after the specified timestamp. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. | [optional] **endBefore** | **Date**| Filter results to only include campaigns that end on or before the specified timestamp. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. | [optional] **storeId** | **Number**| Filter results to campaigns linked to the specified store ID. | [optional] **audienceId** | **Number**| Filter results to campaigns linked to the specified audience ID. | [optional] ### Return type [**InlineResponse200**](InlineResponse200.md) ### Authorization [api_key_v1](../README.md#api_key_v1) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ## integrationRewardsCatalog > InlineResponse20056 integrationRewardsCatalog(opts) List rewards in the catalog Retrieve the rewards catalog for the Application. Returns a paginated list of rewards. ### Example ```javascript import TalonOne from 'talon_one'; let defaultClient = TalonOne.ApiClient.instance; // Configure API key authorization: api_key_v1 let api_key_v1 = defaultClient.authentications['api_key_v1']; api_key_v1.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //api_key_v1.apiKeyPrefix = 'Token'; let apiInstance = new TalonOne.IntegrationApi(); let opts = { 'pageSize': 1000, // Number | The number of items in the response. 'skip': 789, // Number | The number of items to skip when paging through large result sets. 'pointsFrom': 3.4, // Number | Return only rewards whose points required is greater than or equal to this value. 'pointsTo': 3.4, // Number | Return only rewards whose points required is less than or equal to this value. 'includeFree': true, // Boolean | Whether to include rewards that have no `pointsRequired`. These rewards are treated as free and available to all customers. 'loyaltyProgramId': 789, // Number | Return only rewards available in this loyalty program. 'subledgerId': "subledgerId_example", // String | Return only rewards available in this subledger. Must be combined with `loyaltyProgramId`. To specify the main ledger, provide an empty string (\"\"). 'profileIntegrationId': "profileIntegrationId_example", // String | The integration ID of the customer profile whose loyalty balances to include in the response. Balances are returned only when `loyaltyProgramId` is also provided. **Note:** `profileIntegrationId` and `loyaltyCardId` are mutually exclusive. Do not send both in the same request. 'loyaltyCardId': "loyaltyCardId_example" // String | The identifier of the loyalty card whose loyalty balances to include in the response. Balances are returned only when `loyaltyProgramId` is also provided. **Note:** `profileIntegrationId` and `loyaltyCardId` are mutually exclusive. Do not send both in the same request. }; apiInstance.integrationRewardsCatalog(opts).then((data) => { console.log('API called successfully. Returned data: ' + data); }, (error) => { console.error(error); }); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **pageSize** | **Number**| The number of items in the response. | [optional] [default to 1000] **skip** | **Number**| The number of items to skip when paging through large result sets. | [optional] **pointsFrom** | **Number**| Return only rewards whose points required is greater than or equal to this value. | [optional] **pointsTo** | **Number**| Return only rewards whose points required is less than or equal to this value. | [optional] **includeFree** | **Boolean**| Whether to include rewards that have no `pointsRequired`. These rewards are treated as free and available to all customers. | [optional] [default to true] **loyaltyProgramId** | **Number**| Return only rewards available in this loyalty program. | [optional] **subledgerId** | **String**| Return only rewards available in this subledger. Must be combined with `loyaltyProgramId`. To specify the main ledger, provide an empty string (\"\"). | [optional] **profileIntegrationId** | **String**| The integration ID of the customer profile whose loyalty balances to include in the response. Balances are returned only when `loyaltyProgramId` is also provided. **Note:** `profileIntegrationId` and `loyaltyCardId` are mutually exclusive. Do not send both in the same request. | [optional] **loyaltyCardId** | **String**| The identifier of the loyalty card whose loyalty balances to include in the response. Balances are returned only when `loyaltyProgramId` is also provided. **Note:** `profileIntegrationId` and `loyaltyCardId` are mutually exclusive. Do not send both in the same request. | [optional] ### Return type [**InlineResponse20056**](InlineResponse20056.md) ### Authorization [api_key_v1](../README.md#api_key_v1) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ## joinLoyaltyProgram > joinLoyaltyProgram(loyaltyProgramId, integrationId) Join customer profile to loyalty program Join a customer profile to the specified loyalty program. If the customer profile does not exist, it will be created first using the provided `integrationId`, then joined to the loyalty program. > [!note] This endpoint only works with profile-based loyalty programs. **Behavior**: - If the loyalty program does not exist, the request fails. - If the customer profile is already joined to the loyalty program, the request fails. - If the customer profile does not exist, it is created and then joined to the loyalty program. ### Example ```javascript import TalonOne from 'talon_one'; let defaultClient = TalonOne.ApiClient.instance; // Configure API key authorization: api_key_v1 let api_key_v1 = defaultClient.authentications['api_key_v1']; api_key_v1.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //api_key_v1.apiKeyPrefix = 'Token'; let apiInstance = new TalonOne.IntegrationApi(); let loyaltyProgramId = 789; // Number | Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. let integrationId = "integrationId_example"; // String | The integration ID of the customer profile. You can get the `integrationId` of a profile using: - A customer session integration ID with the [Update customer session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint. - The Management API with the [List application's customers](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationCustomers) endpoint. apiInstance.joinLoyaltyProgram(loyaltyProgramId, integrationId).then(() => { console.log('API called successfully.'); }, (error) => { console.error(error); }); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **loyaltyProgramId** | **Number**| Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. | **integrationId** | **String**| The integration ID of the customer profile. You can get the `integrationId` of a profile using: - A customer session integration ID with the [Update customer session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint. - The Management API with the [List application's customers](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationCustomers) endpoint. | ### Return type null (empty response body) ### Authorization [api_key_v1](../README.md#api_key_v1) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ## linkLoyaltyCardToProfile > LoyaltyCard linkLoyaltyCardToProfile(loyaltyProgramId, loyaltyCardId, body) Link customer profile to card [Loyalty cards](https://docs.talon.one/docs/product/loyalty-programs/card-based/card-based-overview) allow customers to collect and spend loyalty points within a [card-based loyalty program](https://docs.talon.one/docs/product/loyalty-programs/overview#loyalty-program-types). They are useful to gamify loyalty programs and can be used with or without customer profiles linked to them. Link a customer profile to a given loyalty card for the card to be set as **Registered**. This affects how it can be used. See the [docs](https://docs.talon.one/docs/product/loyalty-programs/card-based/managing-loyalty-cards#linking-customer-profiles-to-a-loyalty-card). > [!note] You can link as many customer profiles to a given loyalty card as the > [**card user limit**](https://docs.talon.one/docs/product/loyalty-programs/card-based/creating-cb-programs) > allows. ### Example ```javascript import TalonOne from 'talon_one'; let defaultClient = TalonOne.ApiClient.instance; // Configure API key authorization: api_key_v1 let api_key_v1 = defaultClient.authentications['api_key_v1']; api_key_v1.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //api_key_v1.apiKeyPrefix = 'Token'; let apiInstance = new TalonOne.IntegrationApi(); let loyaltyProgramId = 789; // Number | Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. let loyaltyCardId = "loyaltyCardId_example"; // String | Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. **Important**: The loyalty card ID requires [URL encoding](https://www.w3schools.com/tags//ref_urlencode.asp) if it contains special characters. For example, you must encode `NewCard2026%` as `NewCard2026%25`. let body = new TalonOne.LoyaltyCardRegistration(); // LoyaltyCardRegistration | body apiInstance.linkLoyaltyCardToProfile(loyaltyProgramId, loyaltyCardId, body).then((data) => { console.log('API called successfully. Returned data: ' + data); }, (error) => { console.error(error); }); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **loyaltyProgramId** | **Number**| Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. | **loyaltyCardId** | **String**| Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. **Important**: The loyalty card ID requires [URL encoding](https://www.w3schools.com/tags//ref_urlencode.asp) if it contains special characters. For example, you must encode `NewCard2026%` as `NewCard2026%25`. | **body** | [**LoyaltyCardRegistration**](LoyaltyCardRegistration.md)| body | ### Return type [**LoyaltyCard**](LoyaltyCard.md) ### Authorization [api_key_v1](../README.md#api_key_v1) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ## reopenCustomerSession > ReopenSessionResponse reopenCustomerSession(customerSessionId) Reopen customer session Reopen a closed [customer session](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions). For example, if a session has been completed but still needs to be edited, you can reopen it with this endpoint. A reopen session is treated like a standard open session. When reopening a session: - The `talon_session_reopened` event is triggered. You can see it in the **Events** view in the Campaign Manager. - The session state is updated to `open`. - Any modified budgets and triggered effects are rolled back when the session closes. - Depending on the [return policy](https://docs.talon.one/docs/product/loyalty-programs/managing-loyalty-programs#return-policy) in your loyalty programs, points are rolled back in the following ways: - Pending points are rolled back automatically. - If **Active points deduction** setting is enabled, any points that were earned and activated when the session closed are rolled back. - If **Negative balance** is enabled, the rollback can create a negative points balance. <details> <summary><strong>Effects and budgets unimpacted by a session reopening</strong></summary> <div> <p>The following effects and budgets remain in the state they were in when the session closed:</p> <ul> <li>Add free item effect</li> <li>Award giveaway</li> <li>Coupon and referral creation</li> <li>Coupon reservation</li> <li>Custom effect</li> <li>Update attribute value</li> <li>Update cart item attribute value</li> </ul> </div> </details> To see an example of a rollback, see the [Cancelling a session with campaign budgets](https://docs.talon.one/docs/dev/tutorials/rolling-back-effects) tutorial. > [!note] If your order workflow requires you to create a new session > instead of reopening a session, use the > [Update customer session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) > endpoint to cancel a closed session and create a new one. ### Example ```javascript import TalonOne from 'talon_one'; let defaultClient = TalonOne.ApiClient.instance; // Configure API key authorization: api_key_v1 let api_key_v1 = defaultClient.authentications['api_key_v1']; api_key_v1.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //api_key_v1.apiKeyPrefix = 'Token'; let apiInstance = new TalonOne.IntegrationApi(); let customerSessionId = "customerSessionId_example"; // String | The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint. apiInstance.reopenCustomerSession(customerSessionId).then((data) => { console.log('API called successfully. Returned data: ' + data); }, (error) => { console.error(error); }); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **customerSessionId** | **String**| The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint. | ### Return type [**ReopenSessionResponse**](ReopenSessionResponse.md) ### Authorization [api_key_v1](../README.md#api_key_v1) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ## returnCartItems > IntegrationStateV2 returnCartItems(customerSessionId, body, opts) Return cart items Create a new return request for the specified cart items. This endpoint automatically changes the session state from `closed` to `partially_returned`. > [!note] This will roll back any effects associated with these cart items. > For more information, see [our documentation on session > states](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions#customer-session-states) > and [this tutorial](https://docs.talon.one/docs/dev/tutorials/partially-returning-a-session). ### Example ```javascript import TalonOne from 'talon_one'; let defaultClient = TalonOne.ApiClient.instance; // Configure API key authorization: api_key_v1 let api_key_v1 = defaultClient.authentications['api_key_v1']; api_key_v1.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //api_key_v1.apiKeyPrefix = 'Token'; let apiInstance = new TalonOne.IntegrationApi(); let customerSessionId = "customerSessionId_example"; // String | The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint. let body = new TalonOne.ReturnIntegrationRequest(); // ReturnIntegrationRequest | body let opts = { 'dry': true, // Boolean | Indicates whether to persist the changes. Changes are ignored when `dry=true`. 'runRuleEngine': true // Boolean | When set to `true`, reevaluates the updated session after items are returned. Only reevaluates campaigns where `reevaluateOnReturn` is set to `true` and which produced an effect when the session was closed. }; apiInstance.returnCartItems(customerSessionId, body, opts).then((data) => { console.log('API called successfully. Returned data: ' + data); }, (error) => { console.error(error); }); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **customerSessionId** | **String**| The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint. | **body** | [**ReturnIntegrationRequest**](ReturnIntegrationRequest.md)| body | **dry** | **Boolean**| Indicates whether to persist the changes. Changes are ignored when `dry=true`. | [optional] **runRuleEngine** | **Boolean**| When set to `true`, reevaluates the updated session after items are returned. Only reevaluates campaigns where `reevaluateOnReturn` is set to `true` and which produced an effect when the session was closed. | [optional] ### Return type [**IntegrationStateV2**](IntegrationStateV2.md) ### Authorization [api_key_v1](../README.md#api_key_v1) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ## syncCatalog > Catalog syncCatalog(catalogId, body) Sync cart item catalog Perform the following actions for a given cart item catalog: - Add an item to the catalog. - Add multiple items to the catalog. - Update the attributes of an item in the catalog. - Update the attributes of multiple items in the catalog. - Remove an item from the catalog. - Remove multiple items from the catalog. You can either add, update, or delete up to 1000 cart items in a single request. Each item synced to a catalog must have a unique `SKU`. > [!important] You can perform only one type of action in a single sync request. Syncing items with duplicate `SKU` values in a single request returns an error message with a `400` status code. For more information, read [managing cart item catalogs](https://docs.talon.one/docs/product/account/dev-tools/managing-cart-item-catalogs). ### Filtering cart items Use [cart item attributes](https://docs.talon.one/docs/product/account/dev-tools/managing-attributes) to filter items and select the ones you want to edit or delete when editing or deleting more than one item at a time. The `filters` array contains an object with the following properties: - `attr`: A [cart item attribute](https://docs.talon.one/docs/product/account/dev-tools/managing-attributes) connected to the catalog. It is applied to all items in the catalog. - `op`: The filtering operator indicating the relationship between the value of each cart item in the catalog and the value of the `value` property for the attribute selected in `attr`. The value of `op` can be one of the following: - `EQ`: Equal to `value` - `LT`: Less than `value` - `LE`: Less than or equal to `value` - `GT`: Greater than `value` - `GE`: Greater than or equal to `value` - `IN`: One of the comma-separated values that `value` is set to. **Note:** `GE`, `LE`, `GT`, `LT` are for numeric values only. - `value`: The value of the attribute selected in `attr`. For request examples of each action, see the **Request Body** examples. ### Example ```javascript import TalonOne from 'talon_one'; let defaultClient = TalonOne.ApiClient.instance; // Configure API key authorization: api_key_v1 let api_key_v1 = defaultClient.authentications['api_key_v1']; api_key_v1.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //api_key_v1.apiKeyPrefix = 'Token'; let apiInstance = new TalonOne.IntegrationApi(); let catalogId = 789; // Number | The ID of the catalog. You can find the ID in the Campaign Manager in **Account** > **Tools** > **Cart item catalogs**. let body = new TalonOne.CatalogSyncRequest(); // CatalogSyncRequest | body apiInstance.syncCatalog(catalogId, body).then((data) => { console.log('API called successfully. Returned data: ' + data); }, (error) => { console.error(error); }); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **catalogId** | **Number**| The ID of the catalog. You can find the ID in the Campaign Manager in **Account** > **Tools** > **Cart item catalogs**. | **body** | [**CatalogSyncRequest**](CatalogSyncRequest.md)| body | ### Return type [**Catalog**](Catalog.md) ### Authorization [api_key_v1](../README.md#api_key_v1) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ## trackEventV2 > IntegrationEventV2Response trackEventV2(body, opts) Track event Trigger a [custom event](https://docs.talon.one/docs/dev/concepts/entities/events#custom-events). To use this endpoint: 1. [Create](https://docs.talon.one/docs/dev/concepts/entities/events#create-an-event) an event in the Campaign Manager. 1. In a rule, add the **Check for event types** [condition](https://docs.talon.one/docs/dev/concepts/entities/events#use-an-event-in-a-rule) and select the event you created. 1. Trigger the event with this endpoint. You can [list](https://docs.talon.one/docs/product/applications/display-events#list-events) the received events in the **Events** view of the Campaign Manager. For example, you can use this endpoint to trigger an event when a customer shares a link to a product. See our [tutorial](https://docs.talon.one/docs/product/tutorials/referrals/incentivizing-product-link-sharing). > [!note] **Note** > - `profileId` is required even though the schema does not specify it. > - If the customer profile ID is new, a new profile is automatically created but the `customer_profile_created` [built-in event ](https://docs.talon.one/docs/dev/concepts/entities/events) is **not** triggered. > - We recommend sending requests sequentially. See [Manage parallel requests](https://docs.talon.one/docs/dev/getting-started/integration-tutorial#manage-parallel-requests). > - [Archived campaigns](https://docs.talon.one/docs/product/campaigns/managing-campaigns#archive-a-campaign) are not considered in rule evaluation. ### Example ```javascript import TalonOne from 'talon_one'; let defaultClient = TalonOne.ApiClient.instance; // Configure API key authorization: api_key_v1 let api_key_v1 = defaultClient.authentications['api_key_v1']; api_key_v1.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //api_key_v1.apiKeyPrefix = 'Token'; let apiInstance = new TalonOne.IntegrationApi(); let body = new TalonOne.IntegrationEventV2Request(); // IntegrationEventV2Request | body let opts = { 'silent': "'yes'", // String | Possible values: `yes` or `no`. - `yes`: Increases the performance of the API call by returning a 204 response. - `no`: Returns a 200 response that contains the updated customer profiles. 'dry': true, // Boolean | Indicates whether to persist the changes. Changes are ignored when `dry=true`. 'forceCompleteEvaluation': false // Boolean | Forces evaluation for all matching campaigns regardless of the [campaign evaluation mode](https://docs.talon.one/docs/product/applications/managing-campaign-evaluation#setting-campaign-evaluation-mode). Requires `dry=true`. }; apiInstance.trackEventV2(body, opts).then((data) => { console.log('API called successfully. Returned data: ' + data); }, (error) => { console.error(error); }); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**IntegrationEventV2Request**](IntegrationEventV2Request.md)| body | **silent** | **String**| Possible values: `yes` or `no`. - `yes`: Increases the performance of the API call by returning a 204 response. - `no`: Returns a 200 response that contains the updated customer profiles. | [optional] [default to 'yes'] **dry** | **Boolean**| Indicates whether to persist the changes. Changes are ignored when `dry=true`. | [optional] **forceCompleteEvaluation** | **Boolean**| Forces evaluation for all matching campaigns regardless of the [campaign evaluation mode](https://docs.talon.one/docs/product/applications/managing-campaign-evaluation#setting-campaign-evaluation-mode). Requires `dry=true`. | [optional] [default to false] ### Return type [**IntegrationEventV2Response**](IntegrationEventV2Response.md) ### Authorization [api_key_v1](../README.md#api_key_v1) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ## trackEventV3 > IntegrationEventV3Response trackEventV3(body, opts) Track advanced event Trigger an [advanced event](https://docs.talon.one/docs/dev/concepts/entities/events#advanced-events). Advanced events are idempotent, uniquely identifiable events. They can also reference a previously closed session to add more context for rule evaluation. To use this endpoint: 1. [Create](https://docs.talon.one/docs/dev/concepts/entities/events#create-an-event) an event in the Campaign Manager. 1. In a rule, add the **Check for event types** [condition](https://docs.talon.one/docs/dev/concepts/entities/events#use-an-event-in-a-rule) and select the event you created. 1. Trigger the event with this endpoint. You can [list](https://docs.talon.one/docs/product/applications/display-events#list-events) the received events in the **Events** view of the Campaign Manager. For example, you can use this endpoint to award loyalty points after an order is delivered. See our [tutorial](https://docs.talon.one/docs/dev/tutorials/award-loyalty-points-after-delivery). > [!note] **Note** > - If the customer profile does not exist, it will be created. However, the `customer_profile_created` [built-in event](https://docs.talon.one/docs/dev/concepts/entities/events#built-in-events) is **not** triggered. > - We recommend sending requests sequentially. See [Manage parallel requests](https://docs.talon.one/docs/dev/getting-started/integration-tutorial#manage-parallel-requests). > - [Archived campaigns](https://docs.talon.one/docs/product/campaigns/managing-campaigns#archive-a-campaign) are not considered in rule evaluation. ### Example ```javascript import TalonOne from 'talon_one'; let defaultClient = TalonOne.ApiClient.instance; // Configure API key authorization: api_key_v1 let api_key_v1 = defaultClient.authentications['api_key_v1']; api_key_v1.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //api_key_v1.apiKeyPrefix = 'Token'; let apiInstance = new TalonOne.IntegrationApi(); let body = new TalonOne.IntegrationEventV3Request(); // IntegrationEventV3Request | body let opts = { 'silent': "'yes'", // String | Possible values: `yes` or `no`. - `yes`: Increases the performance of the API call by returning a 204 response. - `no`: Returns a 200 response that contains the updated customer profiles. 'dry': true, // Boolean | Indicates whether to persist the changes. Changes are ignored when `dry=true`. 'forceCompleteEvaluation': false // Boolean | Forces evaluation for all matching campaigns regardless of the [campaign evaluation mode](https://docs.talon.one/docs/product/applications/managing-campaign-evaluation#setting-campaign-evaluation-mode). Requires `dry=true`. }; apiInstance.trackEventV3(body, opts).then((data) => { console.log('API called successfully. Returned data: ' + data); }, (error) => { console.error(error); }); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**IntegrationEventV3Request**](IntegrationEventV3Request.md)| body | **silent** | **String**| Possible values: `yes` or `no`. - `yes`: Increases the performance of the API call by returning a 204 response. - `no`: Returns a 200 response that contains the updated customer profiles. | [optional] [default to 'yes'] **dry** | **Boolean**| Indicates whether to persist the changes. Changes are ignored when `dry=true`. | [optional] **forceCompleteEvaluation** | **Boolean**| Forces evaluation for all matching campaigns regardless of the [campaign evaluation mode](https://docs.talon.one/docs/product/applications/managing-campaign-evaluation#setting-campaign-evaluation-mode). Requires `dry=true`. | [optional] [default to false] ### Return type [**IntegrationEventV3Response**](IntegrationEventV3Response.md) ### Authorization [api_key_v1](../README.md#api_key_v1) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ## unlinkLoyaltyCardFromProfile > LoyaltyCard unlinkLoyaltyCardFromProfile(loyaltyProgramId, loyaltyCardId, body) Unlink customer profile from a loyalty card Unlink a customer profile from a [registered](https://docs.talon.one/docs/product/loyalty-programs/card-based/managing-loyalty-cards#linking-customer-profiles-to-a-loyalty-card) loyalty card. To get the `integrationId` of a customer profile, you can use the [Update customer session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint. ### Example ```javascript import TalonOne from 'talon_one'; let defaultClient = TalonOne.ApiClient.instance; // Configure API key authorization: api_key_v1 let api_key_v1 = defaultClient.authentications['api_key_v1']; api_key_v1.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //api_key_v1.apiKeyPrefix = 'Token'; let apiInstance = new TalonOne.IntegrationApi(); let loyaltyProgramId = 789; // Number | The identifier of the card-based loyalty program containing the loyalty card. You can get this ID using the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. let loyaltyCardId = "loyaltyCardId_example"; // String | The identifier of the loyalty card. You can get this ID using the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. **Important**: The loyalty card ID requires [URL encoding](https://www.w3schools.com/tags//ref_urlencode.asp) if it contains special characters. For example, you must encode `NewCard2026%` as `NewCard2026%25`. let body = new TalonOne.LoyaltyCardRegistration(); // LoyaltyCardRegistration | body apiInstance.unlinkLoyaltyCardFromProfile(loyaltyProgramId, loyaltyCardId, body).then((data) => { console.log('API called successfully. Returned data: ' + data); }, (error) => { console.error(error); }); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **loyaltyProgramId** | **Number**| The identifier of the card-based loyalty program containing the loyalty card. You can get this ID using the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. | **loyaltyCardId** | **String**| The identifier of the loyalty card. You can get this ID using the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. **Important**: The loyalty card ID requires [URL encoding](https://www.w3schools.com/tags//ref_urlencode.asp) if it contains special characters. For example, you must encode `NewCard2026%` as `NewCard2026%25`. | **body** | [**LoyaltyCardRegistration**](LoyaltyCardRegistration.md)| body | ### Return type [**LoyaltyCard**](LoyaltyCard.md) ### Authorization [api_key_v1](../README.md#api_key_v1) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ## unlockReward > IntegrationStateV2 unlockReward(rewardId, body, opts) Unlock a reward Unlock a reward for a customer. If the reward has `pointsRequired` configured, the corresponding loyalty points are deducted from the customer's balance. To unlock a reward with the points of a loyalty card, provide the card in `cardIdentifier`. The points are then deducted from the card, and the unlocked reward belongs to the card, which makes it available to all customer profiles linked to that card. ### Example ```javascript import TalonOne from 'talon_one'; let defaultClient = TalonOne.ApiClient.instance; // Configure API key authorization: api_key_v1 let api_key_v1 = defaultClient.authentications['api_key_v1']; api_key_v1.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //api_key_v1.apiKeyPrefix = 'Token'; let apiInstance = new TalonOne.IntegrationApi(); let rewardId = 789; // Number | The ID of the reward. You can get the ID with the [List rewards](#tag/Rewards/operation/listRewards) endpoint. let body = new TalonOne.IntegrationUnlockRewardRequest(); // IntegrationUnlockRewardRequest | let opts = { 'dry': true // Boolean | When set to `true`, the rule evaluation is performed but no changes are persisted. Use this to preview the outcome of an unlocking. }; apiInstance.unlockReward(rewardId, body, opts).then((data) => { console.log('API called successfully. Returned data: ' + data); }, (error) => { console.error(error); }); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **rewardId** | **Number**| The ID of the reward. You can get the ID with the [List rewards](#tag/Rewards/operation/listRewards) endpoint. | **body** | [**IntegrationUnlockRewardRequest**](IntegrationUnlockRewardRequest.md)| | **dry** | **Boolean**| When set to `true`, the rule evaluation is performed but no changes are persisted. Use this to preview the outcome of an unlocking. | [optional] ### Return type [**IntegrationStateV2**](IntegrationStateV2.md) ### Authorization [api_key_v1](../README.md#api_key_v1) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ## updateAudienceCustomersAttributes > updateAudienceCustomersAttributes(audienceId, body) Update profile attributes for all customers in audience Update the specified profile attributes to the provided values for all customers in the specified audience. ### Example ```javascript import TalonOne from 'talon_one'; let defaultClient = TalonOne.ApiClient.instance; // Configure API key authorization: api_key_v1 let api_key_v1 = defaultClient.authentications['api_key_v1']; api_key_v1.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //api_key_v1.apiKeyPrefix = 'Token'; let apiInstance = new TalonOne.IntegrationApi(); let audienceId = 789; // Number | The ID of the audience. let body = null; // Object | body apiInstance.updateAudienceCustomersAttributes(audienceId, body).then(() => { console.log('API called successfully.'); }, (error) => { console.error(error); }); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **audienceId** | **Number**| The ID of the audience. | **body** | **Object**| body | ### Return type null (empty response body) ### Authorization [api_key_v1](../README.md#api_key_v1) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ## updateAudienceV2 > Audience updateAudienceV2(audienceId, body) Update audience name Update the name of the given audience created by a third-party integration. Sending a request to this endpoint does **not** trigger the Rule Engine. To update the audience's members, use the [Update customer profile](#tag/Customer-profiles/operation/updateCustomerProfileV2) endpoint. ### Example ```javascript import TalonOne from 'talon_one'; let defaultClient = TalonOne.ApiClient.instance; // Configure API key authorization: api_key_v1 let api_key_v1 = defaultClient.authentications['api_key_v1']; api_key_v1.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //api_key_v1.apiKeyPrefix = 'Token'; let apiInstance = new TalonOne.IntegrationApi(); let audienceId = 789; // Number | The ID of the audience. let body = new TalonOne.UpdateAudience(); // UpdateAudience | body apiInstance.updateAudienceV2(audienceId, body).then((data) => { console.log('API called successfully. Returned data: ' + data); }, (error) => { console.error(error); }); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **audienceId** | **Number**| The ID of the audience. | **body** | [**UpdateAudience**](UpdateAudience.md)| body | ### Return type [**Audience**](Audience.md) ### Authorization [api_key_v1](../README.md#api_key_v1) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ## updateCustomerProfileAudiences > updateCustomerProfileAudiences(body) Update multiple customer profiles' audiences Add customer profiles to or remove them from an audience. The endpoint supports 1000 audience actions (`add` or `remove`) per request. > [!note] You can also do this using the > [Update audience](https://docs.talon.one/docs/product/rules/effects/using-effects#updating-an-audience) > effect. ### Example ```javascript import TalonOne from 'talon_one'; let defaultClient = TalonOne.ApiClient.instance; // Configure API key authorization: api_key_v1 let api_key_v1 = defaultClient.authentications['api_key_v1']; api_key_v1.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //api_key_v1.apiKeyPrefix = 'Token'; let apiInstance = new TalonOne.IntegrationApi(); let body = new TalonOne.CustomerProfileAudienceRequest(); // CustomerProfileAudienceRequest | body apiInstance.updateCustomerProfileAudiences(body).then(() => { console.log('API called successfully.'); }, (error) => { console.error(error); }); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**CustomerProfileAudienceRequest**](CustomerProfileAudienceRequest.md)| body | ### Return type null (empty response body) ### Authorization [api_key_v1](../README.md#api_key_v1) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ## updateCustomerProfileV2 > CustomerProfileIntegrationResponseV2 updateCustomerProfileV2(integrationId, body, opts) Update customer profile Update or create a [Customer Profile](https://docs.talon.one/docs/dev/concepts/entities/customer-profiles). This endpoint triggers the Rule Builder. You can use this endpoint to: - Set attributes on the given customer profile. Ensure you create the attributes in the Campaign Manager, first. - Modify the audience the customer profile is a member of. > [!note] **Note** > - Updating a customer profile returns a response with the requested integration state. > - The [Has joined an audience](https://docs.talon.one/docs/product/rules/conditions/available-conditions#audience-conditions) and > [Has left an audience](https://docs.talon.one/docs/product/rules/conditions/available-conditions#audience-conditions) conditions > only trigger through this endpoint. > - You can use the `responseContent` property to save yourself extra API calls. For example, you can get > the customer profile details directly without extra requests. > - We recommend sending requests sequentially. > See [Managing parallel requests](https://docs.talon.one/docs/dev/getting-started/integration-tutorial#managing-parallel-requests). > - [Archived campaigns](https://docs.talon.one/docs/product/campaigns/managing-campaigns#archiving-a-campaign) are not considered in rule evaluation when `runRuleEngine` is `true`. ### Example ```javascript import TalonOne from 'talon_one'; let defaultClient = TalonOne.ApiClient.instance; // Configure API key authorization: api_key_v1 let api_key_v1 = defaultClient.authentications['api_key_v1']; api_key_v1.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //api_key_v1.apiKeyPrefix = 'Token'; let apiInstance = new TalonOne.IntegrationApi(); let integrationId = "integrationId_example"; // String | The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. **Note**: It must be URL-encoded. For example, replace spaces with `%20`. [Learn more](https://www.w3schools.com/tags/ref_urlencode.asp). let body = new TalonOne.CustomerProfileIntegrationRequestV2(); // CustomerProfileIntegrationRequestV2 | body let opts = { 'runRuleEngine': false, // Boolean | Indicates whether to run the Rule Engine. If `true`, the response includes: - The effects generated by the triggered campaigns are returned in the `effects` property. - The created coupons and referral objects. If `false`: - The rules are not executed and the `effects` property is always empty. - The response time improves. - You cannot use `responseContent` in the body. 'dry': true // Boolean | (Only works when `runRuleEngine=true`) Indicates whether to persist the changes. Changes are ignored when `dry=true`. When set to `true`, you can use the `evaluableCampaignIds` body property to select specific campaigns to run. }; apiInstance.updateCustomerProfileV2(integrationId, body, opts).then((data) => { console.log('API called successfully. Returned data: ' + data); }, (error) => { console.error(error); }); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **integrationId** | **String**| The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. **Note**: It must be URL-encoded. For example, replace spaces with `%20`. [Learn more](https://www.w3schools.com/tags/ref_urlencode.asp). | **body** | [**CustomerProfileIntegrationRequestV2**](CustomerProfileIntegrationRequestV2.md)| body | **runRuleEngine** | **Boolean**| Indicates whether to run the Rule Engine. If `true`, the response includes: - The effects generated by the triggered campaigns are returned in the `effects` property. - The created coupons and referral objects. If `false`: - The rules are not executed and the `effects` property is always empty. - The response time improves. - You cannot use `responseContent` in the body. | [optional] [default to false] **dry** | **Boolean**| (Only works when `runRuleEngine=true`) Indicates whether to persist the changes. Changes are ignored when `dry=true`. When set to `true`, you can use the `evaluableCampaignIds` body property to select specific campaigns to run. | [optional] ### Return type [**CustomerProfileIntegrationResponseV2**](CustomerProfileIntegrationResponseV2.md) ### Authorization [api_key_v1](../README.md#api_key_v1) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ## updateCustomerProfilesV2 > MultipleCustomerProfileIntegrationResponseV2 updateCustomerProfilesV2(body, opts) Update multiple customer profiles Update (or create) up to 1000 [customer profiles](https://docs.talon.one/docs/dev/concepts/entities/customer-profiles) in 1 request. The `integrationId` must be any identifier that remains stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. A customer profile [can be linked to one or more sessions](https://docs.talon.one/integration-api#tag/Customer-sessions). > [!note] This endpoint does not trigger the Rule Engine. > To trigger the Rule Engine for customer profile updates, > use the [Update customer profile](#tag/Customer-profiles/operation/updateCustomerProfileV2) endpoint. ### Example ```javascript import TalonOne from 'talon_one'; let defaultClient = TalonOne.ApiClient.instance; // Configure API key authorization: api_key_v1 let api_key_v1 = defaultClient.authentications['api_key_v1']; api_key_v1.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //api_key_v1.apiKeyPrefix = 'Token'; let apiInstance = new TalonOne.IntegrationApi(); let body = new TalonOne.MultipleCustomerProfileIntegrationRequest(); // MultipleCustomerProfileIntegrationRequest | body let opts = { 'silent': "'yes'" // String | Possible values: `yes` or `no`. - `yes`: Increases the performance of the API call by returning a 204 response. - `no`: Returns a 200 response that contains the updated customer profiles. }; apiInstance.updateCustomerProfilesV2(body, opts).then((data) => { console.log('API called successfully. Returned data: ' + data); }, (error) => { console.error(error); }); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**MultipleCustomerProfileIntegrationRequest**](MultipleCustomerProfileIntegrationRequest.md)| body | **silent** | **String**| Possible values: `yes` or `no`. - `yes`: Increases the performance of the API call by returning a 204 response. - `no`: Returns a 200 response that contains the updated customer profiles. | [optional] [default to 'yes'] ### Return type [**MultipleCustomerProfileIntegrationResponseV2**](MultipleCustomerProfileIntegrationResponseV2.md) ### Authorization [api_key_v1](../README.md#api_key_v1) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ## updateCustomerSessionV2 > IntegrationStateV2 updateCustomerSessionV2(customerSessionId, body, opts) Update customer session Update or create a [customer session](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions). The endpoint responds with the potential promotion rule [effects](https://docs.talon.one/docs/dev/integration-api/api-effects) that match the current cart. For example, use this endpoint to share the contents of a customer's cart with Talon.One. > [!note] **Note** > - The currency for the session and the cart items in it is the currency set for the Application linked to this session. > - [Archived campaigns](https://docs.talon.one/docs/product/campaigns/managing-campaigns#archiving-a-campaign) are not considered for rule evaluation. ### Session management To use this endpoint, start by learning about [customer sessions](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions) and their states and refer to the `state` parameter documentation the request body schema docs below. ### Sessions and customer profiles - To link a session to a customer profile, set the `profileId` parameter in the request body to a customer profile's `integrationId`. - While you can create an anonymous session with `profileId=\"\"`, we recommend you use a guest ID instead. - A profile can be linked to simultaneous sessions in different Applications. Either: - Use unique session integration IDs or, - Use the same session integration ID across all of the Applications. > [!note] **Note** > - If the specified profile does not exist, an empty profile is **created automatically**. > You can update it with [Update customer profile](https://docs.talon.one/integration-api#tag/Customer-profiles/operation/updateCustomerProfileV2). > - Updating a customer session returns a response with the new integration state. Use the `responseContent` property to save yourself extra API calls. > For example, you can get the customer profile details directly without extra requests. > - We recommend sending requests sequentially. See [Managing parallel requests](https://docs.talon.one/docs/dev/getting-started/integration-tutorial#managing-parallel-requests). For more information, see: - The introductory video in [Getting started](https://docs.talon.one/docs/dev/getting-started/overview). - The [integration tutorial](https://docs.talon.one/docs/dev/tutorials/integrating-talon-one). ### Example ```javascript import TalonOne from 'talon_one'; let defaultClient = TalonOne.ApiClient.instance; // Configure API key authorization: api_key_v1 let api_key_v1 = defaultClient.authentications['api_key_v1']; api_key_v1.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //api_key_v1.apiKeyPrefix = 'Token'; let apiInstance = new TalonOne.IntegrationApi(); let customerSessionId = "customerSessionId_example"; // String | The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint. **Notes**: - There is no length limit for this ID. - It must be URL-encoded. For example, replace spaces with `%20`. [Learn more](https://www.w3schools.com/tags/ref_urlencode.asp). let body = new TalonOne.IntegrationRequest(); // IntegrationRequest | body let opts = { 'dry': true, // Boolean | Indicates whether to persist the changes. Changes are ignored when `dry=true`. When set to `true`: - The endpoint considers **only** the payload that you pass when **closing** the session. When you do not use the `dry` parameter, the endpoint behaves as a typical PUT endpoint. Each update builds upon the previous ones. - You can use the `evaluableCampaignIds` body property to select specific campaigns to run. [See the docs](https://docs.talon.one/docs/dev/integration-api/dry-requests). 'now': new Date("2013-10-20T19:20:30+01:00") // Date | A timestamp value of a future date that acts as a current date when included in the query. Use this parameter, for example, to test campaigns that would be evaluated for this customer session in the future (say, [scheduled campaigns](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-schedule)). > [!note] **Note** > - It must be an RFC3339 timestamp string. > - It can **only** be a date in the future. > - It can **only** be used if the `dry` parameter in the query is set to `true`. }; apiInstance.updateCustomerSessionV2(customerSessionId, body, opts).then((data) => { console.log('API called successfully. Returned data: ' + data); }, (error) => { console.error(error); }); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **customerSessionId** | **String**| The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint. **Notes**: - There is no length limit for this ID. - It must be URL-encoded. For example, replace spaces with `%20`. [Learn more](https://www.w3schools.com/tags/ref_urlencode.asp). | **body** | [**IntegrationRequest**](IntegrationRequest.md)| body | **dry** | **Boolean**| Indicates whether to persist the changes. Changes are ignored when `dry=true`. When set to `true`: - The endpoint considers **only** the payload that you pass when **closing** the session. When you do not use the `dry` parameter, the endpoint behaves as a typical PUT endpoint. Each update builds upon the previous ones. - You can use the `evaluableCampaignIds` body property to select specific campaigns to run. [See the docs](https://docs.talon.one/docs/dev/integration-api/dry-requests). | [optional] **now** | **Date**| A timestamp value of a future date that acts as a current date when included in the query. Use this parameter, for example, to test campaigns that would be evaluated for this customer session in the future (say, [scheduled campaigns](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-schedule)). > [!note] **Note** > - It must be an RFC3339 timestamp string. > - It can **only** be a date in the future. > - It can **only** be used if the `dry` parameter in the query is set to `true`. | [optional] ### Return type [**IntegrationStateV2**](IntegrationStateV2.md) ### Authorization [api_key_v1](../README.md#api_key_v1) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json