rano API · v1 Test mode
Payments APIfor South Africa.
Cards, PayShap and EFT through one REST API. Every payment comes back with its fee itemised and what it leaves you.
curl https://api.rano.co.za/v1/payments \
-H "Authorization: Bearer $RANO_SECRET_KEY" \
-H "Idempotency-Key: order-2048" \
-H "Content-Type: application/json" \
-d '{
"amount": 38600,
"currency": "ZAR",
"payment_method_type": "card",
"confirm": true
}'import { Rano } from "@rano/sdk";
const rano = new Rano(process.env.RANO_SECRET_KEY);
const payment = await rano.payments.create(
{
amount: 38600, // R386.00, in cents
currency: "ZAR",
payment_method_type: "card",
confirm: true,
},
{ idempotencyKey: "order-2048" },
);
payment.fee.total; // 795
payment.net; // 37805const res = await fetch("https://api.rano.co.za/v1/payments", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.RANO_SECRET_KEY}`,
"Idempotency-Key": "order-2048",
"Content-Type": "application/json",
},
body: JSON.stringify({
amount: 38600, // R386.00, in cents
currency: "ZAR",
payment_method_type: "card",
confirm: true,
}),
});
const payment = await res.json();The response
The fee is part of the payment. Line by line, with the net beside it.
This is the response to the request above, exactly as the API returns it in test mode. Point at a line of the receipt to find it in the JSON.
R386.00
- Card issuer (interchange)R2.24
- Card schemeR0.58
- Acquiring bankR0.77
- ranoR4.36
- of which VATR0.57
- FeeR7.95
- You receiveR378.05
- Three cost lines say who else is paid. One line is ours.
- VAT is split out of our margin, never added on top:
margin_excl_vatplusvatismargin. netis the amount less the fee, in cents.
{ "id": "pay_01m4jerva1f3qtnq99e4rgtnxb", "object": "payment", "amount": 38600, "currency": "ZAR", "status": "succeeded", "payment_method_type": "card", "description": null, "metadata": {}, "amount_refunded": 0, "fee": { "vat": 57, "costs": 359, "lines": [ { "code": "interchange", "kind": "cost", "label": "Card issuer (interchange)", "amount": 224 }, { "code": "scheme", "kind": "cost", "label": "Card scheme", "amount": 58 }, { "code": "acquirer", "kind": "cost", "label": "Acquiring bank", "amount": 77 }, { "code": "rano", "kind": "margin", "label": "rano", "amount": 436 } ], "total": 795, "margin": 436, "currency": "ZAR", "price_plan": "plan_01m4jerv7kfvb9g5zydb3ye81a", "margin_excl_vat": 379 }, "net": 37805, "next_action": null, "last_error": null, "cancellation_reason": null, "livemode": false, "created": 1791620836}
Start building
Everything you need. One request away.
Test keys run against a full copy of rano with simulated banks, so you can build the whole integration before going live.
Test mode
The last two digits of the amount in cents pick the outcome. Any other amount: cards succeed, PayShap and EFT wait for the customer, and test helpers approve or decline for them.
..01 | Declined | requires_payment_method · insufficient_funds |
..02 | Declined | requires_payment_method · do_not_honour |
..05 | Times out, then succeeds | processing → succeeded |
..06 | Times out, then is declined | processing → requires_payment_method |
..07 | Never reaches the bank | processing → requires_payment_method |
..08 | Card needs 3D Secure | requires_action |
Documentation
Quick start, endpoints, fees, webhooks, test mode and errors.
OpenAPI spec
Every endpoint and parameter in one OpenAPI 3.0 file, for code generators and API clients.
GET /openapi.jsonSigned webhooks
Eight event types, delivered at least once and retried for about three days.
Rano-Signature: t=1791620836,v1=5c8e0f…TypeScript SDK
Typed methods, webhook verification, idempotency keys and automatic retries, for Node.js.
import { Rano } from "@rano/sdk"Checking
Asking the API how it's doing.
Conventions
Four rules. No surprises.
38600Amounts in cents
Every amount is a whole number in the currency's minor unit. R386.00 is 38600.
Idempotency-KeySafe retries
Send a POST again with the same key and you get the first response back, never a second payment. The SDK sets one on every POST.
error.codeErrors you can act on
Every error has a type, a code and a plain message, and param names the field at fault.
request-idTraceable
Every response carries a request-id header, and rano-version says which version of the API answered.
Get your test keys. Build today.
Leave your email and we'll send sandbox keys to early-access developers as we onboard them.