Rechargely API
Integrate airtime, data bundles, electricity, and bill payments into your application. Explore our REST API with interactive examples.
https://rechargely.online/api/wallet/v1Authentication
Create API credentials under Developers in the portal. Exchange them using HTTP Basic authentication at /authenticate/api-key. For catalog and payment requests, include Authorization: Bearer <accessToken>, X-Channel-Id: API, and X-Portal-Id: AGENT_PORTAL. Tokens expire after 15 minutes and have no refresh token; exchange credentials again after expiry. Keep API secrets on your backend. Token exchange examples run server-side.
Payment Integration Flow
Use one unique requestId throughout each payment. A successful pre-auth validates the bill; authorization moves funds. Authorization results include COMPLETED, PROCESSING, FAILED or REFUNDED. Check your float at any time with GET /partner/wallet/balances. Partner tokens support the wallet balance, catalog and payment endpoints listed below; other portal endpoints are outside this scope.
Authentication
/authenticate/api-key Basic AuthExchange API Credentials
Create API credentials in the portal Developers tab. Send the API key as the HTTP Basic username and the API secret as the password from your backend. The bearer token lasts 15 minutes (900 seconds) and has no refresh token. In Postman, choose Authorization > Basic Auth and Body > x-www-form-urlencoded.
Required Headers
- Authorization
- Basic <base64(api-key:api-secret)>
- Content-Type
- application/x-www-form-urlencoded
- X-Channel-Id
- API
- X-Portal-Id
- AGENT_PORTAL
Form Fields (x-www-form-urlencoded)
grant_typestringrequiredMust be client_credentials.
scopestringrequiredMust be bill-payment:write.
Response Fields
accessTokenstringUse as Authorization: Bearer <accessToken> for the remaining integration steps.
tokenTypestringBearer.
expiresInnumberToken lifetime in seconds (900). Exchange credentials again after expiry.
scopestringGranted scope: bill-payment:write.
curl -i -X POST 'https://rechargely.online/api/wallet/v1/authenticate/api-key' \
-u '<api-key>:<api-secret>' \
-H 'X-Channel-Id: API' \
-H 'X-Portal-Id: AGENT_PORTAL' \
-H 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=client_credentials' \
--data-urlencode 'scope=bill-payment:write'Example Response (HTTP 200)
{
"accessToken": "eyJhbGciOiJIUzI1NiIs...",
"tokenType": "Bearer",
"expiresIn": 900,
"scope": "bill-payment:write"
}Wallet
/partner/wallet/balances Bearer AuthCheck Wallet Balances
Return the balance of each wallet (USD and ZWG) belonging to the Agent or Merchant that owns the API key; no account number is sent. Check it before a payment to confirm you have enough float. When Rechargely has set a minimum float for your account, minimumFloat and belowMinimumFloat show it. Falling below the minimum only triggers a notice to you; payments still go through until the wallet itself runs out.
Required Headers
- X-Channel-Id
- API
- X-Portal-Id
- AGENT_PORTAL
- Authorization
- Bearer <partner-token>
Response Fields
currencystringWallet currency, USD or ZWG.
accountNumberstringYour wallet account number.
statusstringnullableACTIVE, or why the wallet cannot be used right now.
balancenumbernullableAvailable balance. Null when it could not be read just now (never reported as a false zero); retry shortly.
minimumFloatnumbernullableMinimum float Rechargely asks you to keep in this wallet. Null when none is set.
belowMinimumFloatbooleannullableTrue when balance is under minimumFloat. Advisory only: top up soon, payments are not blocked. Null when either value is unknown.
curl -i -X GET 'https://rechargely.online/api/wallet/v1/partner/wallet/balances' \
-H 'X-Channel-Id: API' \
-H 'X-Portal-Id: AGENT_PORTAL' \
-H 'Authorization: Bearer <partner-token>'Example Response (HTTP 200)
[
{
"currency": "USD",
"accountNumber": "100000012345",
"status": "ACTIVE",
"balance": 82.5,
"minimumFloat": 100,
"belowMinimumFloat": true
},
{
"currency": "ZWG",
"accountNumber": "100100012345",
"status": "ACTIVE",
"balance": 15400,
"minimumFloat": null,
"belowMinimumFloat": null
}
]Products
/public/products/product/all Bearer AuthFetch Products
Fetch the active product catalog and use the selected numeric id as productId in pre-auth. Send the partner bearer token and API headers even though the path contains /public/.
Required Headers
- X-Channel-Id
- API
- X-Portal-Id
- AGENT_PORTAL
- Authorization
- Bearer <partner-token>
Response Fields
idnumberNumeric product identifier to send as productId.
namestringInternal product name.
descriptionstringProduct description.
refNamestringBill reference label.
billFormatstringExpected bill reference format.
categorystringProduct category.
statusstringProduct availability status.
billerNamestringBiller or service provider.
currencystringProduct currency, e.g. USD or ZWG.
productPricenumberCatalog price for fixed-price products.
productNamestringProduct display name.
providerCodestringProvider identifier.
pricingTypestringFIXED uses catalog pricing; VARIABLE requires an amount in pre-auth.
productLogoUrlstringnullableProduct logo URL.
minAmountnumbernullableMinimum allowed amount.
maxAmountnumbernullableMaximum allowed amount.
queryCustomerInfobooleanWhether the product supports customer information lookup.
discountPercentagenumbernullableProduct discount percentage, when available.
curl -i -X GET 'https://rechargely.online/api/wallet/v1/public/products/product/all' \
-H 'X-Channel-Id: API' \
-H 'X-Portal-Id: AGENT_PORTAL' \
-H 'Authorization: Bearer <partner-token>'Example Response (HTTP 200)
[
{
"id": 42,
"name": "econet_airtime",
"description": "Econet Airtime",
"refName": "Mobile Number",
"billFormat": "07XXXXXXXX",
"category": "Airtime",
"status": "ACTIVE",
"billerName": "Econet Wireless",
"currency": "USD",
"productPrice": 0,
"productName": "Econet Airtime",
"providerCode": "ECONET",
"pricingType": "VARIABLE",
"productLogoUrl": null,
"minAmount": 0.5,
"maxAmount": 500,
"queryCustomerInfo": false,
"discountPercentage": 0
}
]Transactions
/transactions/bill-payment/pre-auth Bearer AuthValidate the Bill (Pre-Auth)
Validate the reference and amount before funds move. Generate a unique requestId for each intended payment and keep it for authorization. Proceed only when responseCode is "00"; a preAuthToken can also be present on a failed response.
Required Headers
- X-Channel-Id
- API
- X-Portal-Id
- AGENT_PORTAL
- Authorization
- Bearer <partner-token>
- Content-Type
- application/json
Request Body (JSON)
amountnumberRequired for VARIABLE pricing. FIXED pricing uses the catalog price, add-ons and number of months. Respect the product currency and amount limits.
productIdnumberrequiredNumeric id from the product catalog; replace the example with your selected product.
requestIdstringrequiredClient-generated unique payment identifier. Reuse it only for the same payment lifecycle.
billReferencestringrequiredCustomer reference in the format required by the product, e.g. a mobile or meter number.
customerMobilestringCustomer mobile number.
additionalDataobjectProduct-specific string values using supported keys, e.g. {"NO_OF_MONTHS":"1"} or {"ADDONS":"code1|code2"}. Omit when unused.
Response Fields
responseCodestringTwo-character ISO 8583 code, preserved as a string (e.g. "00", "51", "68"). See Response codes below.
responseMessagestringHuman-readable result; use responseCode for program logic.
requestIdstringYour payment request identifier, echoed for reconciliation.
productNamestringnullableProduct name, when available.
additionalDataobjectnullableProduct-specific result data, such as CUSTOMER_NAME, TOKEN or KWH. Keys and values depend on the biller.
commissionAmountnumbernullableQuoted or earned commission, when applicable.
commissionStatusstringnullableCommission state, when available; pre-auth can return QUOTED or NOT_APPLICABLE.
preAuthTokenstringnullableSend with the same requestId to authorize, only after a "00" pre-auth result. Pre-auth does not return a status field.
curl -i -X POST 'https://rechargely.online/api/wallet/v1/transactions/bill-payment/pre-auth' \
-H 'X-Channel-Id: API' \
-H 'X-Portal-Id: AGENT_PORTAL' \
-H 'Authorization: Bearer <partner-token>' \
-H 'Content-Type: application/json' \
-d '{
"amount": 25,
"productId": 42,
"requestId": "YOUR-UNIQUE-REF-001",
"billReference": "0772000000",
"customerMobile": "0772000000"
}'Example Response (HTTP 200)
{
"responseCode": "00",
"responseMessage": "Preauth Successful",
"preAuthToken": "preauth_abc123",
"requestId": "YOUR-UNIQUE-REF-001",
"productName": "Econet Airtime",
"additionalData": {},
"commissionAmount": 0,
"commissionStatus": "NOT_APPLICABLE"
}Response codes and error handling
Bill-payment results use a two-character ISO 8583 responseCode and a matching HTTP status. Preserve leading zeroes and parse the body on non-2xx responses too. HTTP status 200 is distinct from payment code "00". Pre-auth and authorization failures retain their endpoint response fields; unavailable values can be null.
Example: HTTP 422, insufficient funds
{
"responseCode": "51",
"responseMessage": "Insufficient wallet balance",
"requestId": "YOUR-UNIQUE-REF-001",
"preAuthToken": null,
"productName": null,
"additionalData": {},
"commissionAmount": null,
"commissionStatus": null
}| responseCode | HTTP status | Meaning |
|---|---|---|
| 00 | 200 | Approved or completed successfully |
| 03 | 500 | Invalid merchant or biller configuration |
| 05 | 422 | Transaction declined |
| 06 | 502 | Transaction processing error |
| 12 | 422 | Invalid transaction |
| 13 | 422 | Invalid amount |
| 14 | 422 | Invalid bill reference |
| 25 | 404 | Transaction record not found |
| 30 | 400 | Request format is invalid |
| 46 | 422 | Account is closed |
| 51 | 422 | Insufficient funds |
| 57 | 422 | Transaction not permitted to account holder |
| 58 | 403 | Transaction not permitted to channel |
| 61 | 422 | Transaction amount limit exceeded |
| 63 | 403 | Security violation |
| 65 | 422 | Transaction frequency limit exceeded |
| 68 | 504 | Pre-auth: response received too late |
| 68 | 202 | Authorization: outcome pending reconciliation; not a completed payment |
| 76 | 422 | Invalid or unavailable account |
| 79 | 422 | Transaction reversed; the wallet debit was reversed (REFUNDED) |
| 84 | 410 | Pre-authorization has expired |
| 84 | 409 | Invalid authorization lifecycle |
| 91 | 503 | Biller or processing switch is unavailable |
| 92 | 502 | Unable to route transaction |
| 94 | 409 | Duplicate transaction |
| 96 | 500 | System malfunction |
Pending outcomes, reversals and retries
Authorization can return HTTP 202 with responseCode: "68" and status: "PROCESSING". This outcome is awaiting reconciliation. Code "68" during pre-auth instead maps to HTTP 504. Code "79" / HTTP 422 with REFUNDED means the wallet debit was reversed. Code "84" distinguishes an expired pre-auth (410) from an invalid authorization lifecycle (409).
{
"responseCode": "68",
"responseMessage": "Transaction outcome is pending reconciliation",
"transactionReferenceNumber": "TXN-2026-00001234",
"status": "PROCESSING",
"requestId": "YOUR-UNIQUE-REF-001",
"additionalData": {}
}Retain every response, requestId, preAuthToken and transactionReferenceNumber. Repeated authorization of an already completed payment can return the existing "00" result; a reversed payment returns "79" and an in-progress payment returns "68". Do not generate a new requestId to retry an uncertain authorization. Contact support before retrying when the outcome is unknown, including network timeouts. A single partner payment cannot yet be queried by requestId, and self-service outbound webhook registration is not available.
Authentication and request errors
Token exchange rejects invalid credentials, scope, grant type or channel/portal values with HTTP 401:
{
"error": "invalid_client",
"errorDescription": "Invalid API credentials"
}HTTP 401 also covers invalid or expired partner tokens and inactive credentials. HTTP 403 can indicate an endpoint outside the partner scope or a portal mismatch. Missing required headers or form fields and malformed JSON can return HTTP 400. Authentication filters and framework-level errors may use a different body from bill-payment results; do not assume every error contains responseCode.
Rechargely API v1 · Need help? Contact support