Token Based Authentication
To meet PCI DSS authentication and access control standards, Su has implemented Token-Based Authentication for all API access. This mechanism replaces static credential usage with short-lived access tokens, reducing credential exposure and improving overall security posture.
UPDATE NOTICE
We have launched a new Token-based Authentication mechanism, which is active on Production.
Generate Access Token
This endpoint is used to generate an access token required for authenticating.
Endpoint
GET
Header
client-id
string
Yes
Base64-encoded domain name
client-secret
string
Yes
Client secret key
Note on Generating Access Token:
The
client-idremains the same for both Sandbox and Production environments.The
client-secretdiffers between the Sandbox and Production accounts.Access tokens generated for the Sandbox environment are prefixed with
"sandbox_".Access tokens generated for the Production environment are prefixed with
"live_".Tokens for Sandbox and Production are distinct and cannot be used interchangeably.
Success Response - For Production
Success Response - For Sandbox
Response Body Parameters
Status string
Indicates Success whether the token generation was successful.
Data object
Contains the access token details.
token_type string
Type of token. Always Bearer.
token string
The actual access token to be used in the Authorization header.
expire_in string
Token expiry duration in seconds.
Message string
Message indicating the result of the token generation request.
Use the Generated Access Token for each API Request
All API requests must include the generated access token in the Authorization header.
Header
When making authenticated API calls, generated Access Token must be provided using the Authorization header in the format below:
The <access_token> varies depending on whether you're working with the Production or Sandbox environment.
Notes:
The
Authorizationheader must use theBearerprefix (For example,Bearer <token>), notBasic.Access tokens are different for each environment (sandbox and production).
If the token is invalid or expired, the API will respond with an “Authorization Required” error.
Access Tokens are valid for 60 minutes and must be regenerated after expiration
A maximum of 30 tokens can be generated simultaneously within a 60-minute window
1. Production Environment Token
Access Tokens prefixed with
live_are specific to the production environment.These tokens are valid only for production API endpoints.
Example:
2. Sandbox Environment Token
Access Tokens prefixed with
sandbox_are specific to the sandbox/test environment.These cannot be used with production endpoints.
Example:
Last updated
Was this helpful?