Appearance
Linking and consent
A partner presents bills in its own application. Registering a partner and issuing its server key do not authorize access to anyone's bills. The person grants bounded read permission from their signed-in Račun account.
Confirm the offered scope
The account reads GET /v1/partners with its access token. Each active partner has a requested_scope; the response also gives configured code/grant lifetimes. The account confirms that offer using POST /v1/me/partner-links:
json
{"partner":"invented-presenter","scope":"bills:read"}bills:read selects the legacy presentment profile. bills:read-rich selects the minimized rich profile, including supported legacy and rich sources. The confirmed scope must match the partner's current offer. An omitted scope means bills:read; it never silently adopts a broader offer. If the offer changes while the person is reviewing it, a stale confirmation is refused rather than expanded.
The response contains a one-time code, its expiry, scope, partner and the grant lifetime promised for its exchange. Display that information before the person copies the code. Do not put the code in a URL, analytics or logs.
Exchange the code
The person enters the code in the partner's application. Its server calls POST /v1/partner/links with partner HMAC authentication:
json
{"code":"ABCDE-12345"}This is an invented shape example, not a usable code. Letters may be upper/lower case, with or without the single middle hyphen. The exchange body contains only code; a partner cannot choose a different scope or name an account by email, OIB, customer number or account UUID.
First exchange returns 201 with grant_id, expires_at and scope. The same partner exchanging the same still-valid code can recover the same live grant with 200. It cannot revive revoked/expired access. A lost response therefore needs recovery with the same code while valid, not an invented second customer.
Use the configured lifetimes from GET /v1/partners, the issued code response's expires_at and grant_days, and the exchanged grant's expires_at, as defined in the generated contract. These server answers are authoritative; do not assume a universal code or grant lifetime. Later configuration changes do not extend an issued code or grant. The account's code creation is bounded; handle 429 using Retry-After and the current UI rather than generating codes in a loop.
Revoke and renew
The person reads GET /v1/me/partner-grants and revokes one with DELETE /v1/me/partner-grants/{grant_id}. Effective revocation also voids earlier unused codes for that same partner, so a spare old code cannot restore access. A new grant needs a new code issued after revocation. Successful account deletion revokes its grants; a refused deletion changes none of them.
Partner suspension prevents exchange and reads while retaining grants. Resuming the partner restores only grants/keys that remain valid; it does not renew them. Key revocation prevents that key from authenticating. Changing a partner's offered scope affects future consent, never expands existing codes/grants.
Identity and market boundaries
The authenticated person is identified by issuer + subject. Matching email addresses do not merge accounts. Staff roles, provider memberships, customer connections and deletion state belong to the local market instance. Login does not copy permissions into another market or prove ownership of a provider account.
Customer consent routes use the current local account. Administrative access requires the admin application and the corresponding market permissions. A provider signing key cannot call partner routes, and a partner key cannot deliver provider bills.
A grant authorizes the partner to request an account's presentation. Every returned bill still needs the account's current bill access. Continue with partner pull and its withdrawal limits.