curl --request PUT \
--url {protocol}://{host}/v2/loyalties/tier-structures/{tierStructureId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-App-Id: <api-key>' \
--header 'X-App-Token: <api-key>' \
--data '
{
"name": "<string>",
"point_balance": {
"card_definition_id": "<string>"
},
"point_earned": {
"card_definition_id": "<string>",
"period": {
"value": 2
}
},
"expiration": {
"fixed_duration": {
"period": {
"value": 2
}
},
"calendar_expiration": {
"calendar_dates": [
{
"day": 16,
"month": 6
}
]
},
"sliding_expiration": {
"period": {
"value": 2
},
"earning_activity": true,
"spending_activity": true,
"custom_activity": true,
"custom_activity_types": [
"<string>"
]
}
},
"downgrade": {
"grace_period": {
"value": 2,
"round_up": true
}
},
"metadata": {}
}
'{
"id": "<string>",
"name": "<string>",
"expiration": {
"fixed_duration": {
"period": {
"value": 123
}
},
"calendar_expiration": {
"calendar_dates": [
{
"day": 16,
"month": 6
}
]
},
"sliding_expiration": {
"earning_activity": true,
"spending_activity": true,
"custom_activity": true,
"custom_activity_types": [
"<string>"
],
"period": {
"value": 123
}
}
},
"downgrade": {
"grace_period": {
"value": 123,
"round_up": true
}
},
"metadata": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"object": "<string>",
"point_balance": {
"card_definition_id": "<string>"
},
"point_earned": {
"card_definition_id": "<string>",
"period": {
"value": 123
}
}
}{
"code": 123,
"key": "<string>",
"message": "<string>",
"details": "<string>",
"request_id": "<string>"
}{
"code": 123,
"key": "<string>",
"message": "<string>",
"details": "<string>",
"request_id": "<string>"
}{
"code": 123,
"key": "<string>",
"message": "<string>",
"details": "<string>",
"request_id": "<string>"
}{
"code": 123,
"key": "<string>",
"message": "<string>",
"details": "<string>",
"request_id": "<string>"
}Update tier structure
⚠️ BETA endpoint
This is a work-in-progress documentation of a BETA endpoint. The parameters, fields, request and response bodies, and other data may subject to change. If you want to share feedback or improvements, contact Voucherify support or your Technical Account Manager.
Updates a tier structure. All properties are optional; provided
values are merged with the existing tier structure. When type is provided as
POINT_EARNED, point_earned is required and point_balance must be null; when
type is POINT_BALANCE, point_balance is required and point_earned must be null.
When the tier structure is not in DRAFT status, only name and metadata may be
updated; attempting to update other properties results in a validation error.
curl --request PUT \
--url {protocol}://{host}/v2/loyalties/tier-structures/{tierStructureId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-App-Id: <api-key>' \
--header 'X-App-Token: <api-key>' \
--data '
{
"name": "<string>",
"point_balance": {
"card_definition_id": "<string>"
},
"point_earned": {
"card_definition_id": "<string>",
"period": {
"value": 2
}
},
"expiration": {
"fixed_duration": {
"period": {
"value": 2
}
},
"calendar_expiration": {
"calendar_dates": [
{
"day": 16,
"month": 6
}
]
},
"sliding_expiration": {
"period": {
"value": 2
},
"earning_activity": true,
"spending_activity": true,
"custom_activity": true,
"custom_activity_types": [
"<string>"
]
}
},
"downgrade": {
"grace_period": {
"value": 2,
"round_up": true
}
},
"metadata": {}
}
'{
"id": "<string>",
"name": "<string>",
"expiration": {
"fixed_duration": {
"period": {
"value": 123
}
},
"calendar_expiration": {
"calendar_dates": [
{
"day": 16,
"month": 6
}
]
},
"sliding_expiration": {
"earning_activity": true,
"spending_activity": true,
"custom_activity": true,
"custom_activity_types": [
"<string>"
],
"period": {
"value": 123
}
}
},
"downgrade": {
"grace_period": {
"value": 123,
"round_up": true
}
},
"metadata": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"object": "<string>",
"point_balance": {
"card_definition_id": "<string>"
},
"point_earned": {
"card_definition_id": "<string>",
"period": {
"value": 123
}
}
}{
"code": 123,
"key": "<string>",
"message": "<string>",
"details": "<string>",
"request_id": "<string>"
}{
"code": 123,
"key": "<string>",
"message": "<string>",
"details": "<string>",
"request_id": "<string>"
}{
"code": 123,
"key": "<string>",
"message": "<string>",
"details": "<string>",
"request_id": "<string>"
}{
"code": 123,
"key": "<string>",
"message": "<string>",
"details": "<string>",
"request_id": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Unique tier structure identifier.
^lts_[a-f0-9]+$Body
Request body for updating a tier structure. All properties are optional; no
additional properties are allowed. When the tier structure is not in DRAFT
status, only name and metadata may be updated.
Display name of the tier structure.
1 - 200Tier qualification tracking model. If provided, the matching tracking settings
object (point_balance or point_earned) becomes required.
POINT_BALANCE, POINT_EARNED Point balance tracking settings. Required (non-null) when type is provided as
POINT_BALANCE; must be null when type is provided as POINT_EARNED.
Show child attributes
Show child attributes
Points earned tracking settings. Required (non-null) when type is provided as
POINT_EARNED; must be null when type is provided as POINT_BALANCE.
Show child attributes
Show child attributes
Tier membership expiration settings.
Show child attributes
Show child attributes
Downgrade behavior applied when tier membership expires.
Show child attributes
Show child attributes
Free-form key/value object holding custom attributes.
Response
The updated tier structure.
Tier structure resource.
Unique tier structure identifier.
^lts_[a-f0-9]+$Display name of the tier structure.
Tier qualification tracking model.
POINT_BALANCE, POINT_EARNED Tier membership expiration settings.
Show child attributes
Show child attributes
Downgrade behavior applied when tier membership expires.
Show child attributes
Show child attributes
Free-form key/value object holding custom attributes. Defaults to {}.
Current lifecycle status of the tier structure.
DRAFT, ACTIVE, INACTIVE, DELETED Creation timestamp (ISO 8601).
Last update timestamp (ISO 8601), or null if never updated.
Object type discriminator. Always tier_structure.
"tier_structure"Point balance tracking settings. Present only when type is POINT_BALANCE;
omitted otherwise.
Show child attributes
Show child attributes
Points earned tracking settings. Present only when type is POINT_EARNED;
omitted otherwise.
Show child attributes
Show child attributes
Was this page helpful?

