Skip to content
Tranzaq

Concepts

Authentication

OAuth 2.0 client credentials, scopes, and how revoking works.

The API uses the OAuth 2.0 client credentials flow, made for servers calling servers. There is no user sign-in and no browser step. Never put the secret in a mobile app or a web page.

The flow

  1. Create credentials on the website (Developers). You get a client ID and a secret, shown once.
  2. Send them to POST /oauth/token and receive a bearer token valid for one hour (expires_in: 3600).
  3. Send the token on every call: Authorization: Bearer <token>.
  4. Before it expires, ask for a new token. Do not ask on every call; cache the token.

You may send the ID and secret in the form body, or as an HTTP Basic header (Authorization: Basic base64(client_id:client_secret)).

Scopes

Credentials carry the scopes you chose. A token can carry the same or fewer, never more. Asking for a scope the credentials do not have answers invalid_scope.

ScopeAllows
balance.readRead the balance
beneficiaries.readList and read people
beneficiaries.writeAdd people
payouts.readList and read payout batches
payouts.writeCreate, submit and cancel batches
sandbox.fundTest mode only: add fake money

Revoking

Revoke credentials on the website and every token already issued from them stops working at once, not after an hour. Credentials can also be given an expiry when you create them.

Token errors

errorStatusMeaning
unsupported_grant_type400Only client_credentials is supported.
invalid_client401Wrong ID or secret, or the credentials were revoked or expired, or the business is not active.
invalid_scope400You asked for a scope your credentials do not have.