curl --request POST \
--url https://{cluster}.voucherify.io/v2/loyalties/programs/{programId}/tier-structures/batch \
--header 'Content-Type: application/json' \
--header 'X-App-Id: <api-key>' \
--header 'X-App-Token: <api-key>' \
--data '
{
"assign": [
{
"id": "<string>"
}
],
"unassign": [
{
"id": "<string>"
}
],
"options": {
"strict": true
}
}
'{
"assigned": [
{
"tier_structure_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"object": "program_tier_structure"
}
],
"unassigned": [
{
"tier_structure_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"object": "program_tier_structure"
}
]
}{
"code": 123,
"key": "<string>",
"message": "<string>",
"details": "<string>",
"request_id": "<string>",
"resource_id": "<string>",
"resource_type": "<string>"
}{
"code": 123,
"key": "<string>",
"message": "<string>",
"details": "<string>",
"request_id": "<string>",
"resource_id": "<string>",
"resource_type": "<string>"
}{
"code": 123,
"key": "<string>",
"message": "<string>",
"details": "<string>",
"request_id": "<string>",
"resource_id": "<string>",
"resource_type": "<string>"
}{
"code": 123,
"key": "<string>",
"message": "<string>",
"details": "<string>",
"request_id": "<string>",
"resource_id": "<string>",
"resource_type": "<string>"
}{
"code": 500,
"key": "api_error",
"message": "Something went wrong. Don't worry, your campaigns are still safe and the Voucherify Team has been notified. Check out our Help Center and forums for help, or head back to home."
}Batch assign/unassign tier structures
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact Voucherify support or your Technical Account Manager.
Assigns and/or unassigns tier structures to/from a program in a single batch.
Unassign operations are processed before assign operations. Unassigning is only
allowed while the program is in DRAFT status - otherwise the request is rejected
with 423 Locked (key non_draft_program). A program can have at most one tier
structure assigned. In strict mode (default) missing tier structures, inactive tier
structures or missing assignments cause the whole batch to fail.
curl --request POST \
--url https://{cluster}.voucherify.io/v2/loyalties/programs/{programId}/tier-structures/batch \
--header 'Content-Type: application/json' \
--header 'X-App-Id: <api-key>' \
--header 'X-App-Token: <api-key>' \
--data '
{
"assign": [
{
"id": "<string>"
}
],
"unassign": [
{
"id": "<string>"
}
],
"options": {
"strict": true
}
}
'{
"assigned": [
{
"tier_structure_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"object": "program_tier_structure"
}
],
"unassigned": [
{
"tier_structure_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"object": "program_tier_structure"
}
]
}{
"code": 123,
"key": "<string>",
"message": "<string>",
"details": "<string>",
"request_id": "<string>",
"resource_id": "<string>",
"resource_type": "<string>"
}{
"code": 123,
"key": "<string>",
"message": "<string>",
"details": "<string>",
"request_id": "<string>",
"resource_id": "<string>",
"resource_type": "<string>"
}{
"code": 123,
"key": "<string>",
"message": "<string>",
"details": "<string>",
"request_id": "<string>",
"resource_id": "<string>",
"resource_type": "<string>"
}{
"code": 123,
"key": "<string>",
"message": "<string>",
"details": "<string>",
"request_id": "<string>",
"resource_id": "<string>",
"resource_type": "<string>"
}{
"code": 500,
"key": "api_error",
"message": "Something went wrong. Don't worry, your campaigns are still safe and the Voucherify Team has been notified. Check out our Help Center and forums for help, or head back to home."
}Authorizations
Path Parameters
Identifies the loyalty program. Format lprg_[a-f0-9]+.
^lprg_[a-f0-9]+$Body
Request body schema for POST /v2/loyalties/programs/{programId}/tier-structures/batch.
Response
Batch processing result.
Response body schema for POST /v2/loyalties/programs/{programId}/tier-structures/batch.

