Aurax PayAurax Pay Docs
Payments

Collect Payment

Initiate a mobile money collection from a customer. A push prompt is sent to their phone and they approve the payment.

POST
https://api.auraxpay.net/v1/payments
Requires payments.create permission
⚠️Minimum amount: 1,000 TZS. Requests below this are rejected by the mobile money network with a 400 Not Acceptable error. There is no sandbox — real money moves on every transaction.

Request body

ParameterTypeRequiredDescription
amountintegerrequiredAmount in TZS. Minimum 1,000. Maximum 10,000,000.
channelstringrequiredPayment channel: MPESA, AIRTEL_MONEY, TIGO_PESA, HALOPESA, CARD_VISA, CARD_MASTERCARD
buyerPhonestringrequiredCustomer phone in E.164 format. Must match the selected channel network. E.g. +255712345678
buyerNamestringrequiredFull name of the customer. 1–100 characters.
buyerEmailstringoptionalCustomer email address. Used for receipts.
descriptionstringoptionalShort description of what was purchased. Max 500 characters.
idempotencyKeystringoptionalUnique key to prevent duplicate charges. Max 64 chars. Recommended for retries.
metadataobjectoptionalKey-value pairs (string → string) attached to the transaction object. Returned as-is.

Example request

curl -X POST https://api.auraxpay.net/v1/payments \
  -H "Content-Type: application/json" \
  -H "x-api-key: axp_live_YOUR_KEY" \
  -d '{
    "amount": 25000,
    "channel": "MPESA",
    "buyerPhone": "+255712345678",
    "buyerName": "Amina Hassan",
    "buyerEmail": "amina@example.com",
    "description": "Subscription - Pro Plan",
    "idempotencyKey": "order_9f2a1b3c",
    "metadata": {
      "orderId": "ORD-1042",
      "userId": "usr_abc123"
    }
  }'

Response

Returns 201 Created on success with the transaction object at PENDING status.

Response 201
{
  "success": true,
  "transaction": {
    "id": "txn_01j2k3m4n5p6q7r8s9t0",
    "reference": "AXP-SXSZF5H6",
    "type": "COLLECTION",
    "amount": 25000,
    "fee": 0,
    "netAmount": 25000,
    "channel": "MPESA",
    "status": "PENDING",
    "buyerPhone": "+255712345678",
    "buyerName": "Amina Hassan",
    "buyerEmail": "amina@example.com",
    "description": "Subscription - Pro Plan",
    "metadata": {
      "orderId": "ORD-1042",
      "userId": "usr_abc123"
    },
    "createdAt": "2025-06-09T14: 30: 00.000Z",
    "updatedAt": "2025-06-09T14: 30: 00.000Z"
  }
}
💡The transaction starts as PENDING. Listen for the payment.completed webhook to confirm funds received — do not fulfill orders based on PENDING status alone.

Idempotency

Pass idempotencyKey with a unique value per payment attempt. If you retry the same request with the same key within 24 hours, Aurax Pay returns the original transaction instead of creating a duplicate charge.

Use your own order ID or a UUID as the idempotency key.

Phone number format

All phone numbers must be in E.164 format with the Tanzania country code:

NetworkExampleChannel value
Vodacom (M-Pesa)+255712345678MPESA
Tigo (Tigo Pesa)+255652345678TIGO_PESA
Airtel+255682345678AIRTEL_MONEY
Halotel+255622345678HALOPESA

Common errors

StatusMessageFix
400Not AcceptableAmount is below 1,000 TZS minimum, or phone number does not match the channel network
400Validation failedMissing required field or invalid phone format — must be E.164 (+255XXXXXXXXX)
401Invalid API keyKey not found or revoked — generate a new one from the dashboard
409ConflictidempotencyKey reused with different parameters