Quickstart
A key, a vend, a webhook. Five minutes, no approval call.
Everything below works with a test key. Test mode returns the same envelope, the same statuses and the same webhooks as live, against a sandbox provider, so the integration you write here is the one you ship.
1. Get a key
Create an account and open API keys in the dashboard. A test key starts with rg_test_. It is shown once, so put it straight into your environment.
export ROUTEGATE_API_KEY=rg_test_4k9d2m8v
2. Send a vend
One endpoint, one key, one idempotency key. The amount is an integer in kobo, so a hundred naira is 10000.
curl -X POST https://api.useroutegate.com/api/v1/airtime \
-H "Authorization: Bearer $ROUTEGATE_API_KEY" \
-H "Idempotency-Key: ord-00042-a1" \
-H "Content-Type: application/json" \
-d '{
"network": "mtn",
"destination": "+2348012345678",
"amount_kobo": 100000,
"client_reference": "ord-00042"
}'You get 202 Accepted and a transaction. status is pending until a channel answers.
{
"data": {
"id": "rg_tx_01J8QX4M2K9R7V3N",
"status": "pending",
"network": "mtn",
"destination": "+2348012345678",
"amount_kobo": 100000,
"client_reference": "ord-00042"
}
}3. Take the webhook
Do not poll. The final state arrives at your endpoint, signed, and retries until you take it.
{
"event_id": "evt_01J8QX4P7B2M9C3D",
"type": "transaction.successful",
"data": { "id": "rg_tx_01J8QX4M2K9R7V3N", "status": "successful" }
}Verify Routegate-Signature before you trust it, and treat event_id as the key you deduplicate on. See webhooks.
4. Go live
Swap the key. Nothing else in your code changes.
If any of this took longer than five minutes, tell us which step. That is a bug in these docs, not in you.