Quick Start
Get started in minutes
This guide walks you through initiating your first payment collection from start to finish.
No sandbox environment: Aurax Pay currently operates in live mode only. Real money moves on every transaction. Use the minimum amount (1,000 TZS) when testing and use a phone number you control.
- 1Get your API keyLog in to your Aurax Pay dashboard, go to API Keys, and generate a new key. Choose TEST for development. Your key will look like
axp_test_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx. - 2Initiate a paymentSend a
POST /v1/paymentsrequest with the customer's details.curl -X POST https://api.auraxpay.net/v1/payments \ -H "Content-Type: application/json" \ -H "x-api-key: axp_test_YOUR_KEY_HERE" \ -d '{ "amount": 5000, "channel": "MPESA", "buyerPhone": "+255712345678", "buyerName": "John Doe", "description": "Order #1042" }'
- 3Read the responseA successful request returns
201 Createdwith the transaction atPENDINGstatus.Response 201{ "success": true, "transaction": { "id": "txn_01j2k3m4n5p6q7r8s9t0", "reference": "AXP-XXXXXX", "amount": 5000, "fee": 0, "netAmount": 5000, "channel": "MPESA", "status": "PENDING", "buyerPhone": "+255712345678", "buyerName": "John Doe", "description": "Order #1042", "createdAt": "2025-06-09T14: 30: 00.000Z" } } - 4Register your webhook & handle completionPayment processing is asynchronous. Register your endpoint via the API — the APIs & Secrets page in your dashboard also lets you do this with one click.Register webhook endpoint
curl -X POST https://api.auraxpay.net/merchant/webhooks \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_JWT_TOKEN" \ -d '{ "url": "https://yourserver.com/webhooks/aurax", "events": ["payment.completed", "payment.failed"] }'
The response returns asecret(whsec_...) shown only once. Copy it immediately and store asAURAXPAY_WEBHOOK_SECRET. Use it to verify every incoming request.Also implement polling as a fallback — callGET /v1/payments/{reference}every 3 seconds untilstatusisCOMPLETEDorFAILED. Webhooks typically arrive within 30 seconds but polling ensures you never miss a completion.Webhook payload (COMPLETED){ "event": "payment.completed", "transaction": { "id": "txn_01j2k3m4n5p6q7r8s9t0", "reference": "AXP-XXXXXX", "status": "COMPLETED", "amount": 5000, "netAmount": 5000, "channel": "MPESA", "completedAt": "2025-06-09T14: 30: 45.000Z" } } - 5Go liveWhen you're ready to accept real payments:
- Generate a
LIVEAPI key from your dashboard - Replace
axp_test_with youraxp_live_key in your environment config - Confirm your webhook URL is publicly reachable
- Process a small real transaction to verify end-to-end
- Generate a
Never commit API keys to source code. Store them in environment variables (
AURAX_API_KEY) and keep live keys out of client-side code.