Skip to content

Obtain an access token

POST
/oauth/token
curl --request POST \
--url https://example.com/oauth/token \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data grant_type=client_credentials \
--data client_id=example \
--data client_secret=example \
--data code=example \
--data code_verifier=example \
--data redirect_uri=example \
--data refresh_token=example

RFC 6749 token endpoint. For an integration: grant_type=client_credentials with your merchant credentials (body, or HTTP Basic) — the access token then opens every /api search and refund door for YOUR merchant, for expires_in seconds; re-authenticate when it lapses. The authorization_code/refresh_token grants serve the dashboard’s human login and are not for integrations. Errors speak the RFC’s dialect ({error}), and invalid_grant is deliberately uniform — it never says which hurdle fell.

RFC 6749 — the body travels as application/x-www-form-urlencoded, never JSON.

Media typeapplication/x-www-form-urlencoded

RFC 6749 — the body travels as application/x-www-form-urlencoded, never JSON.

object
grant_type
required

client_credentials is the INTEGRATION grant — your server authenticating as itself. The other two belong to the dashboard’s login flow and are not for integrations.

string
Allowed values: client_credentials authorization_code refresh_token
client_id

Client_credentials: your merchantId — or send both credentials as HTTP Basic (Authorization: Basic base64(merchantId:secret)), both shapes are standard.

string
client_secret

Client_credentials: your merchant secret — body or HTTP Basic.

string
code

Dashboard login flow (authorization_code) only.

string
code_verifier

Dashboard login flow (PKCE) only.

string
redirect_uri

Dashboard login flow only.

string
refresh_token

Dashboard flow (refresh_token grant) only.

string

The token, RFC 6749 §5.1.

Media typeapplication/json
object
access_token
required

The Bearer JWT for the /api surface — send it as Authorization: Bearer ….

string
token_type
required

Always Bearer — present the token as Authorization: Bearer <token>.

string
Allowed value: Bearer
expires_in
required

Seconds of validity. When it lapses, a machine simply re-authenticates: client_credentials issues NO refresh token.

integer
refresh_token

Dashboard flow only — rotating, and the whole family burns on a replay.

string
Example
{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJtMTEiLCJ0eXAiOiJtZXJjaGFudCJ9.9pQ2…",
"token_type": "Bearer",
"expires_in": 3600
}

invalid_request, unsupported_grant_type — or the uniform invalid_grant, which never says which hurdle fell.

Media typeapplication/json
object
error
required

RFC 6749 error code — invalid_client, unsupported_grant_type… Branch on this.

string
error_description

Human-readable detail, when there is one to give.

string
Example
{
"error": "unsupported_grant_type",
"error_description": "grant_type must be client_credentials"
}

invalid_client — unknown or wrong credentials, one answer for both.

Media typeapplication/json
object
error
required

RFC 6749 error code — invalid_client, unsupported_grant_type… Branch on this.

string
error_description

Human-readable detail, when there is one to give.

string
Example
{
"error": "invalid_client",
"error_description": "unknown client or wrong secret"
}