Skip to content
Status

Token endpoint

POSThttps://merchant.shuttleglobal.com/token

POST
/token

Authenticate your client in one of two ways:

  1. In the request body, with the client_id and client_secret parameters, or
  2. With HTTP Basic authentication, using your client_id as the username and your client_secret as the password

Use one method per request, not both. If you put client_id or client_secret in the body, put both there.

This endpoint supports two use cases:

  1. Authorization Code Exchange:

    • Use this when you have received an authorization code from the /authorize flow
    • Required parameters: grant_type=authorization_code, code, redirect_uri, plus your client credentials (see above)
    • Returns both access_token and refresh_token
    • The redirect_uri must match the one used in the original /authorize request
    • The authorization code must be exchanged within 15 minutes of being generated
  2. Refresh Token Exchange:

    • Use this to get a new access_token when your current one expires
    • Required parameters: grant_type=refresh_token, refresh_token, plus your client credentials (see above)
    • Returns only access_token (refresh_token remains the same)
    • No redirect_uri needed for this flow

Notes:

  • Access tokens expire after 1 hour (3600 seconds)
  • Always store refresh_tokens securely - they are long-lived credentials
  • If a refresh_token becomes compromised, obtain a new authorization code through the /authorize flow
object
client_id
string

Your client ID. Required unless you send it with HTTP Basic authentication.

client_secret
string

Your client secret. Required unless you send it with HTTP Basic authentication.

code
string

Required for authorization_code grant

grant_type
required
string · enum
Allowed values: authorization_code refresh_token
redirect_uri
string · uri

Required for authorization_code grant

refresh_token
string

Required for refresh_token grant

Token response

Media typeapplication/json
object
access_token
required
string

The access token string as issued by the authorization server

expires_in
integer
e.g. 3600

Lifetime of the access token in seconds (RECOMMENDED)

refresh_token
string

Token used to obtain new access tokens using the same authorization grant (OPTIONAL)

token_type
required
string · enum

Type of token (RFC 6749 Section 7.1) MUST be “Bearer” as per RFC 6750

Allowed values: Bearer

Was this page helpful?