Developers
qashio.com

Exchange code for tokens

POST/oauth2/token

Exchange 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

FieldTypeDescription
grant_typestringAlways authorization_code. Required
client_idstringYour client identifier. Required
client_secretstringYour client secret. Required
codestringThe authorization code. Required
redirect_uristringThe redirect URI used to obtain the code; must match exactly. Required
JSON
{
  "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.

FieldTypeDescription
access_tokenstringBearer token to send on API requests
token_typestringAlways Bearer
refresh_tokenstringSend this to Refresh access token before the access token expires
scopestringSpace-separated scopes granted, e.g. cards:read cards:write transactions:read
Response schema from the OpenAPI document
FieldTypeDescription
access_tokenstring
token_typestring
refresh_tokenstring
scopestring

Errors

StatusCause
400Missing or unsupported parameters, or redirect_uri does not match the one used at authorization
401Authorization code invalid, expired or already used; invalid client credentials
  • 400Invalid grant / missing client credentials
  • 401Invalid 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.

This request takes no parameters.

Response

Send the request to see the response.

Esc

Start here

IntroductionIntegration walkthroughAuthenticationConventions

Popular endpoints

POSTExchange code for tokens/oauth2/tokenGETGet company summary/public/v1/erp/company/summaryGETList bank accounts/public/v1/erp/bank_accountsGETList cards/public/v1/erp/cardsGETList chart of accounts/public/v1/erp/chart_of_accounts