All URIs are relative to https://yourbaseurl.talon.one
Method | HTTP request | Description |
---|---|---|
createAudienceV2 | POST /v2/audiences | Create audience |
createCouponReservation | POST /v1/coupon_reservations/{couponValue} | Create coupon reservation |
createReferral | POST /v1/referrals | Create referral code for an advocate |
createReferralsForMultipleAdvocates | POST /v1/referrals_for_multiple_advocates | Create referral codes for multiple advocates |
deleteAudienceMembershipsV2 | DELETE /v2/audiences/{audienceId}/memberships | Delete audience memberships |
deleteAudienceV2 | DELETE /v2/audiences/{audienceId} | Delete audience |
deleteCouponReservation | DELETE /v1/coupon_reservations/{couponValue} | Delete coupon reservations |
deleteCustomerData | DELETE /v1/customer_data/{integrationId} | Delete customer's personal data |
getCustomerInventory | GET /v1/customer_profiles/{integrationId}/inventory | List customer data |
getCustomerSession | GET /v2/customer_sessions/{customerSessionId} | Get customer session |
getLoyaltyBalances | GET /v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/balances | Get customer's loyalty points |
getLoyaltyCardBalances | GET /v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/balances | Get card's point balances |
getLoyaltyCardTransactions | GET /v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/transactions | List card's transactions |
getLoyaltyProgramProfileTransactions | GET /v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/transactions | List customer's loyalty transactions |
getReservedCustomers | GET /v1/coupon_reservations/customerprofiles/{couponValue} | List customers that have this coupon reserved |
linkLoyaltyCardToProfile | POST /v2/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/link_profile | Link customer profile to card |
reopenCustomerSession | PUT /v2/customer_sessions/{customerSessionId}/reopen | Reopen customer session |
returnCartItems | POST /v2/customer_sessions/{customerSessionId}/returns | Return cart items |
syncCatalog | PUT /v1/catalogs/{catalogId}/sync | Sync cart item catalog |
trackEventV2 | POST /v2/events | Track event |
updateAudienceCustomersAttributes | PUT /v2/audience_customers/{audienceId}/attributes | Update profile attributes for all customers in audience |
updateAudienceV2 | PUT /v2/audiences/{audienceId} | Update audience name |
updateCustomerProfileAudiences | POST /v2/customer_audiences | Update multiple customer profiles' audiences |
updateCustomerProfileV2 | PUT /v2/customer_profiles/{integrationId} | Update customer profile |
updateCustomerProfilesV2 | PUT /v2/customer_profiles | Update multiple customer profiles |
updateCustomerSessionV2 | PUT /v2/customer_sessions/{customerSessionId} | Update customer session |
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. To create an audience from an existing audience from a technology partner: 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: 1. Only set the `name` property. Once you create your first audience, audience-specific rule conditions are enabled in the Rule Builder.
// Import classes:
import one.talon.ApiClient;
import one.talon.ApiException;
import one.talon.Configuration;
import one.talon.auth.*;
import one.talon.models.*;
import one.talon.api.IntegrationApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://yourbaseurl.talon.one");
// Configure API key authorization: api_key_v1
ApiKeyAuth api_key_v1 = (ApiKeyAuth) defaultClient.getAuthentication("api_key_v1");
api_key_v1.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key_v1.setApiKeyPrefix("Token");
IntegrationApi apiInstance = new IntegrationApi(defaultClient);
NewAudience body = new NewAudience(); // NewAudience | body
try {
Audience result = apiInstance.createAudienceV2(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling IntegrationApi#createAudienceV2");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
body | NewAudience | body |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
201 | Created | - |
400 | Bad request | - |
401 | Unauthorized | - |
409 | Conflict. An Audience with this ID already exists for this integration. | - |
Coupon createCouponReservation(couponValue, body)
Create coupon reservation
Create a coupon reservation for specified customer profiles on the specified coupon. You can also create a reservation via the Campaign Manager using the Create coupon code reservation effect. Reserving a coupon allows you to associate a coupon code to a given customer(s). You can then list the reserved coupons of a given customer with the List customer data endpoint. If a coupon gets created for a specific user, it will automatically appear in their coupons. When a user redeems a coupon, a reservation is automatically created after the redemption and the used coupon will be returned in the List customer data endpoint. For example, you can use this endpoint and `List customer data` to create a coupon wallet by reserving coupon codes for a customer, and then displaying their coupon wallet when they visit your store. If the Coupon visibility checkbox was selected when creating a universal code, the coupon code is implicitly reserved for all customers, and the code will be returned for all customer profiles in the List customer data endpoint. <div class="redoc-section"> <p class="title">Important</p> This endpoint creates a soft reservation. Any customer can use a reserved coupon code and proceed to checkout. To create a hard reservation, you can: - use the Create coupons endpoint or, - use the Create coupons for multiple recipients endpoint setting the `recipientsIntegrationId` property or, - create a coupon code with the Reservation mandatory option then use the Create coupon code reservation effect. </div> To delete a reservation, use the Delete reservation endpoint.
// Import classes:
import one.talon.ApiClient;
import one.talon.ApiException;
import one.talon.Configuration;
import one.talon.auth.*;
import one.talon.models.*;
import one.talon.api.IntegrationApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://yourbaseurl.talon.one");
// Configure API key authorization: api_key_v1
ApiKeyAuth api_key_v1 = (ApiKeyAuth) defaultClient.getAuthentication("api_key_v1");
api_key_v1.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key_v1.setApiKeyPrefix("Token");
IntegrationApi apiInstance = new IntegrationApi(defaultClient);
String couponValue = "couponValue_example"; // String | The code of the coupon.
CouponReservations body = new CouponReservations(); // CouponReservations | body
try {
Coupon result = apiInstance.createCouponReservation(couponValue, body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling IntegrationApi#createCouponReservation");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
couponValue | String | The code of the coupon. | |
body | CouponReservations | body |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
201 | Created | - |
400 | Bad request | - |
401 | Unauthorized - Invalid API key | - |
404 | Not found | - |
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.
// Import classes:
import one.talon.ApiClient;
import one.talon.ApiException;
import one.talon.Configuration;
import one.talon.auth.*;
import one.talon.models.*;
import one.talon.api.IntegrationApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://yourbaseurl.talon.one");
// Configure API key authorization: api_key_v1
ApiKeyAuth api_key_v1 = (ApiKeyAuth) defaultClient.getAuthentication("api_key_v1");
api_key_v1.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key_v1.setApiKeyPrefix("Token");
IntegrationApi apiInstance = new IntegrationApi(defaultClient);
NewReferral body = new NewReferral(); // NewReferral | body
try {
Referral result = apiInstance.createReferral(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling IntegrationApi#createReferral");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
body | NewReferral | body |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
201 | Created | - |
400 | Bad request | - |
401 | Unauthorized - Invalid API key | - |
InlineResponse201 createReferralsForMultipleAdvocates(body, silent)
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.
// Import classes:
import one.talon.ApiClient;
import one.talon.ApiException;
import one.talon.Configuration;
import one.talon.auth.*;
import one.talon.models.*;
import one.talon.api.IntegrationApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://yourbaseurl.talon.one");
// Configure API key authorization: api_key_v1
ApiKeyAuth api_key_v1 = (ApiKeyAuth) defaultClient.getAuthentication("api_key_v1");
api_key_v1.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key_v1.setApiKeyPrefix("Token");
IntegrationApi apiInstance = new IntegrationApi(defaultClient);
NewReferralsForMultipleAdvocates body = new NewReferralsForMultipleAdvocates(); // NewReferralsForMultipleAdvocates | body
String silent = "\"yes\""; // String | Possible values: `yes` or `no`. - `yes`: Increases the perfomance of the API call by returning a 204 response. - `no`: Returns a 200 response that contains the updated customer profiles.
try {
InlineResponse201 result = apiInstance.createReferralsForMultipleAdvocates(body, silent);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling IntegrationApi#createReferralsForMultipleAdvocates");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
body | NewReferralsForMultipleAdvocates | body | |
silent | String | Possible values: `yes` or `no`. - `yes`: Increases the perfomance of the API call by returning a 204 response. - `no`: Returns a 200 response that contains the updated customer profiles. | [optional] [default to "yes"] |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
201 | Created | - |
204 | No Content | - |
400 | Bad request | - |
401 | Unauthorized - Invalid API key | - |
deleteAudienceMembershipsV2(audienceId)
Delete audience memberships
Remove all members from this audience.
// Import classes:
import one.talon.ApiClient;
import one.talon.ApiException;
import one.talon.Configuration;
import one.talon.auth.*;
import one.talon.models.*;
import one.talon.api.IntegrationApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://yourbaseurl.talon.one");
// Configure API key authorization: api_key_v1
ApiKeyAuth api_key_v1 = (ApiKeyAuth) defaultClient.getAuthentication("api_key_v1");
api_key_v1.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key_v1.setApiKeyPrefix("Token");
IntegrationApi apiInstance = new IntegrationApi(defaultClient);
Integer audienceId = 56; // Integer | The ID of the audience. You get it via the `id` property when [creating an audience](#operation/createAudienceV2).
try {
apiInstance.deleteAudienceMembershipsV2(audienceId);
} catch (ApiException e) {
System.err.println("Exception when calling IntegrationApi#deleteAudienceMembershipsV2");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
audienceId | Integer | The ID of the audience. You get it via the `id` property when creating an audience. |
null (empty response body)
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
204 | No Content | - |
401 | Unauthorized | - |
404 | Not found | - |
deleteAudienceV2(audienceId)
Delete audience
Delete an audience created by a third-party integration. 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.
// Import classes:
import one.talon.ApiClient;
import one.talon.ApiException;
import one.talon.Configuration;
import one.talon.auth.*;
import one.talon.models.*;
import one.talon.api.IntegrationApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://yourbaseurl.talon.one");
// Configure API key authorization: api_key_v1
ApiKeyAuth api_key_v1 = (ApiKeyAuth) defaultClient.getAuthentication("api_key_v1");
api_key_v1.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key_v1.setApiKeyPrefix("Token");
IntegrationApi apiInstance = new IntegrationApi(defaultClient);
Integer audienceId = 56; // Integer | The ID of the audience. You get it via the `id` property when [creating an audience](#operation/createAudienceV2).
try {
apiInstance.deleteAudienceV2(audienceId);
} catch (ApiException e) {
System.err.println("Exception when calling IntegrationApi#deleteAudienceV2");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
audienceId | Integer | The ID of the audience. You get it via the `id` property when creating an audience. |
null (empty response body)
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
204 | No Content | - |
400 | Bad request | - |
401 | Unauthorized | - |
404 | Not found | - |
deleteCouponReservation(couponValue, body)
Delete coupon reservations
Remove all the coupon reservations from the provided customer profile integration IDs and the provided coupon code.
// Import classes:
import one.talon.ApiClient;
import one.talon.ApiException;
import one.talon.Configuration;
import one.talon.auth.*;
import one.talon.models.*;
import one.talon.api.IntegrationApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://yourbaseurl.talon.one");
// Configure API key authorization: api_key_v1
ApiKeyAuth api_key_v1 = (ApiKeyAuth) defaultClient.getAuthentication("api_key_v1");
api_key_v1.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key_v1.setApiKeyPrefix("Token");
IntegrationApi apiInstance = new IntegrationApi(defaultClient);
String couponValue = "couponValue_example"; // String | The code of the coupon.
CouponReservations body = new CouponReservations(); // CouponReservations | body
try {
apiInstance.deleteCouponReservation(couponValue, body);
} catch (ApiException e) {
System.err.println("Exception when calling IntegrationApi#deleteCouponReservation");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
couponValue | String | The code of the coupon. | |
body | CouponReservations | body |
null (empty response body)
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
204 | No Content | - |
400 | Bad request | - |
401 | Unauthorized - Invalid API key | - |
404 | Not found | - |
deleteCustomerData(integrationId)
Delete customer's personal data
Delete all attributes on the customer profile and on entities that reference this customer profile. Important: To preserve performance, we recommend avoiding deleting customer data during peak-traffic hours.
// Import classes:
import one.talon.ApiClient;
import one.talon.ApiException;
import one.talon.Configuration;
import one.talon.auth.*;
import one.talon.models.*;
import one.talon.api.IntegrationApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://yourbaseurl.talon.one");
// Configure API key authorization: api_key_v1
ApiKeyAuth api_key_v1 = (ApiKeyAuth) defaultClient.getAuthentication("api_key_v1");
api_key_v1.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key_v1.setApiKeyPrefix("Token");
IntegrationApi apiInstance = new IntegrationApi(defaultClient);
String 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#operation/updateCustomerSessionV2) endpoint. - The Management API with the [List application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint.
try {
apiInstance.deleteCustomerData(integrationId);
} catch (ApiException e) {
System.err.println("Exception when calling IntegrationApi#deleteCustomerData");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
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 endpoint. - The Management API with the List application's customers endpoint. |
null (empty response body)
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
204 | No Content | - |
401 | Unauthorized - Invalid API key | - |
404 | Not found | - |
CustomerInventory getCustomerInventory(integrationId, profile, referrals, coupons, loyalty, giveaways)
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.
// Import classes:
import one.talon.ApiClient;
import one.talon.ApiException;
import one.talon.Configuration;
import one.talon.auth.*;
import one.talon.models.*;
import one.talon.api.IntegrationApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://yourbaseurl.talon.one");
// Configure API key authorization: api_key_v1
ApiKeyAuth api_key_v1 = (ApiKeyAuth) defaultClient.getAuthentication("api_key_v1");
api_key_v1.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key_v1.setApiKeyPrefix("Token");
IntegrationApi apiInstance = new IntegrationApi(defaultClient);
String 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#operation/updateCustomerSessionV2) endpoint. - The Management API with the [List application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint.
Boolean profile = true; // Boolean | Set to `true` to include customer profile information in the response.
Boolean referrals = true; // Boolean | Set to `true` to include referral information in the response.
Boolean coupons = true; // Boolean | Set to `true` to include coupon information in the response.
Boolean loyalty = true; // Boolean | Set to `true` to include loyalty information in the response.
Boolean giveaways = true; // Boolean | Set to `true` to include giveaways information in the response.
try {
CustomerInventory result = apiInstance.getCustomerInventory(integrationId, profile, referrals, coupons, loyalty, giveaways);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling IntegrationApi#getCustomerInventory");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
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 endpoint. - The Management API with the List application's customers 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] |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
401 | Unauthorized - Invalid API key | - |
404 | Not found | - |
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 - Update customer profile
// Import classes:
import one.talon.ApiClient;
import one.talon.ApiException;
import one.talon.Configuration;
import one.talon.auth.*;
import one.talon.models.*;
import one.talon.api.IntegrationApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://yourbaseurl.talon.one");
// Configure API key authorization: api_key_v1
ApiKeyAuth api_key_v1 = (ApiKeyAuth) defaultClient.getAuthentication("api_key_v1");
api_key_v1.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key_v1.setApiKeyPrefix("Token");
IntegrationApi apiInstance = new IntegrationApi(defaultClient);
String 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#operation/getApplicationSessions) endpoint.
try {
IntegrationCustomerSessionResponse result = apiInstance.getCustomerSession(customerSessionId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling IntegrationApi#getCustomerSession");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
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 endpoint. |
IntegrationCustomerSessionResponse
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
400 | Bad request | - |
401 | Unauthorized - Invalid API key | - |
LoyaltyBalances getLoyaltyBalances(loyaltyProgramId, integrationId, endDate)
Get customer's loyalty points
Retrieve loyalty ledger balances for the given Integration ID in the specified loyalty program. You can filter balances by date. 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. Note: For more information, see: - Managing card-based loyalty program data - Managing profile-based loyalty program data
// Import classes:
import one.talon.ApiClient;
import one.talon.ApiException;
import one.talon.Configuration;
import one.talon.auth.*;
import one.talon.models.*;
import one.talon.api.IntegrationApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://yourbaseurl.talon.one");
// Configure API key authorization: api_key_v1
ApiKeyAuth api_key_v1 = (ApiKeyAuth) defaultClient.getAuthentication("api_key_v1");
api_key_v1.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key_v1.setApiKeyPrefix("Token");
IntegrationApi apiInstance = new IntegrationApi(defaultClient);
Integer loyaltyProgramId = 56; // Integer | 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.
String 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.
OffsetDateTime endDate = new OffsetDateTime(); // OffsetDateTime | Used to return balances only for entries older than this timestamp. The expired, active, and pending points are relative to this timestamp. **Note:** It must be an RFC3339 timestamp string.
try {
LoyaltyBalances result = apiInstance.getLoyaltyBalances(loyaltyProgramId, integrationId, endDate);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling IntegrationApi#getLoyaltyBalances");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
loyaltyProgramId | Integer | Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the List loyalty programs 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 | OffsetDateTime | Used to return balances only for entries older than this timestamp. The expired, active, and pending points are relative to this timestamp. Note: It must be an RFC3339 timestamp string. | [optional] |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
400 | Bad request | - |
401 | Unauthorized | - |
404 | Not found | - |
LoyaltyBalances getLoyaltyCardBalances(loyaltyProgramId, loyaltyCardId, endDate)
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.
// Import classes:
import one.talon.ApiClient;
import one.talon.ApiException;
import one.talon.Configuration;
import one.talon.auth.*;
import one.talon.models.*;
import one.talon.api.IntegrationApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://yourbaseurl.talon.one");
// Configure API key authorization: api_key_v1
ApiKeyAuth api_key_v1 = (ApiKeyAuth) defaultClient.getAuthentication("api_key_v1");
api_key_v1.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key_v1.setApiKeyPrefix("Token");
IntegrationApi apiInstance = new IntegrationApi(defaultClient);
Integer loyaltyProgramId = 56; // Integer | 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.
String 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.
OffsetDateTime endDate = new OffsetDateTime(); // OffsetDateTime | Used to return balances only for entries older than this timestamp. The expired, active, and pending points are relative to this timestamp. **Note:** It must be an RFC3339 timestamp string.
try {
LoyaltyBalances result = apiInstance.getLoyaltyCardBalances(loyaltyProgramId, loyaltyCardId, endDate);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling IntegrationApi#getLoyaltyCardBalances");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
loyaltyProgramId | Integer | Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the List loyalty programs endpoint. | |
loyaltyCardId | String | Identifier of the loyalty card. You can get the identifier with the List loyalty cards endpoint. | |
endDate | OffsetDateTime | Used to return balances only for entries older than this timestamp. The expired, active, and pending points are relative to this timestamp. Note: It must be an RFC3339 timestamp string. | [optional] |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
400 | Bad request | - |
401 | Unauthorized | - |
404 | Not found | - |
InlineResponse2001 getLoyaltyCardTransactions(loyaltyProgramId, loyaltyCardId, subledgerId, startDate, endDate, pageSize, skip)
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.
// Import classes:
import one.talon.ApiClient;
import one.talon.ApiException;
import one.talon.Configuration;
import one.talon.auth.*;
import one.talon.models.*;
import one.talon.api.IntegrationApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://yourbaseurl.talon.one");
// Configure API key authorization: api_key_v1
ApiKeyAuth api_key_v1 = (ApiKeyAuth) defaultClient.getAuthentication("api_key_v1");
api_key_v1.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key_v1.setApiKeyPrefix("Token");
IntegrationApi apiInstance = new IntegrationApi(defaultClient);
Integer loyaltyProgramId = 56; // Integer | 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.
String 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.
String subledgerId = "subledgerId_example"; // String | The ID of the subledger by which we filter the data.
OffsetDateTime startDate = new OffsetDateTime(); // OffsetDateTime | Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** It must be an RFC3339 timestamp string.
OffsetDateTime endDate = new OffsetDateTime(); // OffsetDateTime | Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** It must be an RFC3339 timestamp string.
Integer pageSize = 1000; // Integer | The number of items in this response.
Integer skip = 56; // Integer | The number of items to skip when paging through large result sets.
try {
InlineResponse2001 result = apiInstance.getLoyaltyCardTransactions(loyaltyProgramId, loyaltyCardId, subledgerId, startDate, endDate, pageSize, skip);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling IntegrationApi#getLoyaltyCardTransactions");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
loyaltyProgramId | Integer | Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the List loyalty programs endpoint. | |
loyaltyCardId | String | Identifier of the loyalty card. You can get the identifier with the List loyalty cards endpoint. | |
subledgerId | String | The ID of the subledger by which we filter the data. | [optional] |
startDate | OffsetDateTime | Date and time from which results are returned. Results are filtered by transaction creation date. Note: It must be an RFC3339 timestamp string. | [optional] |
endDate | OffsetDateTime | Date and time by which results are returned. Results are filtered by transaction creation date. Note: It must be an RFC3339 timestamp string. | [optional] |
pageSize | Integer | The number of items in this response. | [optional] [default to 1000] |
skip | Integer | The number of items to skip when paging through large result sets. | [optional] |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
400 | Bad request | - |
401 | Unauthorized | - |
404 | Not found | - |
InlineResponse2002 getLoyaltyProgramProfileTransactions(loyaltyProgramId, integrationId, subledgerId, startDate, endDate, pageSize, skip)
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 endpoint.
// Import classes:
import one.talon.ApiClient;
import one.talon.ApiException;
import one.talon.Configuration;
import one.talon.auth.*;
import one.talon.models.*;
import one.talon.api.IntegrationApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://yourbaseurl.talon.one");
// Configure API key authorization: api_key_v1
ApiKeyAuth api_key_v1 = (ApiKeyAuth) defaultClient.getAuthentication("api_key_v1");
api_key_v1.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key_v1.setApiKeyPrefix("Token");
IntegrationApi apiInstance = new IntegrationApi(defaultClient);
Integer loyaltyProgramId = 56; // Integer | 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.
String 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.
String subledgerId = "subledgerId_example"; // String | The ID of the subledger by which we filter the data.
OffsetDateTime startDate = new OffsetDateTime(); // OffsetDateTime | Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** It must be an RFC3339 timestamp string.
OffsetDateTime endDate = new OffsetDateTime(); // OffsetDateTime | Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** It must be an RFC3339 timestamp string.
Integer pageSize = 50; // Integer | The number of items in this response.
Integer skip = 56; // Integer | The number of items to skip when paging through large result sets.
try {
InlineResponse2002 result = apiInstance.getLoyaltyProgramProfileTransactions(loyaltyProgramId, integrationId, subledgerId, startDate, endDate, pageSize, skip);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling IntegrationApi#getLoyaltyProgramProfileTransactions");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
loyaltyProgramId | Integer | Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the List loyalty programs 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. | |
subledgerId | String | The ID of the subledger by which we filter the data. | [optional] |
startDate | OffsetDateTime | Date and time from which results are returned. Results are filtered by transaction creation date. Note: It must be an RFC3339 timestamp string. | [optional] |
endDate | OffsetDateTime | Date and time by which results are returned. Results are filtered by transaction creation date. Note: It must be an RFC3339 timestamp string. | [optional] |
pageSize | Integer | The number of items in this response. | [optional] [default to 50] |
skip | Integer | The number of items to skip when paging through large result sets. | [optional] |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
400 | Bad request | - |
401 | Unauthorized | - |
404 | Not found | - |
InlineResponse200 getReservedCustomers(couponValue)
List customers that have this coupon reserved
Return all customers that have this coupon marked as reserved. Coupons are reserved in the following ways: - To create a soft reservation (any customer can use the coupon), use the Create coupon reservation endpoint. - To create a hard reservation (only the given customer can use the coupon), create a coupon in the Campaign Manager for a given `recipientIntegrationId` or use the Create coupons or Create coupons for multiple recipients endpoints.
// Import classes:
import one.talon.ApiClient;
import one.talon.ApiException;
import one.talon.Configuration;
import one.talon.auth.*;
import one.talon.models.*;
import one.talon.api.IntegrationApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://yourbaseurl.talon.one");
// Configure API key authorization: api_key_v1
ApiKeyAuth api_key_v1 = (ApiKeyAuth) defaultClient.getAuthentication("api_key_v1");
api_key_v1.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key_v1.setApiKeyPrefix("Token");
IntegrationApi apiInstance = new IntegrationApi(defaultClient);
String couponValue = "couponValue_example"; // String | The code of the coupon.
try {
InlineResponse200 result = apiInstance.getReservedCustomers(couponValue);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling IntegrationApi#getReservedCustomers");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
couponValue | String | The code of the coupon. |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
400 | Bad request | - |
401 | Unauthorized - Invalid API key | - |
404 | Not found | - |
LoyaltyCard linkLoyaltyCardToProfile(loyaltyProgramId, loyaltyCardId, body)
Link customer profile to card
Loyalty cards allow customers to collect and spend loyalty points within a card-based loyalty program. 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. Note: You can link as many customer profiles to a given loyalty card as the card user limit allows.
// Import classes:
import one.talon.ApiClient;
import one.talon.ApiException;
import one.talon.Configuration;
import one.talon.auth.*;
import one.talon.models.*;
import one.talon.api.IntegrationApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://yourbaseurl.talon.one");
// Configure API key authorization: api_key_v1
ApiKeyAuth api_key_v1 = (ApiKeyAuth) defaultClient.getAuthentication("api_key_v1");
api_key_v1.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key_v1.setApiKeyPrefix("Token");
IntegrationApi apiInstance = new IntegrationApi(defaultClient);
Integer loyaltyProgramId = 56; // Integer | 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.
String 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.
LoyaltyCardRegistration body = new LoyaltyCardRegistration(); // LoyaltyCardRegistration | body
try {
LoyaltyCard result = apiInstance.linkLoyaltyCardToProfile(loyaltyProgramId, loyaltyCardId, body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling IntegrationApi#linkLoyaltyCardToProfile");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
loyaltyProgramId | Integer | Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the List loyalty programs endpoint. | |
loyaltyCardId | String | Identifier of the loyalty card. You can get the identifier with the List loyalty cards endpoint. | |
body | LoyaltyCardRegistration | body |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
400 | Bad request | - |
401 | Unauthorized | - |
404 | Not found | - |
ReopenSessionResponse reopenCustomerSession(customerSessionId)
Reopen customer session
Reopen a closed customer session. 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`. - Modified budgets and triggered effects when the session was closed are rolled back except for the list below. <details> <summary><strong>Effects and budgets unimpacted by a session reopening</strong></summary> <div> <p>The following effects and budgets are left the way they were once the session was originally closed:</p> <ul> <li>Add free item effect</li> <li>Any <strong>not pending</strong> pending loyalty points.</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> <p>To see an example of roll back, see the <a href="https://docs.talon.one/docs/dev/tutorials/rolling-back-effects\">Cancelling a session with campaign budgets tutorial</a>.</p> </details> Note: If your order workflow requires you to create a new session instead of reopening a session, use the Update customer session endpoint to cancel a closed session and create a new one.
// Import classes:
import one.talon.ApiClient;
import one.talon.ApiException;
import one.talon.Configuration;
import one.talon.auth.*;
import one.talon.models.*;
import one.talon.api.IntegrationApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://yourbaseurl.talon.one");
// Configure API key authorization: api_key_v1
ApiKeyAuth api_key_v1 = (ApiKeyAuth) defaultClient.getAuthentication("api_key_v1");
api_key_v1.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key_v1.setApiKeyPrefix("Token");
IntegrationApi apiInstance = new IntegrationApi(defaultClient);
String 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#operation/getApplicationSessions) endpoint.
try {
ReopenSessionResponse result = apiInstance.reopenCustomerSession(customerSessionId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling IntegrationApi#reopenCustomerSession");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
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 endpoint. |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
400 | Bad request | - |
401 | Unauthorized - Invalid API key | - |
IntegrationStateV2 returnCartItems(customerSessionId, body, dry)
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`. Its behavior depends on whether cart item flattening is enabled for the Application. Note: This will roll back any effects associated with these cart items. For more information, see our documentation on session states and this tutorial.
// Import classes:
import one.talon.ApiClient;
import one.talon.ApiException;
import one.talon.Configuration;
import one.talon.auth.*;
import one.talon.models.*;
import one.talon.api.IntegrationApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://yourbaseurl.talon.one");
// Configure API key authorization: api_key_v1
ApiKeyAuth api_key_v1 = (ApiKeyAuth) defaultClient.getAuthentication("api_key_v1");
api_key_v1.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key_v1.setApiKeyPrefix("Token");
IntegrationApi apiInstance = new IntegrationApi(defaultClient);
String 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#operation/getApplicationSessions) endpoint.
ReturnIntegrationRequest body = new ReturnIntegrationRequest(); // ReturnIntegrationRequest | body
Boolean dry = true; // Boolean | Indicates whether to persist the changes. Changes are ignored when `dry=true`.
try {
IntegrationStateV2 result = apiInstance.returnCartItems(customerSessionId, body, dry);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling IntegrationApi#returnCartItems");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
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 endpoint. | |
body | ReturnIntegrationRequest | body | |
dry | Boolean | Indicates whether to persist the changes. Changes are ignored when `dry=true`. | [optional] |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
400 | Bad request | - |
401 | Unauthorized - Invalid API key | - |
Catalog syncCatalog(catalogId, body)
Sync cart item catalog
Perform one or more of the following sync actions on this cart item catalog, up to 1000 actions: - Add an item to the catalog. - Edit the attributes of an item in the catalog. - Edit the attributes of more than one item in the catalog. - Remove an item from the catalog. - Remove more than one item from the catalog. Note: For more information, see our documentation on managing cart item catalogs. ### Filtering cart items Use cart item 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 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`. ### Payload examples Synchronization actions are sent as `PUT` requests. See the structure for each action: <details> <summary><strong>Adding an item to the catalog</strong></summary> <div> ```json { "actions": [ { "payload": { "attributes": { "color": "Navy blue", "type": "shoe" }, "replaceIfExists": true, "sku": "SKU1241028", "price": 100 }, "type": "ADD" } ] } ``` </div> </details> <details> <summary><strong>Editing the attributes of an item in the catalog</strong></summary> <div> ```json { "actions": [ { "payload": { "attributes": { "age": 11, "origin": "germany" }, "createIfNotExists": false, "sku": "SKU1241028" }, "type": "PATCH" } ] } ``` </div> </details> <details> <summary><strong>Editing the attributes of several items at once</strong></summary> <div> ```json { "actions": [ { "payload": { "attributes": { "color": "red" }, "filters": [ { "attr": "color", "op": "EQ", "value": "blue" } ] }, "type": "PATCH_MANY" } ] } ``` </div> </details> <details> <summary><strong>Removing an item from the catalog</strong></summary> <div> ```json { "actions": [ { "payload": { "sku": "SKU1241028" }, "type": "REMOVE" } ] } ``` </div> </details> <details> <summary><strong>Removing several items from the catalog at once</strong></summary> <div> ```json { "actions": [ { "payload": { "filters": [ { "attr": "color", "op": "EQ", "value": "blue" } ] }, "type": "REMOVE_MANY" } ] } ``` </div> </details> <details> <summary><strong>Removing shoes of sizes above 45 from the catalog</strong></summary> <div> <p> Let's imagine that we have a shoe store and we have decided to stop selling shoes larger than size 45. We can remove from the catalog all the shoes of sizes above 45 with a single action:</p> ```json { "actions": [ { "payload": { "filters": [ { "attr": "size", "op": "GT", "value": "45" } ] }, "type": "REMOVE_MANY" } ] } ``` </div> </details>
// Import classes:
import one.talon.ApiClient;
import one.talon.ApiException;
import one.talon.Configuration;
import one.talon.auth.*;
import one.talon.models.*;
import one.talon.api.IntegrationApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://yourbaseurl.talon.one");
// Configure API key authorization: api_key_v1
ApiKeyAuth api_key_v1 = (ApiKeyAuth) defaultClient.getAuthentication("api_key_v1");
api_key_v1.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key_v1.setApiKeyPrefix("Token");
IntegrationApi apiInstance = new IntegrationApi(defaultClient);
Integer catalogId = 56; // Integer | The ID of the catalog. You can find the ID in the Campaign Manager in **Account** > **Tools** > **Cart item catalogs**.
CatalogSyncRequest body = new CatalogSyncRequest(); // CatalogSyncRequest | body
try {
Catalog result = apiInstance.syncCatalog(catalogId, body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling IntegrationApi#syncCatalog");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
catalogId | Integer | The ID of the catalog. You can find the ID in the Campaign Manager in Account > Tools > Cart item catalogs. | |
body | CatalogSyncRequest | body |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
400 | Bad request | - |
401 | Unauthorized - Invalid API key | - |
404 | Not found | - |
TrackEventV2Response trackEventV2(body, silent, dry)
Track event
Triggers a custom event. You can build a condition around this event in your rules. Talon.One offers a set of built-in events. Ensure you do not create a custom event when you can use a built-in event. For example, use this endpoint to trigger an event when a customer shares a link to a product. See the tutorial. Important: - `profileId` is required. An event is associated with a customer profile. - Before using this endpoint, create your event as a custom attribute of type `event`. See the Developer docs. - We recommend sending requests sequentially. See Managing parallel requests. When you successfully sent an event to Talon.One, you can list received events in the Events view in the Campaign Manager.
// Import classes:
import one.talon.ApiClient;
import one.talon.ApiException;
import one.talon.Configuration;
import one.talon.auth.*;
import one.talon.models.*;
import one.talon.api.IntegrationApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://yourbaseurl.talon.one");
// Configure API key authorization: api_key_v1
ApiKeyAuth api_key_v1 = (ApiKeyAuth) defaultClient.getAuthentication("api_key_v1");
api_key_v1.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key_v1.setApiKeyPrefix("Token");
IntegrationApi apiInstance = new IntegrationApi(defaultClient);
IntegrationEventV2Request body = new IntegrationEventV2Request(); // IntegrationEventV2Request | body
String silent = "\"yes\""; // String | Possible values: `yes` or `no`. - `yes`: Increases the perfomance of the API call by returning a 204 response. - `no`: Returns a 200 response that contains the updated customer profiles.
Boolean dry = true; // Boolean | Indicates whether to persist the changes. Changes are ignored when `dry=true`.
try {
TrackEventV2Response result = apiInstance.trackEventV2(body, silent, dry);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling IntegrationApi#trackEventV2");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
body | IntegrationEventV2Request | body | |
silent | String | Possible values: `yes` or `no`. - `yes`: Increases the perfomance 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] |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
400 | Bad request | - |
401 | Unauthorized - Invalid API key | - |
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.
// Import classes:
import one.talon.ApiClient;
import one.talon.ApiException;
import one.talon.Configuration;
import one.talon.auth.*;
import one.talon.models.*;
import one.talon.api.IntegrationApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://yourbaseurl.talon.one");
// Configure API key authorization: api_key_v1
ApiKeyAuth api_key_v1 = (ApiKeyAuth) defaultClient.getAuthentication("api_key_v1");
api_key_v1.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key_v1.setApiKeyPrefix("Token");
IntegrationApi apiInstance = new IntegrationApi(defaultClient);
Integer audienceId = 56; // Integer | The ID of the audience. You get it via the `id` property when [creating an audience](#operation/createAudienceV2).
Object body = null; // Object | body
try {
apiInstance.updateAudienceCustomersAttributes(audienceId, body);
} catch (ApiException e) {
System.err.println("Exception when calling IntegrationApi#updateAudienceCustomersAttributes");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
audienceId | Integer | The ID of the audience. You get it via the `id` property when creating an audience. | |
body | Object | body |
null (empty response body)
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
204 | No Content | - |
401 | Unauthorized | - |
404 | Not found | - |
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 endpoint.
// Import classes:
import one.talon.ApiClient;
import one.talon.ApiException;
import one.talon.Configuration;
import one.talon.auth.*;
import one.talon.models.*;
import one.talon.api.IntegrationApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://yourbaseurl.talon.one");
// Configure API key authorization: api_key_v1
ApiKeyAuth api_key_v1 = (ApiKeyAuth) defaultClient.getAuthentication("api_key_v1");
api_key_v1.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key_v1.setApiKeyPrefix("Token");
IntegrationApi apiInstance = new IntegrationApi(defaultClient);
Integer audienceId = 56; // Integer | The ID of the audience. You get it via the `id` property when [creating an audience](#operation/createAudienceV2).
UpdateAudience body = new UpdateAudience(); // UpdateAudience | body
try {
Audience result = apiInstance.updateAudienceV2(audienceId, body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling IntegrationApi#updateAudienceV2");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
audienceId | Integer | The ID of the audience. You get it via the `id` property when creating an audience. | |
body | UpdateAudience | body |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
401 | Unauthorized | - |
404 | Not found | - |
updateCustomerProfileAudiences(body)
Update multiple customer profiles' audiences
Update the specified customer profiles with the specified audiences. Use this endpoint when customers join or leave audiences. The limit of customer profiles per request is 1000.
// Import classes:
import one.talon.ApiClient;
import one.talon.ApiException;
import one.talon.Configuration;
import one.talon.auth.*;
import one.talon.models.*;
import one.talon.api.IntegrationApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://yourbaseurl.talon.one");
// Configure API key authorization: api_key_v1
ApiKeyAuth api_key_v1 = (ApiKeyAuth) defaultClient.getAuthentication("api_key_v1");
api_key_v1.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key_v1.setApiKeyPrefix("Token");
IntegrationApi apiInstance = new IntegrationApi(defaultClient);
CustomerProfileAudienceRequest body = new CustomerProfileAudienceRequest(); // CustomerProfileAudienceRequest | body
try {
apiInstance.updateCustomerProfileAudiences(body);
} catch (ApiException e) {
System.err.println("Exception when calling IntegrationApi#updateCustomerProfileAudiences");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
body | CustomerProfileAudienceRequest | body |
null (empty response body)
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
204 | No Content | - |
400 | Bad request | - |
401 | Unauthorized | - |
404 | Not found | - |
CustomerProfileIntegrationResponseV2 updateCustomerProfileV2(integrationId, body, runRuleEngine, dry)
Update customer profile
Update or create a Customer Profile. 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. <div class="redoc-section"> <p class="title">Performance tips</p> - Updating a customer profile returns a response with the requested integration state. - 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. </div>
// Import classes:
import one.talon.ApiClient;
import one.talon.ApiException;
import one.talon.Configuration;
import one.talon.auth.*;
import one.talon.models.*;
import one.talon.api.IntegrationApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://yourbaseurl.talon.one");
// Configure API key authorization: api_key_v1
ApiKeyAuth api_key_v1 = (ApiKeyAuth) defaultClient.getAuthentication("api_key_v1");
api_key_v1.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key_v1.setApiKeyPrefix("Token");
IntegrationApi apiInstance = new IntegrationApi(defaultClient);
String 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.
CustomerProfileIntegrationRequestV2 body = new CustomerProfileIntegrationRequestV2(); // CustomerProfileIntegrationRequestV2 | body
Boolean 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.
Boolean 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.
try {
CustomerProfileIntegrationResponseV2 result = apiInstance.updateCustomerProfileV2(integrationId, body, runRuleEngine, dry);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling IntegrationApi#updateCustomerProfileV2");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
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. | |
body | CustomerProfileIntegrationRequestV2 | 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] |
CustomerProfileIntegrationResponseV2
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
400 | Bad request | - |
401 | Unauthorized - Invalid API key | - |
409 | Too many requests - Avoid parallel requests. See the docs. | - |
MultipleCustomerProfileIntegrationResponseV2 updateCustomerProfilesV2(body, silent)
Update multiple customer profiles
Update (or create) up to 1000 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.
// Import classes:
import one.talon.ApiClient;
import one.talon.ApiException;
import one.talon.Configuration;
import one.talon.auth.*;
import one.talon.models.*;
import one.talon.api.IntegrationApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://yourbaseurl.talon.one");
// Configure API key authorization: api_key_v1
ApiKeyAuth api_key_v1 = (ApiKeyAuth) defaultClient.getAuthentication("api_key_v1");
api_key_v1.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key_v1.setApiKeyPrefix("Token");
IntegrationApi apiInstance = new IntegrationApi(defaultClient);
MultipleCustomerProfileIntegrationRequest body = new MultipleCustomerProfileIntegrationRequest(); // MultipleCustomerProfileIntegrationRequest | body
String silent = "\"yes\""; // String | Possible values: `yes` or `no`. - `yes`: Increases the perfomance of the API call by returning a 204 response. - `no`: Returns a 200 response that contains the updated customer profiles.
try {
MultipleCustomerProfileIntegrationResponseV2 result = apiInstance.updateCustomerProfilesV2(body, silent);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling IntegrationApi#updateCustomerProfilesV2");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
body | MultipleCustomerProfileIntegrationRequest | body | |
silent | String | Possible values: `yes` or `no`. - `yes`: Increases the perfomance of the API call by returning a 204 response. - `no`: Returns a 200 response that contains the updated customer profiles. | [optional] [default to "yes"] |
MultipleCustomerProfileIntegrationResponseV2
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
400 | Bad request | - |
401 | Unauthorized - Invalid API key | - |
IntegrationStateV2 updateCustomerSessionV2(customerSessionId, body, dry)
Update customer session
Update or create a customer session. The endpoint responds with the potential promotion rule effects that match the current cart. For example, use this endpoint to share the contents of a customer's cart with Talon.One. Note: The currency for the session and the cart items in the session is the currency set for the Application that owns this session. ### Session management To use this endpoint, start by learning about 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: If the specified profile does not exist, an empty profile is created automatically. You can update it with Update customer profile. <div class="redoc-section"> <p class="title">Performance tips</p> - 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. </div> For more information, see: - The introductory video in Getting started. - The integration tutorial.
// Import classes:
import one.talon.ApiClient;
import one.talon.ApiException;
import one.talon.Configuration;
import one.talon.auth.*;
import one.talon.models.*;
import one.talon.api.IntegrationApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://yourbaseurl.talon.one");
// Configure API key authorization: api_key_v1
ApiKeyAuth api_key_v1 = (ApiKeyAuth) defaultClient.getAuthentication("api_key_v1");
api_key_v1.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key_v1.setApiKeyPrefix("Token");
IntegrationApi apiInstance = new IntegrationApi(defaultClient);
String 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#operation/getApplicationSessions) endpoint.
IntegrationRequest body = new IntegrationRequest(); // IntegrationRequest | body
Boolean dry = true; // Boolean | 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.
try {
IntegrationStateV2 result = apiInstance.updateCustomerSessionV2(customerSessionId, body, dry);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling IntegrationApi#updateCustomerSessionV2");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
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 endpoint. | |
body | IntegrationRequest | body | |
dry | Boolean | 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] |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
400 | Bad request | - |
401 | Unauthorized - Invalid API key | - |
409 | Too many requests - Avoid parallel requests. See the docs. | - |