Orishare
API reference
GET
/tier_programs

Authorization

AuthorizationBearer <token>

Secret API key bound to an environment.

In: header

Query Parameters

limit?integer
Range1 <= value <= 200
Default50
cursor?string
Lengthlength <= 2048

Header Parameters

X-Orishare-Environment?string

Required for selected-environment authorization branches; API keys use their bound environment.

Length1 <= length
X-Orishare-Audit-Reason?string

Required for staff authorization. Records the reason for staff access.

Length1 <= length

Response Body

application/json

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",      "retention": {        "mode": "none",        "grace_days": 0      },      "is_default": true,      "status": "active",      "levels": [        {          "id": "string",          "name": "string",          "threshold": 0,          "rank": 0,          "benefits": [            {              "key": "string",              "title": "string",              "description": "string",              "icon": "string"            }          ]        }      ],      "version": 0,      "reevaluation": {        "version": 0,        "status": "pending",        "evaluated": 0,        "changed": 0,        "conflicts": 0      },      "created_at": "2019-08-24T14:15:22Z",      "updated_at": "2019-08-24T14:15:22Z"    }  ],  "next_cursor": "string",  "has_more": true}
POST
/tier_programs

Authorization

AuthorizationBearer <token>

Secret API key bound to an environment.

In: header

Header Parameters

Idempotency-Key*string

Required. Official clients generate a UUID when omitted by the caller.

Length1 <= length <= 255
X-Orishare-Environment?string

Required for selected-environment authorization branches; API keys use their bound environment.

Length1 <= length
X-Orishare-Audit-Reason?string

Required for staff authorization. Records the reason for staff access.

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

application/json

curl -X POST "https://example.com/tier_programs" \  -H "Idempotency-Key: string" \  -H "Content-Type: application/json" \  -d '{    "name": "Status",    "currency": "points",    "basis": {      "type": "lifetime_earned"    },    "levels": [      {        "name": "bronze",        "threshold": 0      }    ]  }'
{  "id": "string",  "name": "string",  "currency": "string",  "basis": {    "type": "lifetime_earned"  },  "downgrade_check": "daily",  "retention": {    "mode": "none",    "grace_days": 0  },  "is_default": true,  "status": "active",  "levels": [    {      "id": "string",      "name": "string",      "threshold": 0,      "rank": 0,      "benefits": [        {          "key": "string",          "title": "string",          "description": "string",          "icon": "string"        }      ]    }  ],  "version": 0,  "reevaluation": {    "version": 0,    "status": "pending",    "evaluated": 0,    "changed": 0,    "conflicts": 0  },  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z"}
GET
/tier_programs/{id}

Authorization

AuthorizationBearer <token>

Secret API key bound to an environment.

In: header

Path Parameters

id*string
Length1 <= length

Header Parameters

X-Orishare-Environment?string

Required for selected-environment authorization branches; API keys use their bound environment.

Length1 <= length
X-Orishare-Audit-Reason?string

Required for staff authorization. Records the reason for staff access.

Length1 <= length

Response Body

application/json

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",  "retention": {    "mode": "none",    "grace_days": 0  },  "is_default": true,  "status": "active",  "levels": [    {      "id": "string",      "name": "string",      "threshold": 0,      "rank": 0,      "benefits": [        {          "key": "string",          "title": "string",          "description": "string",          "icon": "string"        }      ]    }  ],  "version": 0,  "reevaluation": {    "version": 0,    "status": "pending",    "evaluated": 0,    "changed": 0,    "conflicts": 0  },  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z"}
PATCH
/tier_programs/{id}

Authorization

AuthorizationBearer <token>

Secret API key bound to an environment.

In: header

Path Parameters

id*string
Length1 <= length

Header Parameters

X-Orishare-Environment?string

Required for selected-environment authorization branches; API keys use their bound environment.

Length1 <= length
X-Orishare-Audit-Reason?string

Required for staff authorization. Records the reason for staff access.

Length1 <= length
If-Match?string

Optional legacy revision. Missing or malformed values follow the existing route parser.

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

application/json

curl -X PATCH "https://example.com/tier_programs/string" \  -H "Content-Type: application/json" \  -d '{    "name": "Updated"  }'
{  "id": "string",  "name": "string",  "currency": "string",  "basis": {    "type": "lifetime_earned"  },  "downgrade_check": "daily",  "retention": {    "mode": "none",    "grace_days": 0  },  "is_default": true,  "status": "active",  "levels": [    {      "id": "string",      "name": "string",      "threshold": 0,      "rank": 0,      "benefits": [        {          "key": "string",          "title": "string",          "description": "string",          "icon": "string"        }      ]    }  ],  "version": 0,  "reevaluation": {    "version": 0,    "status": "pending",    "evaluated": 0,    "changed": 0,    "conflicts": 0  },  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z"}
DELETE
/tier_programs/{id}

Authorization

AuthorizationBearer <token>

Secret API key bound to an environment.

In: header

Path Parameters

id*string
Length1 <= length

Header Parameters

X-Orishare-Environment?string

Required for selected-environment authorization branches; API keys use their bound environment.

Length1 <= length
X-Orishare-Audit-Reason?string

Required for staff authorization. Records the reason for staff access.

Length1 <= length

Response Body

application/json

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}/reevaluate

