Skip to main content

Test mode

A test key (afx_test_…) lets you build and try every flow without touching live data or your quota. Create one on your dashboard, or call POST /v2/me/test-key with your live key. It's shown once; creating a new one replaces the old one.

What changes in test mode​

Live keyTest key
QuotaYour plan's daily limit1,000 test calls a day, separate from your quota
DataYour live trips, records and webhooksKept apart: test calls see only test data
Texts to recipientsSentNever sent (sms shows test_mode)
WebhooksDeliveredDelivered to the webhooks you set up with the test key, with "livemode": false
KYC verificationReal checksFixed results (below)
Codes, routing, searchReal resultsReal results

Your test key has the same plan as your live account, so the same features are available.

KYC test values​

POST /v2/kyc/verify in test mode picks its result from customer_id, runs no fraud checks and saves nothing:

customer_idResult
test_fraud403: blocked by the fraud check
test_reviewverified: false, confidence low
anything elseverified: true, confidence high

Use method gps_fix, manual or hex_code. gps_code isn't simulated yet and returns a validation error. Test verification IDs start with test_.

curl -X POST "https://api.afrihex.com/v2/kyc/verify" \
-H "X-API-Key: $AFRIHEX_TEST_KEY" -H "Content-Type: application/json" \
-d '{"customer_id":"test_review","method":"gps_fix","location":{"lat":5.6037,"lng":-0.187}}'

Going live​

Swap the test key for your live key. Nothing else changes: same endpoints, same request and response shapes. Webhooks you set up with the test key stay in test mode, so set up your live webhooks with your live key.