auth_endpoints

Generate token

Client credentials in the request-body and HTTP Basic Auth are supported.

post/v1/auth/token

Request

Request body application/x-www-form-urlencoded

client_idstring uuid

The ID of the client (also known as the Application ID).

client_secretstring

The secret of the client.

grant_type'client_credentials' | 'authorization_code' required

The OAuth2.0 grant types supported.

scopestring required

The scope to request, multiple scopes are passed delimited by a space character.

codestring nullable

The authorization code obtained from the server when performing the authorization code flow. It is required to exchange the code for an access token that will be used to perform actions on behalf of a user.

redirect_uristring nullable

The redirect URI that was included in the initial authorization request. The value must be an exact match of the previously used URI, otherwise the request will be rejected.

code_verifierstring nullable

If the code_challenge parameter was included in the initial authorization requests, the application must now provide the code verifier. The value is the plaintext string that was used to calculate the hash that was previously sent in the code_challenge parameter.

Example request

{
  "scope": "ping",
  "code": "8A9D16B4C3E25F6A",
  "redirect_uri": "https://example.com/callback",
  "code_verifier": "Th7UHJdLswIYQxwSg29DbK1a_d9o41uNMTRmuH0PM8zyoMAQ"
}

Response

The token was successfully generated.

access_tokenstring

The auth token used when consuming the API endpoints.

expires_ininteger

Token lifetime in seconds. The default is 30 days, but this returned value is authoritative for the issued token.

scopestring

The scopes available for the token.

token_typestring

The token type is always "bearer".

Example response

{
  "access_token": "oMahtBwBbnZeh4Q66mSuLFmk2V0_CLCKVt0aYcNJlcg.yditzjwCP7yp0PgR6AzQR3wQ1rTdCjkcPeAMuyfK-NU",
  "expires_in": 2592000,
  "scope": "ping orders.create",
  "token_type": "bearer"
}

Changes

No recorded changes to this operation across all 1 revision of this API.