Authorization

AuthorizationBearer <token>

Secret API key bound to an environment.

In: header

Path Parameters

id*string
Length1 <= length

Header Parameters

X-Orishare-Environment?string

Required for selected-environment authorization branches; API keys use their bound environment.

Length1 <= length
X-Orishare-Audit-Reason?string

Required for staff authorization. Records the reason for staff access.

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

application/json

curl -X POST "https://example.com/tier_programs/string/reevaluate" \  -H "Content-Type: application/json" \  -d '{}'
{  "version": 0,  "status": "pending",  "evaluated": 0,  "changed": 0,  "conflicts": 0}
POST
/tier_programs/{id}/evaluate

Authorization

AuthorizationBearer <token>

Secret API key bound to an environment.

In: header

Path Parameters

id*string
Length1 <= length

Header Parameters

X-Orishare-Environment?string

Required for selected-environment authorization branches; API keys use their bound environment.

Length1 <= length
X-Orishare-Audit-Reason?string

Required for staff authorization. Records the reason for staff access.

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

application/json

curl -X POST "https://example.com/tier_programs/string/evaluate" \  -H "Content-Type: application/json" \  -d '{    "customer_id": "cust_0123456789abcdef0123456789abcdef"  }'
{  "effects": [    null  ],  "tier": {    "customer_id": "string",    "program_id": "string",    "level": "string",    "since": "2019-08-24T14:15:22Z",    "last_evaluated_at": "2019-08-24T14:15:22Z",    "source": "evaluate",    "qualifies_until": "2019-08-24T14:15:22Z",    "grace_until": "2019-08-24T14:15:22Z",    "benefits": [      {        "key": "string",        "title": "string",        "description": "string",        "icon": "string"      }    ],    "next_level": {      "name": "string",      "threshold": 0,      "benefits": [        {          "key": "string",          "title": "string",          "description": "string",          "icon": "string"        }      ]    }  }}
GET
/customers/{id}/tiers

Authorization

AuthorizationBearer <token>

Secret API key bound to an environment.

In: header

Path Parameters

id*string
Length1 <= length

Query Parameters

limit?integer
Range1 <= value <= 200
Default50
cursor?string
Lengthlength <= 2048

Header Parameters

X-Orishare-Environment?string

Required for selected-environment authorization branches; API keys use their bound environment.

Length1 <= length
X-Orishare-Audit-Reason?string

Required for staff authorization. Records the reason for staff access.

Length1 <= length

Response Body

application/json

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": "2019-08-24T14:15:22Z",      "last_evaluated_at": "2019-08-24T14:15:22Z",      "source": "evaluate",      "qualifies_until": "2019-08-24T14:15:22Z",      "grace_until": "2019-08-24T14:15:22Z",      "benefits": [        {          "key": "string",          "title": "string",          "description": "string",          "icon": "string"        }      ],      "next_level": {        "name": "string",        "threshold": 0,        "benefits": [          {            "key": "string",            "title": "string",            "description": "string",            "icon": "string"          }        ]      }    }  ],  "next_cursor": "string",  "has_more": true}
POST
/customers/{id}/tiers

Authorization

AuthorizationBearer <token>

Secret API key bound to an environment.

In: header

Path Parameters

id*string
Length1 <= length

Header Parameters

Idempotency-Key?string

Optional. When sent, the stored response is replayed for 24 h.

Length1 <= length <= 255
X-Orishare-Environment?string

Required for selected-environment authorization branches; API keys use their bound environment.

Length1 <= length
X-Orishare-Audit-Reason?string

Required for staff authorization. Records the reason for staff access.

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

application/json

curl -X POST "https://example.com/customers/string/tiers" \  -H "Content-Type: application/json" \  -d '{    "program_id": "tp_0123456789abcdef0123456789abcdef",    "level": "bronze"  }'
{  "customer_id": "string",  "program_id": "string",  "level": "string",  "since": "2019-08-24T14:15:22Z",  "last_evaluated_at": "2019-08-24T14:15:22Z",  "source": "evaluate",  "qualifies_until": "2019-08-24T14:15:22Z",  "grace_until": "2019-08-24T14:15:22Z",  "benefits": [    {      "key": "string",      "title": "string",      "description": "string",      "icon": "string"    }  ],  "next_level": {    "name": "string",    "threshold": 0,    "benefits": [      {        "key": "string",        "title": "string",        "description": "string",        "icon": "string"      }    ]  }}