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:
curl --oauth2-bearer "$PARTNER_TOKEN" \ -X POST "https://sender.sandbox-api.kivra.com/dr/v1/auth/token/chain/$CHAIN_ID"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.