Add Tags to a Customer
POST https://api.chartmogul.com/v1/customers/{CUSTOMER_UUID}/attributes/tags
Adds tags to a given customer.
curl -X POST "https://api.chartmogul.com/v1/customers/cus_de305d54-75b4-431b-adb2-eb6b9e546012/attributes/tags" \
-u YOUR_API_KEY: \
-H "Content-Type: application/json" \
-d '{
"tags": ["important", "Prio1"]
}'
customer = ChartMogul::Customer.retrieve("cus_de305d54-75b4-431b-adb2-eb6b9e546012")
customer.add_tags!("important", "Prio1")
ChartMogul.Tag.add(config, "cus_de305d54-75b4-431b-adb2-eb6b9e546012", {
tags: ["important", "Prio1"],
});
$customer = ChartMogul\Customer::retrieve("cus_de305d54-75b4-431b-adb2-eb6b9e546012");
$customer->addTags("important", "Prio1");
api.AddTagsToCustomer(
"cus_cus_de305d54-75b4-431b-adb2-eb6b9e546012",
[]string{"important", "Prio1"}
)
chartmogul.Tags.add(
config,
uuid="cus_cus_de305d54-75b4-431b-adb2-eb6b9e546012",
data={"tags": ["important", "Prio1"]},
)
{
"tags": ["engage", "unit loss", "discountable", "important", "Prio1"]
}
["engage", "unit loss", "discountable", "important", "Prio1"]
{
tags: ["engage", "unit loss", "discountable", "important", "Prio1"]
}
array (
0 => "engage",
1 => "unit loss",
2 => "discountable",
3 => "important",
4 => "Prio1"
)
(*chartmogul.TagsResult)(0xc0420c8bc0)({
Tags: ([]string) (len=5) {
(string) (len=6) "engage",
(string) (len=9) "unit loss",
(string) (len=12) "discountable",
(string) (len=9) "important",
(string) (len=5) "Prio1"
}
})
<Tags{
tags=["engage",
"unit loss",
"discountable",
"important",
"Prio1"
]
}>
Path parameters
customer_uuid
string required- The ChartMogul UUID of the customer.
Body parameters
tags
array(string) required- An
Array
of tags to be added to the customer.
Response
In the response, tags
contains an Array with all the tags now on this customer.
This endpoint is idempotent, meaning that calling it multiple times with the same tags, no additional tags will be added to the customer. If the endpoint is called with a single new tag, it will be added to previous tags of the user.