Tiers

Create a tier

Creates a new tier with levels within a program.

post/v1/programs/{program_id}/tiers

Request

  • Base URL: https://api.scrip.dev
  • URL: https://api.scrip.dev/v1/programs/{program_id}/tiers
  • Auth: HTTP bearer

Path parameters

program_idstring uuid required

The program's id.

Headers

Idempotency-Keystring

A key you choose to make this request safe to retry: 1 to 255 printable ASCII characters. Send the same key with the same request to get the first response again, marked Idempotent-Replayed: true. Routes that return a secret once, and claim links, do not replay a response. Event ingest uses the key as the event's identity.

Request body

display_namestring

Human-readable name shown in dashboards and reports

keystring required

Unique identifier for this tier within the program (immutable after creation, lowercase alphanumeric + underscores)

Example request

{
  "display_name": "Loyalty Status",
  "key": "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
    }
  }
}

Response

Tier created

archived_atstring date-time

When the tier was archived (RFC 3339); absent while the tier is ACTIVE

created_atstring date-time

When this tier was created (RFC 3339)

display_namestring

The name people see for the tier, such as Loyalty status.

idstring uuid

Unique identifier for this tier

keystring

Tier key used in API calls and rule actions

program_idstring uuid

Program this tier belongs to

status'ACTIVE' | 'ARCHIVED'

The tier's lifecycle state.

updated_atstring date-time

When this tier was last modified (RFC 3339)

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.