Skip to content
This is a new version of the Kivra Developer Docs. Report issues or share feedback at avsandare.support@kivra.se. The previous version can be found here.

Create partner token

POST
/dr/v1/auth/token
curl --request POST \
--url https://sender.sandbox-api.kivra.com/dr/v1/auth/token \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data grant_type=client_credentials \
--data client_id=example \
--data client_secret=example

Requires client_id and client_secret.

The returned partner token is sufficient on its own: it can create and manage all of your chains and stores and send receipts for any store. For most integrations this is the only token you need — scoping down to a chain or store token is optional (see the /dr/v1/auth/token/chain/{chainID} and /dr/v1/auth/token/store/{storeID} endpoints).

Media typeapplication/x-www-form-urlencoded
object
grant_type
required
string
Allowed values: client_credentials
client_id
required
string
client_secret
required
string

Token successfully created

Media typeapplication/json
TokenResponse
object
access_token
string
token_type
string
Allowed values: Bearer
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"
}

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"
}

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"
}