Orishare
Api
GET
/tier_programs
AuthorizationBearer <token>

Secret key (osk_…), publishable key (opk_…) or personal access token (opat_…).

In: header

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/tier_programs"
{  "data": [    {      "id": "string",      "name": "string",      "currency": "string",      "basis": {        "type": "lifetime_earned"      },      "downgrade_check": "daily",      "is_default": true,      "status": "active",      "levels": [        {          "id": "string",          "name": "string",          "threshold": 0,          "rank": 0        }      ],      "version": 0,      "created_at": "string",      "updated_at": "string"    }  ],  "next_cursor": "string",  "has_more": true}
POST
/tier_programs
AuthorizationBearer <token>

Secret key (osk_…), publishable key (opk_…) or personal access token (opat_…).

In: header

Header Parameters

Idempotency-Key?string

Required by the API on this route (400 idempotency_key_required without it); the official clients generate a UUID when you omit it.

Length1 <= length <= 255

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/tier_programs" \  -H "Content-Type: application/json" \  -d '{    "name": "Listener status",    "currency": "points",    "basis": {      "type": "lifetime_earned"    },    "is_default": true,    "levels": [      {        "name": "bronze",        "threshold": 0      },      {        "name": "silver",        "threshold": 500      },      {        "name": "gold",        "threshold": 2000      }    ]  }'
{  "id": "string",  "name": "string",  "currency": "string",  "basis": {    "type": "lifetime_earned"  },  "downgrade_check": "daily",  "is_default": true,  "status": "active",  "levels": [    {      "id": "string",      "name": "string",      "threshold": 0,      "rank": 0    }  ],  "version": 0,  "created_at": "string",  "updated_at": "string"}
GET
/tier_programs/{id}
AuthorizationBearer <token>

Secret key (osk_…), publishable key (opk_…) or personal access token (opat_…).

In: header

Path Parameters

id*string
Length1 <= length

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/tier_programs/string"
{  "id": "string",  "name": "string",  "currency": "string",  "basis": {    "type": "lifetime_earned"  },  "downgrade_check": "daily",  "is_default": true,  "status": "active",  "levels": [    {      "id": "string",      "name": "string",      "threshold": 0,      "rank": 0    }  ],  "version": 0,  "created_at": "string",  "updated_at": "string"}
PATCH
/tier_programs/{id}
AuthorizationBearer <token>

Secret key (osk_…), publishable key (opk_…) or personal access token (opat_…).

In: header

Path Parameters

id*string
Length1 <= length

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X PATCH "https://example.com/tier_programs/string" \  -H "Content-Type: application/json" \  -d '{}'
{  "id": "string",  "name": "string",  "currency": "string",  "basis": {    "type": "lifetime_earned"  },  "downgrade_check": "daily",  "is_default": true,  "status": "active",  "levels": [    {      "id": "string",      "name": "string",      "threshold": 0,      "rank": 0    }  ],  "version": 0,  "created_at": "string",  "updated_at": "string"}
DELETE
/tier_programs/{id}
AuthorizationBearer <token>

Secret key (osk_…), publishable key (opk_…) or personal access token (opat_…).

In: header

Path Parameters

id*string
Length1 <= length

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X DELETE "https://example.com/tier_programs/string"
Empty
POST
/tier_programs/{id}/evaluate
AuthorizationBearer <token>

Secret key (osk_…), publishable key (opk_…) or personal access token (opat_…).

In: header

Path Parameters

id*string
Length1 <= length

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/tier_programs/string/evaluate" \  -H "Content-Type: application/json" \  -d '{    "customer_id": "string"  }'
{  "effects": [    null  ],  "tier": {    "customer_id": "string",    "program_id": "string",    "level": "string",    "since": "string",    "last_evaluated_at": "string",    "source": "evaluate"  }}
GET
/customers/{id}/tiers
AuthorizationBearer <token>

Secret key (osk_…), publishable key (opk_…) or personal access token (opat_…).

In: header

Path Parameters

id*string
Length1 <= length

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/customers/string/tiers"
{  "data": [    {      "customer_id": "string",      "program_id": "string",      "level": "string",      "since": "string",      "last_evaluated_at": "string",      "source": "evaluate"    }  ],  "next_cursor": "string",  "has_more": true}
POST
/customers/{id}/tiers
AuthorizationBearer <token>

Secret key (osk_…), publishable key (opk_…) or personal access token (opat_…).

In: header

Path Parameters

id*string
Length1 <= length

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/customers/string/tiers" \  -H "Content-Type: application/json" \  -d '{    "program_id": "string",    "level": "string"  }'
{  "customer_id": "string",  "program_id": "string",  "level": "string",  "since": "string",  "last_evaluated_at": "string",  "source": "evaluate"}