Prerequisites

  • Your test API key (see API Keys)
  • curl, Postman, or any HTTP client

1. Health Check

Start with a health check to confirm connectivity:
curl https://api.rohopay.com/health
Expected response:
{"status": "ok", "service": "rohopay-api"}

2. Check Your Wallet Balance

curl https://api.rohopay.com/api/v1/wallet/balance \
  -H "Authorization: Bearer test_YOUR_KEY"
{
  "success": true,
  "data": {
    "balance_live": 0,
    "balance_test": 1000000,
    "currency": "UGX"
  }
}

3. Collect a Test Payment

curl -X POST https://api.rohopay.com/api/v1/collect \
  -H "Authorization: Bearer test_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 00000000-0000-0000-0000-000000000001" \
  -d '{
    "phone": "256700000000",
    "amount": 10000,
    "currency": "UGX",
    "description": "My first test payment"
  }'
{
  "success": true,
  "data": {
    "internal_reference": "RHP-2024-FIRST001",
    "status": "pending",
    "amount": 10000,
    "currency": "UGX",
    "environment": "test"
  }
}

4. Check the Status

Use the internal_reference from step 3:
curl https://api.rohopay.com/api/v1/transactions/RHP-2024-FIRST001 \
  -H "Authorization: Bearer test_YOUR_KEY"
In test mode, the transaction resolves to successful almost immediately.

5. Your First Card Payment

curl -X POST https://api.rohopay.com/api/v1/checkout \
  -H "Content-Type: application/json" \
  -d '{
    "api_key": "test_YOUR_KEY",
    "amount": 25000,
    "currency": "UGX",
    "customer_name": "Test User",
    "customer_email": "test@example.com",
    "return_url": "https://example.com/return",
    "card_number": "4111111111111111",
    "card_expiry": "10/26",
    "card_cvv": "123"
  }'
{
  "success": true,
  "data": {
    "payment_url": "https://payments.rohopay.com/3ds/...",
    "internal_reference": "RHP-2024-CARD001",
    "status": "pending"
  }
}
In production, open payment_url in a browser. In test mode, the 3DS step is simulated.

What’s Next?

Webhooks

Receive real-time events when payments complete.

Error Handling

Handle errors gracefully in production.

Digital Products

Create payment links and sell digital goods.

AI Setup

Use Claude Code for faster integration.