Skip to main content
Pila responses are JSON, and successful ones wrap the payload in a single top-level key: entity.
The shape of entity depends on the endpoint.
Most endpoints return a single record.
Always read your data from entity, never from the root of the response. Endpoints gain fields over time; parsing defensively means a new field never breaks your integration.

Success and failure

The HTTP status code is the authoritative signal.
Do not treat “not a 5xx” as “money moved”. A 200 on a transfer means the instruction was accepted, not that it settled. See Transaction statuses below.

Transaction statuses

Money movement is asynchronous. Transfers, card loads and withdrawals come back before they have completed. Wait for the webhook, or poll Transaction details with the transaction_id you received. Do not assume a PROCESSING transfer succeeded.

Handling responses well

Pila calls out to banks and card processors on your behalf. Use a connect timeout of around 5 seconds and a read timeout of 30 seconds — never an infinite default.
Retry 429 and 5xx responses with exponential backoff, up to three attempts. Never retry a 4xx — the request itself is the problem, and a retried transfer can become a double payment.
Record the transaction_id and key your ledger on it, so a retry or a repeated webhook cannot credit a customer twice.
Log the endpoint, status code and response time. Do not log request or response bodies — they contain names, BVNs, phone numbers and account details.
Map failures to your own messages. Passing a provider’s error text straight through leaks implementation detail and confuses customers.

Amounts and currency

NGN

Wallet and transfer amounts are in naira.

USD

Card amounts are in dollars.
Some endpoints accept an amount as a string and return it as a number. Parse defensively, and store money as a fixed-precision type rather than a float.