Payments and account opening in one API.
Take card, bank transfer and USSD payments, check NIN, BVN, passport, CAC and address records, and open customer accounts with KYC tiers modelled on the CBN's. Get sandbox keys in seconds, no sales call needed.
- REST + JSONOne base URL, Bearer keys
- Sandbox → liveSame code, swap the key
- Signed webhooksHMAC-SHA256, automatic retries
Your sandbox keys are ready
Copy these now. For your security we store only a fingerprint and can't show the secret key again.
Account . The quickstart below now uses your key.
Open the business dashboardWhat you can build
Every check goes to the official record holder through Howfar's licensed provider partners.
Payments
A hosted payment page for card (with 3-D Secure), bank transfer and USSD. Refunds, partial refunds and idempotency keys included.
NIN · NIMC
Match a customer's name and date of birth against their National Identification Number record.
BVN · NIBSS
Validate a Bank Verification Number with per-field match scores, without pulling the full record.
Passport · Immigration
Check a Nigerian international passport against the Nigeria Immigration Service record, including expiry.
Address
A field agent visits the address and the result arrives by webhook. You need this for tier 3 accounts.
CAC · business
Confirm a company's name and registration status with its RC number, for onboarding merchants.
About eNaira and NIPOST: the CBN offers no public merchant API for eNaira, and NIPOST has no public address-verification API. Customers pay by card, bank transfer or USSD instead, and addresses are confirmed by field agents. If the CBN opens an eNaira merchant channel, we'll add it as a payment method without changes to your code.
Quickstart
The base URL is https://www.howfar.com.ng/api/v1. Authenticate every request with your secret key as a Bearer token. Keep that key on your server and never put it in a browser or mobile app.
1Create a payment
Amounts are in the smallest currency unit, so ₦45,000 is 4500000 kobo. Sending the same Idempotency-Key twice returns the first payment instead of creating a second one.
curl https://www.howfar.com.ng/api/v1/payment_intents \
-H "Authorization: Bearer sk_test_your_key" \
-H "Idempotency-Key: order-1042" \
-H "Content-Type: application/json" \
-d '{
"amount": 4500000,
"currency": "NGN",
"description": "Air Kola sneakers",
"customer": { "email": "ada@example.com", "name": "Ada Obi" },
"return_url": "https://yourshop.ng/orders/1042"
}'
const res = await fetch("https://www.howfar.com.ng/api/v1/payment_intents", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.HOWFAR_SECRET_KEY}`,
"Idempotency-Key": "order-1042",
"Content-Type": "application/json",
},
body: JSON.stringify({
amount: 4500000, // ₦45,000 in kobo
currency: "NGN",
description: "Air Kola sneakers",
customer: { email: "ada@example.com", name: "Ada Obi" },
return_url: "https://yourshop.ng/orders/1042",
}),
});
const payment = await res.json();
// Redirect your customer to payment.checkout_url
import os, requests
res = requests.post(
"https://www.howfar.com.ng/api/v1/payment_intents",
headers={
"Authorization": f"Bearer {os.environ['HOWFAR_SECRET_KEY']}",
"Idempotency-Key": "order-1042",
},
json={
"amount": 4500000, # ₦45,000 in kobo
"currency": "NGN",
"description": "Air Kola sneakers",
"customer": {"email": "ada@example.com", "name": "Ada Obi"},
"return_url": "https://yourshop.ng/orders/1042",
},
)
payment = res.json()
# Redirect your customer to payment["checkout_url"]
{
"id": "pi_8Hk2mQ...",
"object": "payment_intent",
"status": "requires_payment_method",
"amount": 4500000,
"currency": "NGN",
"checkout_url": "https://www.howfar.com.ng/sandbox-checkout?pi=pi_8Hk2mQ...",
"livemode": false
}
2Send the customer to checkout_url
They pay by card, bank transfer or USSD. Afterwards we send them back to your return_url with ?payment_intent=pi_...&status=succeeded. Don't fulfil an order from that redirect, because anyone can change a URL. Rely on the webhook or fetch the payment from your server instead.
3Confirm it on your server
curl https://www.howfar.com.ng/api/v1/payment_intents/pi_8Hk2mQ... \ -H "Authorization: Bearer sk_test_your_key"
const payment = await fetch(`https://www.howfar.com.ng/api/v1/payment_intents/${id}`, {
headers: { Authorization: `Bearer ${process.env.HOWFAR_SECRET_KEY}` },
}).then((r) => r.json());
if (payment.status === "succeeded") fulfilOrder(payment.metadata.order_id);
payment = requests.get(
f"https://www.howfar.com.ng/api/v1/payment_intents/{payment_id}",
headers={"Authorization": f"Bearer {os.environ['HOWFAR_SECRET_KEY']}"},
).json()
if payment["status"] == "succeeded":
fulfil_order(payment["metadata"]["order_id"])
Account opening and KYC
Create a customer, then run identity checks against them. Each successful check can raise the customer's KYC tier, and every result also arrives as a webhook.
Howfar's tiers are modelled on the CBN's three-tier KYC framework. Your own transaction and balance limits per tier are set by your compliance team.
# 1. Create the customer
curl https://www.howfar.com.ng/api/v1/customers \
-H "Authorization: Bearer sk_test_your_key" \
-H "Content-Type: application/json" \
-d '{ "first_name": "John", "last_name": "Musa",
"date_of_birth": "1982-01-01", "phone": "08012345678" }'
# 2. Verify their NIN (names and date of birth come from the customer)
curl https://www.howfar.com.ng/api/v1/verifications \
-H "Authorization: Bearer sk_test_your_key" \
-H "Content-Type: application/json" \
-d '{ "type": "nin", "customer": "cus_...", "nin": "70123456789" }'
const howfar = (path, body) =>
fetch(`https://www.howfar.com.ng/api/v1${path}`, {
method: "POST",
headers: { Authorization: `Bearer ${process.env.HOWFAR_SECRET_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify(body),
}).then((r) => r.json());
const customer = await howfar("/customers", {
first_name: "John", last_name: "Musa", date_of_birth: "1982-01-01", phone: "08012345678",
});
const check = await howfar("/verifications", { type: "nin", customer: customer.id, nin: "70123456789" });
// check.status: "verified" | "mismatch" | "not_found"
def howfar(path, body):
return requests.post(
f"https://www.howfar.com.ng/api/v1{path}",
headers={"Authorization": f"Bearer {os.environ['HOWFAR_SECRET_KEY']}"},
json=body,
).json()
customer = howfar("/customers", {"first_name": "John", "last_name": "Musa",
"date_of_birth": "1982-01-01", "phone": "08012345678"})
check = howfar("/verifications", {"type": "nin", "customer": customer["id"], "nin": "70123456789"})
# check["status"]: "verified" | "mismatch" | "not_found"
{
"id": "ver_Qd81...",
"object": "verification",
"type": "nin",
"status": "verified",
"id_number": "*******6789",
"source": "NIMC",
"match": { "first_name": true, "last_name": true, "date_of_birth": true }
}
| type | Record source | Required fields | Result |
|---|---|---|---|
nin | NIMC | nin | Instant |
bvn | NIBSS | bvn, first_name, last_name | Instant |
passport | Nigeria Immigration Service | passport_number, last_name | Instant |
address | Field agent visit | first_name, last_name, phone, street, lga, state | Starts as pending, finishes by webhook |
cac | Corporate Affairs Commission | rc_number, company_type | Instant |
When you pass customer, any name, date of birth or phone you leave out comes from that customer. We keep only the match results and the basic record fields. Photos and phone numbers from government records are never stored or returned.
Webhooks
Set your endpoint once with POST /v1/account and {"webhook_url": "https://..."}. Every event is signed with your webhook signing secret. If your endpoint doesn't answer with a 2xx status, we retry with backoff for about two days.
payment_intent.succeeded | The customer paid the full amount. |
payment_intent.failed | The payment was declined or the amount didn't match. |
refund.created | A refund was sent to the provider. |
verification.verified · .mismatch · .not_found · .pending · .failed | An identity check finished or changed state. |
customer.kyc_tier_updated | A customer moved to a new KYC tier. |
import crypto from "node:crypto";
// Express: app.post("/webhooks/howfar", express.raw({ type: "application/json" }), handler)
function verifyHowfar(rawBody, header, secret) {
const { t, v1 } = Object.fromEntries(header.split(",").map((p) => p.split("=")));
const expected = crypto.createHmac("sha256", secret).update(`${t}.${rawBody}`).digest("hex");
const fresh = Math.abs(Date.now() / 1000 - Number(t)) < 300;
return fresh && crypto.timingSafeEqual(Buffer.from(v1), Buffer.from(expected));
}
const ok = verifyHowfar(req.body, req.get("Howfar-Signature"), process.env.HOWFAR_WEBHOOK_SECRET);
import hmac, hashlib, time
def verify_howfar(raw_body: bytes, header: str, secret: str) -> bool:
parts = dict(p.split("=", 1) for p in header.split(","))
expected = hmac.new(secret.encode(), f"{parts['t']}.".encode() + raw_body, hashlib.sha256).hexdigest()
fresh = abs(time.time() - int(parts["t"])) < 300
return fresh and hmac.compare_digest(parts["v1"], expected)
# Send a signed test event to your webhook_url curl -X POST https://www.howfar.com.ng/api/v1/webhooks/test \ -H "Authorization: Bearer sk_test_your_key"
API reference
| Payments | |
|---|---|
POST/v1/payment_intents | Create a payment and get its checkout_url. Fields: amount, currency, customer.email, plus optional customer.name, description, return_url and metadata. |
GET/v1/payment_intents/:id | Get the latest status of a payment. |
GET/v1/payment_intents | List recent payments. Optional ?status= and ?limit= (up to 100). |
POST/v1/payment_intents/:id/cancel | Cancel a payment the customer hasn't paid yet. |
POST/v1/refunds | Refund a payment in full or in part: payment_intent, optional amount. |
| Account opening | |
POST/v1/customers | Create a customer: first_name, last_name, optional middle_name, date_of_birth, email, phone and metadata. |
GET/v1/customers/:id | Get a customer with their KYC tier and every check run on them. |
GET/v1/customers | List customers. |
POST/v1/verifications | Run an identity check. Pass a type and its required fields, plus an optional customer. |
GET/v1/verifications/:id | Get a check. For a pending address check, this also fetches the latest status. |
| Your account | |
GET/v1/account | Your business details, live access status and the mode of the key you used. |
POST/v1/account | Update webhook_url or business_name. |
POST/v1/account/keys | Roll a key: send {"mode": "test"} or {"mode": "live"} to get a new key. The old key for that mode stops working immediately. |
GET/v1/account/webhook_secret | Get your webhook signing secret. |
POST/v1/account/go_live | Apply for live access with your business details (see Go live). |
| Events | |
GET/v1/events | Recent webhook events and their delivery status. |
POST/v1/events/:id/resend | Send an event again. |
POST/v1/webhooks/test | Send a signed ping event to your endpoint. |
Test data
With a sk_test_ key, nothing is charged and no real records are looked up. Test responses include "livemode": false, and identity checks answered by Howfar's built-in simulator are also marked "simulated": true. Use these values:
| NIN | 70123456789, which returns John Doe Musa, born 1982-01-01 |
| BVN | 22222222222 with first_name John and last_name Musa |
| Passport | A00400000 with last_name Musa |
| CAC | 1261103 or 14320749 with company_type COMPANY |
| Address | Any address. The check starts as pending and is marked verified about 30 seconds later. |
| Any other number | Returns not_found, so you can test that path too. |
| Payments | The test payment page has a button to pay and another to simulate a declined payment. If it shows Flutterwave's test page instead, use card 5531 8866 5214 2950, CVV 564, expiry 09/32, PIN 3310 and OTP 12345. |
Errors
Errors use standard HTTP status codes and come back in the same format every time:
{ "error": { "code": "parameter_missing", "message": "customer.email is required.", "param": "customer.email" } }
400 | Something in the request is missing or invalid. param names the field. |
401 / 403 | The key is missing, wrong or has been rolled, or live access isn't enabled yet. |
404 | The object doesn't exist, or it belongs to the other mode (test or live). |
409 | The action doesn't fit the object's current state, for example refunding an unpaid payment. |
429 | Too many requests. Wait a moment and retry. |
502 / 503 | A provider or government record source isn't responding. It's safe to retry, and with an Idempotency-Key you'll never create a duplicate payment. |
Go live
- Build and test in sandbox with your
sk_test_key. - Submit your business details with your test key.
curl https://www.howfar.com.ng/api/v1/account/go_live \ -H "Authorization: Bearer sk_test_your_key" \ -H "Content-Type: application/json" \ -d '{ "rc_number": "RC1234567", "company_type": "COMPANY", "director_name": "Ada Obi", "website": "https://yourshop.ng" }' - We check your CAC record and review your application within 2 working days, then email you.
- Create your live key with
POST /v1/account/keysand{"mode": "live"}, then swap it into your server. Your code doesn't change.
Questions? Email support@howfar.com.ng.