Orishare
Api
GET
/rewards
AuthorizationBearer <token>

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

In: header

Query Parameters

status?string

Value in

  • "active"
  • "archived"

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/rewards"
{  "data": [    {      "id": "string",      "name": "string",      "cost": 0,      "currency": "string",      "availability": 0,      "issued": 0,      "expiry_after": "string",      "status": "active",      "version": 0,      "created_at": "string",      "updated_at": "string"    }  ],  "next_cursor": "string",  "has_more": true}
POST
/rewards
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/rewards" \  -H "Content-Type: application/json" \  -d '{    "name": "Free audiobook",    "cost": 500,    "currency": "points",    "availability": 100,    "expiry_after": "30d"  }'
{  "id": "string",  "name": "string",  "cost": 0,  "currency": "string",  "availability": 0,  "issued": 0,  "expiry_after": "string",  "status": "active",  "version": 0,  "created_at": "string",  "updated_at": "string"}
GET
/rewards/{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/rewards/string"
{  "id": "string",  "name": "string",  "cost": 0,  "currency": "string",  "availability": 0,  "issued": 0,  "expiry_after": "string",  "status": "active",  "version": 0,  "created_at": "string",  "updated_at": "string"}
PATCH
/rewards/{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/rewards/string" \  -H "Content-Type: application/json" \  -d '{}'
{  "id": "string",  "name": "string",  "cost": 0,  "currency": "string",  "availability": 0,  "issued": 0,  "expiry_after": "string",  "status": "active",  "version": 0,  "created_at": "string",  "updated_at": "string"}
DELETE
/rewards/{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/rewards/string"
Empty
GET
/reward_issuances
AuthorizationBearer <token>

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

In: header

Query Parameters

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

Value in

  • "issued"
  • "redeemed"
  • "cancelled"
  • "expired"

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/reward_issuances"
{  "data": [    {      "id": "string",      "reward_id": "string",      "customer_id": "string",      "status": "issued",      "source_type": "rule_execution",      "source_id": "string",      "cost_entry_id": "string",      "expires_at": "string",      "redeemed_at": "string",      "cancelled_at": "string",      "version": 0,      "created_at": "string"    }  ],  "next_cursor": "string",  "has_more": true}
POST
/reward_issuances
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/reward_issuances" \  -H "Content-Type: application/json" \  -d '{    "reward_id": "rw_123",    "customer_id": "cust_123"  }'
{  "id": "string",  "reward_id": "string",  "customer_id": "string",  "status": "issued",  "source_type": "rule_execution",  "source_id": "string",  "cost_entry_id": "string",  "expires_at": "string",  "redeemed_at": "string",  "cancelled_at": "string",  "version": 0,  "created_at": "string"}
GET
/reward_issuances/{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/reward_issuances/string"
{  "id": "string",  "reward_id": "string",  "customer_id": "string",  "status": "issued",  "source_type": "rule_execution",  "source_id": "string",  "cost_entry_id": "string",  "expires_at": "string",  "redeemed_at": "string",  "cancelled_at": "string",  "version": 0,  "created_at": "string"}
POST
/reward_issuances/{id}/redeem
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 POST "https://example.com/reward_issuances/string/redeem"
{  "id": "string",  "reward_id": "string",  "customer_id": "string",  "status": "issued",  "source_type": "rule_execution",  "source_id": "string",  "cost_entry_id": "string",  "expires_at": "string",  "redeemed_at": "string",  "cancelled_at": "string",  "version": 0,  "created_at": "string"}
POST
/reward_issuances/{id}/cancel
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/reward_issuances/string/cancel" \  -H "Content-Type: application/json" \  -d '{}'
{  "id": "string",  "reward_id": "string",  "customer_id": "string",  "status": "issued",  "source_type": "rule_execution",  "source_id": "string",  "cost_entry_id": "string",  "expires_at": "string",  "redeemed_at": "string",  "cancelled_at": "string",  "version": 0,  "created_at": "string"}