The Precium API uses OAuth 2.0 Client Credentials Flow for authentication.
All API requests must include a valid Bearer token in the Authorization header. Tokens are obtained by making a POST request to the authentication endpoint with your client credentials.
HTML
POST /oauth2/token HTTP/1.1
Host: dev-payce.auth.eu-west-1.amazoncognito.com
Content-Type: application/x-www-form-urlencoded
Authorization: Basic BASE64_ENCODED_CREDENTIALS
grant_type=client_credentials
BASH
curl -X POST https://dev-payce.auth.eu-west-1.amazoncognito.com/oauth2/token \
-H "Content-Type: application/x-www-form-urlencoded" \
-u "YOUR_CLIENT_ID:YOUR_CLIENT_SECRET" \
-d "grant_type=client_credentials"
JSON
{
"access_token": "eyJraWQiOiJYMHJhS...",
"expires_in": 86400,
"token_type": "Bearer"
}
Include the token in the Authorization header for all API requests:
GET /v2/merchantprofile/ HTTP/1.1
Host: dev.api.revio.co.za
Authorization: Bearer eyJraWQiOiJYMHJhS...
Content-Type: application/json
BASH
curl -X GET https://dev.api.revio.co.za/v2/merchantprofile/ \
-H "Authorization: Bearer eyJraWQiOiJYMHJhS..." \
-H "Content-Type: application/json"
Access tokens expire every 24 hours. Implement token refresh logic in your application:
JSX
// Pseudocode example
function getValidToken() {
if (token && !isExpired(token)) {
return token;
}
return refreshToken();
}
If your token is invalid or expired, the API will return:
JSON
{
"statusCode": 401,
"message": "Unauthorized"
}
When you receive a 401 response, request a new access token before retrying the request.
To request sandbox credentials, contact the Precium support team at support@precium.com
Your sandbox credentials will include:
client_id (username)client_secret (password)
Production credentials are provided after go-live. Contact your Precium account manager to initiate the onboarding process.
After authentication, use the following base URLs:
Verify your token is working by calling the merchant profile endpoint:
BASH
curl -X GET https://dev.api.revio.co.za/v2/merchantprofile/ \
-H "Authorization: Bearer YOUR_TOKEN"
A successful response confirms your authentication is configured correctly.