Getting started
VantPay Merchant API
Open virtual accounts for your customers, take payments by transfer, card or USSD, hold balances in customer wallets, get notified when money lands, and pay out to any Nigerian bank account.
Every request and response is JSON over HTTPS. Every code sample on this page uses the sandbox base URL below.
Base URL
| Environment | Base URL |
|---|---|
| Sandbox | https://merchantapi-dev.vantpay.io |
Response envelope
Every response carries the same four fields. code "00" means success; anything else is a failure code you can branch on. Read isSuccessful and code in the body, not only the HTTP status.
List endpoints put a page inside data: currentPage, pageSize, totalRecords, totalPages and the rows in data.
Getting started
Authentication
VantPay gives you a Client ID and Client Secret at onboarding. Exchange them for an access token with Authenticate, then send the token on every call:
Authorization: Bearer <access_token>
Tokens are short lived. Cache one and refresh it about a minute before expires_in runs out, instead of requesting a new token for each call. Five failed attempts in fifteen minutes lock the Client ID for fifteen minutes.
Machine tokens
Endpoints marked Machine token only accept a token from your Client ID and Secret. A token issued to a dashboard user is refused there with 403, so server to server integrations should always use the client credentials token.
Keep the Client Secret on your server. It is never sent in a request; it only signs requests and gets tokens.
Getting started
Signing requests
Endpoints marked Signed move money or handle card data, so they also prove the body came from you. Send three headers with the bearer token:
| Header | Value |
|---|---|
| X-Timestamp | Current time as Unix seconds, UTC. Must be within 300 seconds of server time. |
| X-Signature-Version | 2 |
| X-Signature | Lowercase hex HMAC SHA256 of the string to sign, keyed with your Client Secret. |
The string to sign is the method, path, timestamp and raw body joined by new lines:
METHOD\npath\nX-Timestamp\nrawBody
Rules that matter
Sign the exact bytes you send. Serialise the body once, sign that string and send that same string; pretty printing or reordering keys afterwards breaks the signature.
Each signed request is accepted once. On a retry, sign again with a fresh timestamp and keep the same business reference.
Failures return 401 with code 26 and a message such as Invalid request signature or Request timestamp outside the allowed window.
Getting started
Errors
Business and validation failures return HTTP 400 with isSuccessful: false and a code. Each endpoint lists the codes it can return; these are the common ones.
| HTTP | Meaning |
|---|---|
| 400 | Business or validation failure. Read code and message. |
| 401 | Token missing or expired, or the signature is wrong. |
| 403 | A dashboard user token was sent to a machine token endpoint. |
| 404 | Wallet (63), card (66) or card charge (69) not found. |
| 406 | Code 20. Unexpected error; safe to retry with the same Idempotency-Key. |
| 409 | Idempotency-Key reused with a different body, or still in progress. |
| 429 | Rate limit reached. Wait for the number of seconds in Retry-After. |
Common codes
| Code | Meaning |
|---|---|
| 00 | Success |
| 20 | Server error, try again |
| 21 | Temporary failure, retry |
| 26 | Invalid request; the message names the field |
| 60 | Wallet feature not enabled for your merchant |
| 61 | Wallet not active |
| 62 | Insufficient wallet balance |
| 63 | Wallet not found |
| 64, 65 | Wallet or card limit reached |
| 66 to 70 | Card not found, not active, linked elsewhere, charge not found, declined |
Getting started
Retries and limits
Creating a virtual account and storing a card take an Idempotency-Key header. A retry with the same key does not act twice. The same key with a different body returns 409.
Payouts, wallet withdrawals, wallet transfers and card charges use your own reference in the body as the idempotency key, so they need no header. Reuse the same reference on every retry of the same action, so a network timeout can never cause a double payment.
Rate limits
| Lane | Limit per minute |
|---|---|
| Authenticate | 10 per IP |
| Money movement (payouts, withdrawals, transfers, charges) | 30 |
| Wallet reads | 120 |
| Hosted checkout (payer side) | 30 per IP |
| Everything else | 300 |
