Start building

Your first payment.

Create a sandbox key, send one request, and confirm a simulated mobile money collection.

1. Get your sandbox key

Sign in to the NuePay dashboard. Create a named key for your application, select Sandbox Key, validate your transactional PIN, then copy the np_test_ secret.

API key access currently requires an active, approved business account with API access enabled. Your secret stays on your server.

Set up your environment
export NUEPAY_TEST_KEY="YOUR_SANDBOX_SECRET"
# Generate once per payment. Save this UUID before sending.
export PAYMENT_UUID="$(node -e 'console.log(crypto.randomUUID())')"

2. Create a collection

Here, 500.00 is the wallet credit, not the total phone charge. Fees are added. Always send amounts as decimal strings.

Create a collection
curl https://api.nuepay.net/v1/collections \
  -H "Authorization: Bearer $NUEPAY_TEST_KEY" \
  -H "Idempotency-Key: $PAYMENT_UUID" \
  -H 'Content-Type: application/json' \
  -d '{
    "amount": "500.00",
    "currency": "UGX",
    "phone": "0772000000",
    "merchant_reference": "order-123"
  }'

3. Confirm the simulated outcome

Copy data.reference from the creation response and use it below. This endpoint accepts test keys only.

Simulate success
curl https://api.nuepay.net/v1/sandbox/transactions/YOUR_REFERENCE/simulate \
  -H "Authorization: Bearer $NUEPAY_TEST_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"outcome":"success"}'

The payment now reports success, and its principal credits your simulated wallet exactly once. No phone prompt, real wallet movement or Yo request occurs.

Then test the rest of the journey

Try failed and timeout, configure a webhook receiver, and use quotes to show the correct charge. The authenticated sandbox playground can run these requests for you.

If you import Postman, set secret_key to your test secret, choose a UUID for idempotency_key, and copy the response reference to reference.

Made for builders. Built in Uganda.NuePay API v1

Search endpoints, guides and examples.