Authentication

Exchange authorization code or refresh token

Exchange an authorization code for access and refresh tokens, or use a refresh token to obtain a new access token.

This endpoint supports two grant types:

  • authorization_code — Exchange the authorization code received from the OAuth callback for access and refresh tokens.
  • refresh_token — Use a valid refresh token to obtain a new access token without requiring re-authorization.

Access tokens expire after 60 minutes. Use the refresh_token grant type to obtain a new access token before expiry.

post/v1/oauth2/token

Request

  • Base URL
    https://auth.foundation.dev.trusspayments.com
  • URL
    https://auth.foundation.dev.trusspayments.com/v1/oauth2/token
  • Auth
    none required

Request body application/x-www-form-urlencoded

OR

Response

Token exchange successful

access_tokenstring required

JWT access token to include in API request Authorization headers

refresh_tokenstring

Token used to obtain a new access token when the current one expires

token_type'bearer' required
expires_ininteger required

Token lifetime in seconds (typically 3600)

scopestring

Space-separated list of granted scopes

Changes

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