curl --location --request POST 'https://api.stateset.com/v1/customers/:id/tag' \
--header 'Content-Type: application/json' \
--header 'Authorization: Token <token>' \
--data-raw '{
"customer_id": "cust_123abc",
"tags_to_add": ["vip", "high_value", "early_adopter"],
"tags_to_remove": ["prospect"],
"tag_metadata": {
"category": "loyalty",
"source": "manual",
"expiry_date": "2024-12-31"
}
}'
{
"id": "cust_123abc",
"current_tags": [
"vip",
"high_value",
"early_adopter",
"repeat_buyer",
"email_subscriber"
],
"tags_added": ["vip", "high_value", "early_adopter"],
"tags_removed": ["prospect"],
"tag_count": 5,
"segments": [
{
"id": "seg_premium",
"name": "Premium Customers",
"matched_by_tags": ["vip", "high_value"]
},
{
"id": "seg_engaged",
"name": "Highly Engaged",
"matched_by_tags": ["repeat_buyer", "email_subscriber"]
}
],
"updated_at": "2024-01-15T10:30:00Z",
"updated_by": "user_123",
"success": true
}
This endpoint adds or removes tags from a customer for segmentation and categorization.
curl --location --request POST 'https://api.stateset.com/v1/customers/:id/tag' \
--header 'Content-Type: application/json' \
--header 'Authorization: Token <token>' \
--data-raw '{
"customer_id": "cust_123abc",
"tags_to_add": ["vip", "high_value", "early_adopter"],
"tags_to_remove": ["prospect"],
"tag_metadata": {
"category": "loyalty",
"source": "manual",
"expiry_date": "2024-12-31"
}
}'
{
"id": "cust_123abc",
"current_tags": [
"vip",
"high_value",
"early_adopter",
"repeat_buyer",
"email_subscriber"
],
"tags_added": ["vip", "high_value", "early_adopter"],
"tags_removed": ["prospect"],
"tag_count": 5,
"segments": [
{
"id": "seg_premium",
"name": "Premium Customers",
"matched_by_tags": ["vip", "high_value"]
},
{
"id": "seg_engaged",
"name": "Highly Engaged",
"matched_by_tags": ["repeat_buyer", "email_subscriber"]
}
],
"updated_at": "2024-01-15T10:30:00Z",
"updated_by": "user_123",
"success": true
}
curl --location --request POST 'https://api.stateset.com/v1/customers/:id/tag' \
--header 'Content-Type: application/json' \
--header 'Authorization: Token <token>' \
--data-raw '{
"customer_id": "cust_123abc",
"tags_to_add": ["vip", "high_value", "early_adopter"],
"tags_to_remove": ["prospect"],
"tag_metadata": {
"category": "loyalty",
"source": "manual",
"expiry_date": "2024-12-31"
}
}'
{
"id": "cust_123abc",
"current_tags": [
"vip",
"high_value",
"early_adopter",
"repeat_buyer",
"email_subscriber"
],
"tags_added": ["vip", "high_value", "early_adopter"],
"tags_removed": ["prospect"],
"tag_count": 5,
"segments": [
{
"id": "seg_premium",
"name": "Premium Customers",
"matched_by_tags": ["vip", "high_value"]
},
{
"id": "seg_engaged",
"name": "Highly Engaged",
"matched_by_tags": ["repeat_buyer", "email_subscriber"]
}
],
"updated_at": "2024-01-15T10:30:00Z",
"updated_by": "user_123",
"success": true
}