Make your first payout
Add test money, add a recipient, get a quote and send a payout in the sandbox.
The steps below use the sandbox. Sandbox access comes with the Enterprise plan.
Keys → test money → recipient → quote → payout → webhook. All calls below go to the sandbox.
Get a token
Create a sandbox API key in Developers → API keys, then:
curl -X POST https://api.sandbox.storspay.com/v1/oauth/token \
-u "$STORSPAY_CLIENT_ID:$STORSPAY_CLIENT_SECRET" \
-d grant_type=client_credentials
Keep the accessToken and send it as Authorization: Bearer <accessToken>. See Authentication.
Add test money
curl -X POST https://api.sandbox.storspay.com/v1/sandbox/deposits \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ "amount": "500.00", "currency": "USD" }'
Amounts are always strings. See Money and amounts.
Add a recipient (beneficiary)
Find the bank code with GET /v1/banks?country=NGA, and the exact fields with GET /v1/payouts/requirements?country=NGA¤cy=NGN&route=bank. The account number 9900000000 ends in 00, so the sandbox pays it.
curl -X POST https://api.sandbox.storspay.com/v1/beneficiaries \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"type": "individual",
"name": "Test Recipient",
"country": "NGA",
"currency": "NGN",
"route": "bank",
"bankCode": "<bankCode from GET /v1/banks>",
"accountNumber": "9900000000"
}'
The same details sent twice return the existing beneficiary (200, deduplicated: true).
Get a quote
curl -X POST https://api.sandbox.storspay.com/v1/quotes \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"intent": "payout",
"sourceCurrency": "USD",
"destinationCurrency": "NGN",
"amount": "100.00",
"amountType": "send",
"country": "NGA",
"route": "bank",
"beneficiaryId": "ben_…"
}'
The quote holds the amounts, the rate, our fee, any platform fee, the total and expiresAt. A payout quote lasts 5 minutes and is used once. You never send a rate or a fee.
Send the payout
curl -X POST https://api.sandbox.storspay.com/v1/payouts \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ "quoteId": "qt_…", "beneficiaryId": "ben_…", "clientRef": "payout-0001" }'
{ "id": "po_8F2K1M3QZ", "clientRef": "payout-0001", "status": "created", "cancellable": true, "legs": 1 }
clientRef is your own unique reference. On a timeout or a 5xx, retry with the same clientRef: you will never pay twice. See Idempotency.
Follow the status
GET /v1/payouts/{id}, or receive payout.created, payout.processing and payout.paid on your webhook endpoint. See Webhooks and Payout statuses.
Try a failure
Change the last two digits of the account number: 9900000001 fails with technical_error, 9900000002 fails with recipient_details, 9900000005 waits 60 s in created so you can cancel it. All values: Sandbox and magic values.