Skip to main content

Importing existing customer data

As a tool for making targeted campaigns, Talon.One can only be as powerful as the data you give it. When first setting up your integration, ensure you prefill information about your customers so that your campaigns can make smart decisions immediately.

Importing customer profiles

In Talon.One, the data related to a customer is represented by the customer profile entity.

To update customer profile data, use the Update customer profile endpoint directly or via an SDK.

Example

Using curl, you can update one profile like follows.

curl --request PUT 'https://example.talon.one/v2/customer_profiles/mysessionid' \
--header 'Authorization: ApiKey-v1 my_api_key' \
--header 'Content-Type: application/json' \
--data-raw '{
{
"attributes": {
"Name": "John doe",
"Email": "john.doe@example.com",
"SignupDate": "2012-07-09T19:22:09.1440844Z",
"Phone": "202-555-0113",
},
"responseContent": [
"customerProfile"
]
}
}'
note
  • The exact details of how to map your customer data to profile attributes depends on your Application.
  • A complete list of built-in attributes can be found in the [attribute library reference][attributelibrary].
  • You can define your own profile attributes for any data you need in your targeting campaigns.

Importing past customer sessions

The responses to the Update customer profile endpoint shows a number of properties on profiles for data managed by the Talon.One API, such as TotalSales.

Your existing customers might have some sales history, and you might want to use this history when targeting campaigns. In this case, this information should be imported into Talon.One using the updateCustomerSession operation.

Similar to profiles, you can loop through these past orders and create a session for each one.

important

We are dealing with past orders, so we create them as closed. Read more about sessions management in Customer sessions

Example

Using curl, you can update one session like follows. Values between angle brackets mean they come from your order management system.

curl --request PUT 'https://example.talon.one/v2/customer_sessions/mysessionid' \
--header 'Authorization: ApiKey-v1 my_api_key' \
--header 'Content-Type: application/json' \
--data-raw '{
"customerSession": {
"profileId": "<somecustomerid>",
"state": "closed",
"total": "<ordertotal>",
"attributes": {
"BillingName": "<billinginfo>",
"ShippingCost": "<shippingcost>"
}
},
"responseContent": [
[
"customerSession",
"customerProfile"
]
]
}'
note
  • Like customer profiles, the mapping of order history to session attributes depends on your Application.
  • See Attributes for more information on custom attributes how to use them.
  • The profileId of a session should match the ID you created when loading customer profiles.
  • The state of a session must be set to closed for Talon.One to include that order in the total sales calculation for the associated profile.