Exchange code for tokens
/oauth2/tokenExchange an authorization code for an access token and a refresh token.
The token endpoint, called with grant_type=authorization_code. Send the code
returned by the Qashio login flow, together with the redirect_uri it was issued against, and
Qashio returns an access token and a refresh token. To rotate an expiring token, call the same URL
with grant_type=refresh_token: see Refresh access token.
Your client_id and client_secret are required. These are confidential client credentials and
must never be used from a browser or mobile app.
Authorization codes are single use and expire after ten minutes. Exchange one as soon as it arrives.
This endpoint does not use the standard response envelope.
Request body
application/jsonrequired
| Field | Type | Description |
|---|---|---|
grant_type | string | Always authorization_code. Required |
client_id | string | Your client identifier. Required |
client_secret | string | Your client secret. Required |
code | string | The authorization code. Required |
redirect_uri | string | The redirect URI used to obtain the code; must match exactly. Required |
{
"grant_type": "authorization_code",
"code": "AUTHORIZATION_CODE",
"client_id": "YOUR_CLIENT_ID",
"client_secret": "YOUR_CLIENT_SECRET",
"redirect_uri": "https://app.example.com/callback"
}Response
200 with the token set.
| Field | Type | Description |
|---|---|---|
access_token | string | Bearer token to send on API requests |
token_type | string | Always Bearer |
refresh_token | string | Send this to Refresh access token before the access token expires |
scope | string | Space-separated scopes granted, e.g. cards:read cards:write transactions:read |
Response schema from the OpenAPI document
| Field | Type | Description |
|---|---|---|
access_token | string | |
token_type | string | |
refresh_token | string | |
scope | string |
Errors
| Status | Cause |
|---|---|
400 | Missing or unsupported parameters, or redirect_uri does not match the one used at authorization |
401 | Authorization code invalid, expired or already used; invalid client credentials |
400Invalid grant / missing client credentials401Invalid client, or authorization code invalid, expired or already used
Every error carries an errors[] array and a meta.request_id. See Errors for the full envelope.