Tiers
Update a tier
Update a tier or its levels, or archive or restore the tier by setting status.
patch/v1/programs/{program_id}/tiers/{tier_key}
Request
- Base URL: https://api.scrip.dev
- URL: https://api.scrip.dev/v1/programs/{program_id}/tiers/{tier_key}
- Auth: HTTP bearer
Path parameters
program_idstring uuid required
The program's id.
tier_keystring required
The tier's key, such as status.
Request body
Example request
{
"display_name": "Loyalty Status",
"levels": [
{
"color": "#FFD700",
"display_name": "Gold",
"icon_url": "https://example.com/icons/gold.png",
"key": "gold",
"qualification": {
"criteria": [
{
"counter": "nights",
"operator": ">=",
"threshold": 25
}
],
"mode": "ALL"
},
"qualification_condition": "participant.counter.nights >= 25",
"rank": 2
}
],
"lifecycle": {
"counters": {
"rollover": "EXCESS"
},
"downgrade_policy": {
"grace_days": 30,
"min_level": "silver",
"mode": "DROP_ONE"
},
"qualification_period": {
"start_day": 1,
"start_month": 2,
"type": "FIXED_YEAR"
},
"retention": {
"duration": "90d",
"mode": "ACTIVITY_REFRESH"
},
"status_validity": {
"extend_months": 1
}
},
"status": "ARCHIVED"
}Response
Updated tier
Example response
{
"archived_at": "2027-01-15T10:30:00Z",
"created_at": "2027-01-15T10:30:00Z",
"display_name": "Loyalty Status",
"id": "e0a4c6b2-8d13-4f57-9b6a-3c5e7a9d1b22",
"key": "status",
"levels": [
{
"color": "#FFD700",
"created_at": "2027-01-15T10:30:00Z",
"display_name": "Gold",
"icon_url": "https://example.com/icons/gold.png",
"id": "e0a4c6b2-8d13-4f57-9b6a-3c5e7a9d1b22",
"key": "gold",
"qualification": {
"criteria": [
{
"counter": "nights",
"operator": ">=",
"threshold": 25
}
],
"mode": "ALL"
},
"qualification_condition": "participant.counter.nights >= 25",
"rank": 2,
"updated_at": "2027-01-15T10:30:00Z"
}
],
"lifecycle": {
"counters": {
"rollover": "EXCESS"
},
"downgrade_policy": {
"grace_days": 30,
"min_level": "silver",
"mode": "DROP_ONE"
},
"qualification_period": {
"start_day": 1,
"start_month": 2,
"type": "FIXED_YEAR"
},
"retention": {
"duration": "90d",
"mode": "ACTIVITY_REFRESH"
},
"status_validity": {
"extend_months": 1
}
},
"program_id": "8f14e45f-ceea-4e70-9df8-2a7d1b3c9f01",
"status": "ACTIVE",
"updated_at": "2027-01-15T10:30:00Z"
}Changes
No recorded changes to this operation across all 1 revision of this API.