Authentication
The v2 API supports two authentication flows. Call your own Vantr account from a trusted server with client credentials, or let other merchants connect their accounts to your app with the OAuth authorization code flow.Choose an auth method
- Basic auth
- Client headers
- Bearer token
Use HTTP Basic auth with the client ID as the username and the client secret as the password.
Token request
Useapplication/x-www-form-urlencoded for OAuth token calls.
string
required
Use
client_credentials, authorization_code, or refresh_token.string
Space-separated scopes. Required for
client_credentials and authorization_code; optional on refresh when you want to narrow the refreshed access token.string
Authorization code returned from
/oauth/authorize. Required for authorization_code.string
PKCE verifier that matches the original
code_challenge. Required for authorization_code.string
required
Opaque bearer token to pass in the
Authorization header.integer
required
Lifetime in seconds for the access token.
string
required
Space-separated scopes granted to the token.
string
Returned for the
authorization_code grant (unless disabled on the app). Refresh tokens rotate: each refresh revokes the one you used and returns a new one. The client_credentials grant does not issue refresh tokens — just request a new access token. See Authorize a user (OAuth).Token lifecycle
Issue
Use
/oauth/token for client credentials, authorization code, and refresh token grants.Inspect
Use
/oauth/introspect to check token activity and metadata.Revoke
Use
/oauth/revoke to remove access immediately.Common failures
401 from OAuth token endpoints
401 from OAuth token endpoints
Check that the request uses HTTP Basic auth with the client ID and client secret. Also verify that the application secret has not been rotated.
403 from v2 endpoints
403 from v2 endpoints
The credential is valid, but the application or token does not include a scope accepted by that endpoint. Check the endpoint reference and update the application scope set.
invalid_scope from /oauth/token
invalid_scope from /oauth/token
Request only scopes that are enabled on the developer application. Use a space-separated scope string, not commas.
FAQ
Which method should I use first?
Which method should I use first?
Start with Basic auth for server-to-server integrations. Move to bearer tokens when your system needs OAuth grant handling or short-lived access tokens.
Can I use client secrets in frontend code?
Can I use client secrets in frontend code?
No. Client secrets must stay in trusted server environments.
Where are scope requirements listed?
Where are scope requirements listed?
Every endpoint in the API reference declares its required scope. The scopes guide lists the full starter set.