Optional - Create chain token
POST
/dr/v1/auth/token/chain/{chainID}
const url = 'https://sender.sandbox-api.kivra.com/dr/v1/auth/token/chain/example';const options = {method: 'POST'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://sender.sandbox-api.kivra.com/dr/v1/auth/token/chain/exampleOptional. A chain-scoped token only narrows what a token may access — your partner token can already manage every chain and store and send receipts for any store. Use this endpoint only for distributed integrations where you want to limit an integration point to a single chain; centralized integrations can keep using the partner token throughout.
Access scope
- PARTNER
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”chainID
required
string
Chain ID
Responses
Section titled “Responses”Token successfully created
Media typeapplication/json
TokenResponse
object
access_token
string
token_type
string
expires_in
Expiration time in seconds
integer
Example
{ "access_token": "<JWT token>", "token_type": "Bearer", "expires_in": 86000}Bad request
Media typeapplication/json
ErrorResponse
object
error_code
string
short_message
string
long_message
string
error_detail
Array<string>
Examples
{ "error_code": "40000", "short_message": "bad request", "long_message": "body s missing required fields or has invalid fields"}{ "error_code": "40002", "short_message": "bad request", "long_message": "missing required header or invalid header"}Unauthorized
Media typeapplication/json
ErrorResponse
object
error_code
string
short_message
string
long_message
string
error_detail
Array<string>
Examples
Exampleunauthorized
{ "error_code": "40100", "short_message": "unauthorized", "long_message": "permission denied"}Not found
Media typeapplication/json
ErrorResponse
object
error_code
string
short_message
string
long_message
string
error_detail
Array<string>
Examples
Exampleresource_not_found
{ "error_code": "40400", "short_message": "not found", "long_message": "the requested resource could not be found"}Internal server error
Media typeapplication/json
ErrorResponse
object
error_code
string
short_message
string
long_message
string
error_detail
Array<string>
Example
{ "error_code": "50000", "short_message": "internal server error", "long_message": "unknown error ocurred"}