Personalization
Personalization is key to providing a tailored experience for your customers by utilizing their preferences and behavior data. On this page, we’ll dive into the different personalization endpoints you can use to manage personalization settings programmatically. We'll look at how to query, create, update, and delete personalization records.
The personalization model
The personalization model contains all the information related to a customer’s personalization settings, including preferences, behavior data, and customized recommendations.
Properties
- Name
id- Type
- string
- Description
Unique identifier for the personalization record.
- Name
customer_id- Type
- string
- Description
Unique identifier for the customer.
- Name
preferences- Type
- object
- Description
Preferences of the customer, such as preferred products or services.
- Name
behavior_data- Type
- object
- Description
Data on the customer's behavior, such as browsing and purchase history.
- Name
recommendations- Type
- object
- Description
Customized recommendations for the customer.
- Name
created_at- Type
- timestamp
- Description
Timestamp of when the personalization record was created.
- Name
updated_at- Type
- timestamp
- Description
Timestamp of when the personalization record was last updated.
List all personalization records
This endpoint allows you to retrieve a paginated list of all your personalization records. By default, a maximum of ten records are shown per page.
Optional attributes
- Name
limit- Type
- integer
- Description
Limit the number of personalization records returned.
- Name
customer_id- Type
- string
- Description
Only show records for the specified customer.
Request
curl -G https://api.finx.ai/v1/personalization \
-H "Authorization: Bearer {token}" \
-d limit=10
Response
{
"has_more": false,
"data": [
{
"id": "xgQQXg3hrtjh7AvZ",
"customer_id": "WAz8eIbvDR60rouK",
"preferences": {
"preferred_products": ["laptop", "smartphone"],
"preferred_services": ["tech support", "cloud storage"]
},
"behavior_data": {
"browsing_history": ["electronics", "gadgets"],
"purchase_history": ["laptop", "smartphone"]
},
"recommendations": {
"products": ["tablet", "smartwatch"],
"services": ["extended warranty", "data recovery"]
},
"created_at": 705103200,
"updated_at": 705103200
},
{
"id": "hSIhXBhNe8X1d8Et"
// ...
}
]
}
Create a personalization record
This endpoint allows you to add a new personalization record. You need to provide the customer ID, preferences, behavior data, and recommendations to create a personalization record.
Required attributes
- Name
customer_id- Type
- string
- Description
Unique identifier for the customer.
- Name
preferences- Type
- object
- Description
Preferences of the customer, such as preferred products or services.
- Name
behavior_data- Type
- object
- Description
Data on the customer's behavior, such as browsing and purchase history.
- Name
recommendations- Type
- object
- Description
Customized recommendations for the customer.
Request
curl https://api.finx.ai/v1/personalization \
-H "Authorization: Bearer {token}" \
-d 'customer_id'="WAz8eIbvDR60rouK" \
-d 'preferences'='{"preferred_products": ["laptop", "smartphone"], "preferred_services": ["tech support", "cloud storage"]}' \
-d 'behavior_data'='{"browsing_history": ["electronics", "gadgets"], "purchase_history": ["laptop", "smartphone"]}' \
-d 'recommendations'='{"products": ["tablet", "smartwatch"], "services": ["extended warranty", "data recovery"]}'
Response
{
"id": "xgQQXg3hrtjh7AvZ",
"customer_id": "WAz8eIbvDR60rouK",
"preferences": {
"preferred_products": ["laptop", "smartphone"],
"preferred_services": ["tech support", "cloud storage"]
},
"behavior_data": {
"browsing_history": ["electronics", "gadgets"],
"purchase_history": ["laptop", "smartphone"]
},
"recommendations": {
"products": ["tablet", "smartwatch"],
"services": ["extended warranty", "data recovery"]
},
"created_at": 705103200,
"updated_at": 705103200
}
Retrieve a personalization record
This endpoint allows you to retrieve a personalization record by providing the record id. Refer to the list at the top of this page to see which properties are included with personalization objects.
Request
curl https://api.finx.ai/v1/personalization/xgQQXg3hrtjh7AvZ \
-H "Authorization: Bearer {token}"
Response
{
"id": "xgQQXg3hrtjh7AvZ",
"customer_id": "WAz8eIbvDR60rouK",
"preferences": {
"preferred_products": ["laptop", "smartphone"],
"preferred_services": ["tech support", "cloud storage"]
},
"behavior_data": {
"browsing_history": ["electronics", "gadgets"],
"purchase_history": ["laptop", "smartphone"]
},
"recommendations": {
"products": ["tablet", "smartwatch"],
"services": ["extended warranty", "data recovery"]
},
"created_at": 705103200,
"updated_at": 705103200
}
Update a personalization record
This endpoint allows you to perform an update on a personalization record. Examples of updates are changing the preferences, updating behavior data, or modifying the recommendations.
Optional attributes
- Name
preferences- Type
- object
- Description
Updated preferences of the customer.
- Name
behavior_data- Type
- object
- Description
Updated data on the customer's behavior.
- Name
recommendations- Type
- object
- Description
Updated customized recommendations for the customer.
Request
curl -X PUT https://api.finx.ai/v1/personalization/xgQQXg3hrtjh7AvZ \
-H "Authorization: Bearer {token}" \
-d 'preferences'='{"preferred_products": ["tablet", "smartwatch"], "preferred_services": ["extended warranty", "data recovery"]}'
Response
{
"id": "xgQQXg3hrtjh7AvZ",
"customer_id": "WAz8eIbvDR60rouK",
"preferences": {
"preferred_products": ["tablet", "smartwatch"],
"preferred_services": ["extended warranty", "data recovery"]
},
"behavior_data": {
"browsing_history": ["electronics", "gadgets"],
"purchase_history": ["laptop", "smartphone"]
},
"recommendations": {
"products": ["tablet", "smartwatch"],
"services": ["extended warranty", "data recovery"]
},
"created_at": 705103200,
"updated_at": 705103200
}
Delete a personalization record
This endpoint allows you to delete your personalization records in Fin X. Note: This will permanently delete the record and all its data — ensure this is the desired action before proceeding.
Request
curl -X DELETE https://api.finx.ai/v1/personalization/xgQQXg3hrtjh7AvZ \
-H "Authorization: Bearer {token}"