Infinity Africa

Examples

cURL Examples

Copy-pasteable requests for every core flow. Swap in your own API key, merchant ID, and a fresh Idempotency-Key (a UUID) per attempt.

Create a payment link

bash
curl -X POST https://api.infinityafrica.net/v1/payment-links \
  -H "X-API-Key: $INFINITY_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "merchant_id": "5c1f0b2a-3e21-4b9a-9c33-2f6a1d0e8b71",
    "amount": "25000.00",
    "currency": "TZS",
    "description": "Web design deposit"
  }'

Push an STK collection

bash
curl -X POST https://api.infinityafrica.net/v1/collections/stk-push \
  -H "X-API-Key: $INFINITY_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "merchant_id": "5c1f0b2a-3e21-4b9a-9c33-2f6a1d0e8b71",
    "amount": "25000.00",
    "customer_phone": "+255712345678",
    "merchant_reference": "ORDER-4821"
  }'

Create and send an invoice

bash
curl -X POST https://api.infinityafrica.net/v1/invoices \
  -H "X-API-Key: $INFINITY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "merchant_id": "5c1f0b2a-3e21-4b9a-9c33-2f6a1d0e8b71",
    "customer_name": "Juma Traders Ltd",
    "customer_phone": "+255712445310",
    "due_date": "2026-09-01",
    "items": [
      { "description": "Wholesale delivery", "quantity": "1", "unit_price": "320000.00" }
    ]
  }'

# Grab "id" from the response, then:
curl -X POST https://api.infinityafrica.net/v1/invoices/INVOICE_ID/send \
  -H "X-API-Key: $INFINITY_API_KEY"

curl -X POST https://api.infinityafrica.net/v1/invoices/INVOICE_ID/payment-link \
  -H "X-API-Key: $INFINITY_API_KEY"

Request a disbursement

bash
curl -X POST https://api.infinityafrica.net/v1/disbursements/selcom-pesa \
  -H "X-API-Key: $INFINITY_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "merchant_id": "5c1f0b2a-3e21-4b9a-9c33-2f6a1d0e8b71",
    "amount": "150000.00",
    "destination_name": "Selcom Pesa Wallet",
    "destination_identifier": "+255712345678"
  }'

List recent transactions

bash
curl "https://api.infinityafrica.net/v1/merchants/5c1f0b2a-3e21-4b9a-9c33-2f6a1d0e8b71/transactions?page=1&page_size=20" \
  -H "X-API-Key: $INFINITY_API_KEY"