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.

Advanced use cases

Most integrations only need a partner token. It can send receipts for every business unit owned by your organisation.

For distributed integrations, use the partner token server-side to mint a narrower token. Scoped tokens restrict access; they are not required to create or link chains and stores.

Token Scope Suitable use
Chain token One chain and its business units A chain-specific integration
Store token One business unit A POS installation at one location

Use the relevant chain or store ID in the path. The examples below use the sandbox environment and a partner token:

Terminal window
curl --oauth2-bearer "$PARTNER_TOKEN" \
-X POST "https://sender.sandbox-api.kivra.com/dr/v1/auth/token/chain/$CHAIN_ID"
Terminal window
curl --oauth2-bearer "$PARTNER_TOKEN" \
-X POST "https://sender.sandbox-api.kivra.com/dr/v1/auth/token/store/$STORE_ID"

Each request returns a JWT with the same access_token, token_type, and expires_in fields as a partner token. Give each downstream system only the narrowest token it needs. Never embed the partner token in store hardware or client-side applications.

Scoped tokens do not remove the need to validate receipt data. The receipt body must still describe the authorised business unit in business_unit. Consult the Receipt API reference for the exact token-creation endpoints and response fields.