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 key | Test key | |
|---|---|---|
| Quota | Your plan's daily limit | 1,000 test calls a day, separate from your quota |
| Data | Your live trips, records and webhooks | Kept apart: test calls see only test data |
| Texts to recipients | Sent | Never sent (sms shows test_mode) |
| Webhooks | Delivered | Delivered to the webhooks you set up with the test key, with "livemode": false |
| KYC verification | Real checks | Fixed results (below) |
| Codes, routing, search | Real results | Real 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_id | Result |
|---|---|
test_fraud | 403: blocked by the fraud check |
test_review | verified: false, confidence low |
| anything else | verified: 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.