LLedgerline DocsAPI v2.4Want docs like this? Talk to Doc Foundry

Get started / Overview

Ledgerline API overview

Ledgerline lets you collect card and bank transfer payments in Nigerian naira and pay out to local bank accounts through one REST API.

Environments

Every account has two environments. They share the same API but use separate keys and separate data.

EnvironmentBase URLUse it for
Sandboxhttps://sandbox.ledgerline.example/v2Building and testing. No real money moves.
Livehttps://api.ledgerline.example/v2Real payments, after your account is approved.

Authentication

Send your secret key as a bearer token on every request. Sandbox keys start with sk_test_ and live keys with sk_live_.

Request headerHTTP
Authorization: Bearer sk_test_4f9a...
Keep secret keys on your server

Never put a secret key in a mobile app, browser code or a public repository. If a key is exposed, roll it from the dashboard straight away; the old key stops working within 60 seconds.

Amounts

All amounts are integers in the currency's minor unit. For naira that is kobo, so ₦2,500.00 is sent as 250000. Sending a decimal returns a 400 with the code amount_invalid.

Idempotency

Network calls fail. To retry safely, send an Idempotency-Key header with any POST. If Ledgerline has already processed a request with that key in the last 24 hours, it returns the original response instead of creating a second payment.

Use one key per operation, not per attempt

Generate the key when your customer clicks Pay, store it with the order and reuse it on every retry. A UUID works well.

Errors

Errors use standard HTTP status codes and always return the same shape, so you can handle them in one place.

Error responseJSON
{
  "error": {
    "type": "invalid_request",
    "code": "amount_invalid",
    "message": "amount must be a whole number of kobo.",
    "param": "amount",
    "request_id": "req_8KxQ2m"
  }
}

Include the request_id when you contact support. It lets us find the exact request in our logs.

Last updated 3 November 2026