Authentication
To access the Payments Platform APIs, you must authenticate using a Bearer Token obtained via the OIDC Client Credentials Flow.
Prerequisites
Before proceeding, ensure you have the following credentials. These are available in the merchant dashboard under Merchant Details:
client_id– your unique client identifierclient_secret– your secret used to authenticate the client
Step 1: Obtain Access Token
Make a POST request to the Token Endpoint using the credentials mentioned above.
Example cURL
curl -X POST https://uat-auth.morefin.com/realms/uat/protocol/openid-connect/token \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "client_id=your-client-id" \
-d "client_secret=your-client-secret" \
-d "grant_type=client_credentials"
Example response:
{
"access_token": "eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiWkt0ekUz....",
"expires_in": 299,
"refresh_expires_in": 0,
"token_type": "Bearer",
"not-before-policy": 1747140771,
"scope": "roles selectors email profile"
}
Step 2: Use the access token
Once you have obtained the token, include it in the Authorization header of all your requests to the Payments Platform:
Authorization: Bearer <access_token>
Cache the token and use the response’s expires_in value to determine its lifetime. Obtain a new token shortly before it expires; do not hard-code a fixed token duration. Client credentials tokens do not use an interactive refresh flow.