Skip to main content

Overview

The Access Bank Wallet-as-a-Service (WaaS) API uses Bearer token authentication to secure all API requests.

Before making any API calls, you must first obtain an access token by authenticating with your client credentials. This token must be included in the Authorization header of all subsequent requests.


Authentication Flow


Merchant Credentials

Each merchant is issued unique credentials upon onboarding:

CredentialDescriptionUsage
Merchant IDUnique identifier for your organizationSent in request body
Authorization KeySecret key for authenticationSent in request header
Security Notice

Never expose your Authorization Key in client-side code, public repositories, or logs. Store it securely using environment variables or secret management systems.


Obtaining an Access Token

Endpoint

POST /waas/Client/authenticate

Request Headers

KeyValueRequired
AuthorizationYour client-specific secret keyYes
Ocp-Apim-Subscription-KeyYour access subscription keyYes
Content-Typeapplication/jsonYes

Request Body

FieldTypeRequiredDescription
merchantIdstringYesYour unique merchant identifier

Example Request

curl -X POST https://api-sandbox.accessbankplc.com/waas/Client/authenticate \
-H "Authorization: YOUR_AUTHORIZATION_KEY" \
-H "Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY" \
-H "Content-Type: application/json" \
-d '{
"merchantId": "YOUR_MERCHANT_ID"
}'

Response

Success Response

{
"succeeded": true,
"code": "200",
"message": "Authentication successful",
"data": {
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"expiresIn": 120
},
"pageMeta": {},
"errors": {}
}

Response Fields

FieldTypeDescription
accessTokenstringBearer token to use for API requests
expiresInintegerToken validity duration in seconds (typically 120 = 2 minutes)

Using the Access Token

Once you have obtained an access token, include it in the Authorization header of all API requests:

Authorization: Bearer <accessToken>

Example Authenticated Request

curl -X POST https://api-sandbox.accessbankplc.com/waas/Onboarding/loadWallet \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \
-H "Content-Type: application/json" \
-d '{
"amount": 50000.00
}'

Token Expiration & Renewal

Expiration Handling

Tokens are time-bound and will expire after the duration specified in expiresIn (typically 2 minutes).

When a token expires, API requests will fail with:

{
"succeeded": false,
"code": "401",
"message": "Unauthorized",
"data": {},
"pageMeta": {},
"errors": {}
}

Common Authentication Errors

CodeMessageCauseSolution
401UnauthorizedInvalid or missing Authorization KeyVerify your Authorization Key is correct
401UnauthorizedToken expiredRe-authenticate to obtain a new token
400Bad RequestMissing or invalid merchantIdEnsure merchantId is provided and correct
403ForbiddenClient account suspendedContact Access Bank support

Security Recommendations

  1. Never hardcode credentials - Use environment variables or secure vaults
  2. Use HTTPS only - All requests must use TLS 1.2 or higher
  3. Implement token caching - Avoid unnecessary authentication requests
  4. Monitor for suspicious activity - Log all authentication attempts
  5. Restrict access - Limit who can access your credentials
Production Checklist

Before going live:

  • ✅ Credentials stored securely (not in code)
  • ✅ Token refresh logic implemented
  • ✅ Error handling for 401 responses
  • ✅ Logging and monitoring in place
  • ✅ Production credentials obtained (not sandbox)