Get started / Quickstart
Quickstart
Create a sandbox payment, complete it with a test card and confirm it succeeded. You need a terminal and about ten minutes.
Before you start
- A Ledgerline account. Sandbox access is available as soon as you sign up.
- Your sandbox secret key, from Dashboard → Developers → API keys.
1. Set your key
Save the key as an environment variable so it stays out of your shell history and your code.
export LEDGERLINE_KEY=sk_test_4f9a...
2. Create a payment
This creates a payment of ₦2,500.00 (250000 kobo) and returns a hosted checkout link.
curl https://sandbox.ledgerline.example/v2/payments \
-H "Authorization: Bearer $LEDGERLINE_KEY" \
-H "Idempotency-Key: 6c1f6a0e-2f7b-4b51-9a7e-0d3c2b7e9f10" \
-H "Content-Type: application/json" \
-d '{
"amount": 250000,
"currency": "NGN",
"reference": "order_1042",
"customer": { "email": "ada@example.com" },
"redirect_url": "https://yourshop.example/thanks"
}'
{
"id": "pay_7Hq2LmX9",
"status": "pending",
"amount": 250000,
"currency": "NGN",
"reference": "order_1042",
"checkout_url": "https://checkout.sandbox.ledgerline.example/pay_7Hq2LmX9",
"created_at": "2026-11-03T10:14:22Z"
}
3. Pay with a test card
Open the checkout_url and pay with one of these test cards. Use any future expiry date and any three-digit CVV.
| Card number | Result |
|---|---|
5060 9900 0000 0001 | Succeeds |
5060 9900 0000 0019 | Declined: insufficient funds |
5060 9900 0000 0027 | Asks for a one-time password. Enter 123456. |
4. Confirm the result
Retrieve the payment to check its status. In production, rely on webhooks instead of polling.
curl https://sandbox.ledgerline.example/v2/payments/pay_7Hq2LmX9 \
-H "Authorization: Bearer $LEDGERLINE_KEY"
The status is now succeeded. That's it: you've taken your first payment.
Customers can close the tab or edit the redirect URL. Mark an order as paid only after you've confirmed the status from the API or a verified webhook.
Next steps
- Set up webhooks so you hear about payments as they happen.
- Read the Payments API reference for every field and status.
- Check Data handling before you go live.
Last updated 3 November 2026