entity.
entity depends on the endpoint.
- Object
- Array
- Scalar
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.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
Set explicit timeouts
Set explicit timeouts
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 only what is retryable
Retry only what is retryable
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.Be idempotent on your side
Be idempotent on your side
Record the
transaction_id and key your ledger on it, so a retry or a repeated webhook cannot credit a customer twice.Log carefully
Log carefully
Log the endpoint, status code and response time. Do not log request or response bodies — they contain names, BVNs, phone numbers and account details.
Never surface raw errors to your users
Never surface raw errors to your users
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.