Aurax PayAurax Pay Docs

Collect Payment

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

POSThttps://api.auraxpay.net/v1/paymentsRequires payments.create permission

Request body

ParameterTypeRequiredDescription
amountintegerrequiredAmount in TZS. Minimum 500, maximum 10,000,000.
channelstringrequiredPayment channel. One of: 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. Optional, 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) you want to attach. Returned as-is on the transaction object.

Example request

cURL
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"
    }
  }'
Node.js
const res = await fetch("token-string">'https:"token-comment">//api.auraxpay.net/v1/payments', {
  method: "token-string">'POST',
  headers: {
    "token-string">'Content-Type': "token-string">'application/json',
    "token-string">'x-api-key': process.env.AURAX_API_KEY,
  },
  body: JSON.stringify({
    amount: 25000,
    channel: "token-string">'MPESA',
    buyerPhone: "token-string">'+255712345678',
    buyerName: "token-string">'Amina Hassan',
    description: "token-string">'Subscription - Pro Plan',
    idempotencyKey: "token-string">'order_9f2a1b3c',
    metadata: { orderId: "token-string">'ORD-1042' },
  }),
})

const { transaction } = await res.json()

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 Tanzania country code:

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