curl --request POST \
--url https://{cluster}.voucherify.io/v2/loyalties/tier-structures/{tierStructureId}/tiers/batch \
--header 'Content-Type: application/json' \
--header 'X-App-Id: <api-key>' \
--header 'X-App-Token: <api-key>' \
--data '
{
"create": [
{
"name": "Bronze tier",
"qualification_rules": {
"type": "POINTS",
"points": {
"min_value": 1,
"max_value": 99
}
}
},
{
"name": "Silver tier",
"qualification_rules": {
"type": "POINTS",
"points": {
"min_value": 100,
"max_value": 199
}
}
},
{
"name": "Gold tier",
"qualification_rules": {
"type": "POINTS",
"points": {
"min_value": 200
}
}
}
],
"update": [],
"remove": []
}
'Batch create, update, and remove tiers
Creates, updates, and removes tiers in a tier structure in one transaction. Each of create, update, and remove accepts up to 100 items, and at least one of them must contain an item.
The batch runs in this order: remove, update, then create. If any item fails, none of the changes are saved.
When the tier structure is in DRAFT status, all three actions are allowed. In any other status, create and remove are rejected, and update can change only name and metadata.
A tier follows the tier structure’s points expiration when points_expiration.type is INHERIT. Any other type overrides those rules. You can set or change that override only while the tier structure is DRAFT. In any other status, omit points_expiration.
After the batch, tier names must be unique within the tier structure, and points ranges of tiers must not overlap. A tier that an earning rule or a reward still uses cannot be removed.
A successful call returns 204 with no body. It records vl.tier_structure.tier.created for each created tier, vl.tier_structure.tier.updated for each updated tier, and vl.tier_structure.tier.deleted for each removed tier.
curl --request POST \
--url https://{cluster}.voucherify.io/v2/loyalties/tier-structures/{tierStructureId}/tiers/batch \
--header 'Content-Type: application/json' \
--header 'X-App-Id: <api-key>' \
--header 'X-App-Token: <api-key>' \
--data '
{
"create": [
{
"name": "Bronze tier",
"qualification_rules": {
"type": "POINTS",
"points": {
"min_value": 1,
"max_value": 99
}
}
},
{
"name": "Silver tier",
"qualification_rules": {
"type": "POINTS",
"points": {
"min_value": 100,
"max_value": 199
}
}
},
{
"name": "Gold tier",
"qualification_rules": {
"type": "POINTS",
"points": {
"min_value": 200
}
}
}
],
"update": [],
"remove": []
}
'Authorizations
Path Parameters
Body
Request body schema for POST /v2/loyalties/tier-structures/{tierStructureId}/tiers/batch.
Response
The batch was processed. The response has no body.

