Create Access Token
This API is used to obtain an access token using the Client ID and Client Secret pair provided by SePay to partners. The access token is valid for 6000 seconds (100 minutes).
API Endpoint
POST
https://speaker-api.sepay.vn/devices/v1/token/createAuthentication
This API uses Basic Authentication with the following credentials:
- Username:
client_id(provided upon registration) - Password:
client_secret(provided upon registration)
Note
- Send the request with an empty body (no request body required)
- Token is valid for 6000 seconds (100 minutes)
- Use this token in the
Authorization: Bearer {access_token}header for subsequent API calls
Error Handling
401UnauthorizedInvalid or missing authentication credentials
Code Examples
>
>
>
curl --request POST \--url https://speaker-api.sepay.vn/devices/v1/token/create \--header 'Authorization: Basic REPLACE_BASIC_AUTH'
API Response
Response 201 - Token created successfully
{
"code": 201,
"message": "Resource created",
"data": "—",
"access_token": "eyJhbGciOi...",
"ttl": 6000
}codeinteger
Response status code
messagestring
Execution result description
datastring
Returned data (may be "—" when no data)
access_tokenstring
Access token for other APIs
ttlinteger
Access token time-to-live (seconds)