Authentication
To access the Hubpay Connect API, clients must first request authentication credentials, which include a clientId
and clientSecret
. These credentials will be securely issued to you as part of the onboarding process.
Once you receive your credentials, you must use them to obtain a Bearer access token by calling the authentication endpoint. This token must then be included in the Authorization
header of each API request.
🔑 Step 1: Obtain a Bearer Token
Make a POST
request to the authentication endpoint using your clientId
and clientSecret
:
curl -X POST https://api.hubpay.ae/auth/token \
-H "Content-Type: application/json" \
-d '{
"clientId": "YOUR_CLIENT_ID",
"clientSecret": "YOUR_CLIENT_SECRET"
}'
If the credentials are valid, you'll receive a response like:
{
"access_token": "eyJraWQiOiJ...",
"expires_in": 3600,
"token_type": "Bearer"
}
🔐 Step 2: Use the Bearer Token in API Requests
Include the access_token
in the Authorization
header for all subsequent API calls:
curl -i -X GET \
'https://api.hubpay.ae/v1/webhooks' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN_HERE'
❗️ Replace
YOUR_ACCESS_TOKEN_HERE
with the actual token received from the/auth/token
endpoint.
📌 Notes
- Access tokens are short-lived and will expire (default: 1 hour).
- When expired, you must re-authenticate using your
clientId
andclientSecret
. - Keep your credentials safe — treat them like passwords.