Skip to content

Get OAuth2 access token

Request

Bodyapplication/x-www-form-urlencoded
grant_typestring(Grant Type)^(client_credentials|refresh_token)$
Default:"client_credentials"
scopestring(Scope)
Default:""
client_idstring or null(Client Id)
Any of:
string
client_secretstring or null(Client Secret)
Any of:
string
POST
/auth/token
curl -i -X POST \
  https://api.spensepay.com/partner/auth/token \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d grant_type=client_credentials \
  -d scope= \
  -d client_id=your_client_id \
  -d client_secret=your_client_secret

Responses

Successful Response

Bodyapplication/json
access_tokenstring(Access Token)required

The access token (UUID)

token_typestring(Token Type)

The type of the token, typically 'bearer'.

Default:"bearer"
expires_ininteger(Expires In)required

The number of seconds until the token expires.

Response
{ "access_token": "123e4567-e89b-12d3-a456-426614174000", "token_type": "bearer", "expires_in": 3600 }