curl https://api.thanxsandbox.com/partner/tags \
-X PUT \
-H 'X-ClientId: {client_id}' \
-H 'Accept-Version: v4.0' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer {access_token}' \
-d '{
"merchant_id": "weroifs",
"user_ids": [
"wroeiu2304hfwf",
"73bf1f46769dwr"
],
"key": "allergens",
"values": [
"gluten",
"soy",
"dairy",
"honey"
]
}'
{}
Tags
Upsert Tags
PUT
/
partner
/
tags
curl https://api.thanxsandbox.com/partner/tags \
-X PUT \
-H 'X-ClientId: {client_id}' \
-H 'Accept-Version: v4.0' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer {access_token}' \
-d '{
"merchant_id": "weroifs",
"user_ids": [
"wroeiu2304hfwf",
"73bf1f46769dwr"
],
"key": "allergens",
"values": [
"gluten",
"soy",
"dairy",
"honey"
]
}'
{}
Scope required:
tags.writeuser_ids can
be specified per API request.
Currently, tags are merchant/user-scoped. This means that they are accessible
to be managed by all integration partners a given merchant enables. Given this,
for tags that are integration-specific and not general purpose user profile
attributes, we recommend integration partners prefix tag keys with the name of
your organization to avoid key usage conflicts between integrations enabled for
a given merchant.
eg:
thanx-custom-tag, rather thancustom-tag, would be preferred for tags that are integration specificallergensshould still be used, if it’s expected that the tag be leveraged as a general-purpose user profile attribute
Employee and employee are treated as the same
key (writing one overwrites the other’s values), so use a consistent
lowercase-with-hyphens convention.
Parameters
string
Merchant ID
array<string>
User IDs (500 max per request)
user_ids must be each user’s Thanx identifier — the value returned as id by
Get Users. An ID copied from a dashboard URL or a
customer-data/SFTP export is a different encoding and will not match: the
request returns 201 with zero tags written and no error. Confirm one test
user lands before running a bulk write.string
Tag key
array(string)
Array of tag values (50 max)
Response
curl https://api.thanxsandbox.com/partner/tags \
-X PUT \
-H 'X-ClientId: {client_id}' \
-H 'Accept-Version: v4.0' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer {access_token}' \
-d '{
"merchant_id": "weroifs",
"user_ids": [
"wroeiu2304hfwf",
"73bf1f46769dwr"
],
"key": "allergens",
"values": [
"gluten",
"soy",
"dairy",
"honey"
]
}'
{}