Finfort BNPL Engine Developers Swagger UI ↗

Get started

Offer your customers "buy now, pay later" without building eligibility, repayment scheduling or settlement yourself. You call one API; FinFort funds the purchase, collects the instalments and pays you.

How it works#

  1. A customer chooses to pay later at your checkout (or on a page we host).
  2. You check eligibility and quote the payment windows — nothing is charged yet.
  3. The customer picks a window and accepts the terms. You start a plan: the downpayment is charged to their mobile money, and FinFort advances you the full price.
  4. As each instalment falls due you charge it (or let the customer pay). We tell you what happens with signed webhooks.
  5. If the purchase is cancelled, you refund it and the customer's remaining payments stop.

Before you start#

FinFort creates your merchant account and gives you an API key. It is shown once: store it like a password. If you lose it, ask us to issue a new one (old keys can be revoked instantly). You will also need:

  • a webhook URL on your server that can receive events (see Webhooks);
  • the base URL of the environment you are using. This guide writes it as $BNPL_URL; the sandbox is where you start.

Authentication#

Send your key as a bearer token on every request:

curl "$BNPL_URL/v1/quotes" \
  -H "Authorization: Bearer $BNPL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"amount": 2400000, "currency": "UGX"}'

A missing, wrong or revoked key — or a suspended merchant account — gets 401.

Keep the key on your server. It can start and refund plans for your customers. Never put it in a web page, mobile app or anywhere a customer can read it. To take a payment from a customer's own device, use hosted checkout.

The JavaScript SDK#

If you use Node 20+ the SDK does the plumbing: typed requests, retries where they are safe, declines as a typed error, and webhook verification.

import { Bnpl } from '@finfort/bnpl-sdk';

const bnpl = new Bnpl({ apiKey: process.env.BNPL_API_KEY!, baseUrl: process.env.BNPL_URL! });
const quote = await bnpl.quotes.create({ amount: 2_400_000, currency: 'UGX' });

The SDK ships in the Finfort BNPL Engine repository (sdk/). Everything it does is plain HTTPS and JSON, so any language works — the examples here show both.

Conventions#

Money Whole numbers in the currency's smallest unit. UGX has no decimals, so 2400000 is UGX 2,400,000. Currencies are 3-letter uppercase codes (UGX). Never send floats.
Dates ISO 8601 strings in UTC.
IDs Plans, customers and installments have UUIDs. You identify your own things with references you choose: merchantReference for a purchase, externalRef for a customer.
Phone numbers Mobile-money numbers in any common form (+256 700 123 456, 0700123456). We normalise them, and recognise the same person across merchants by their number.
Rate limit 120 requests per minute per IP. Over it you get 429; retry after a short pause.

Errors#

Every error has the same shape:

{ "error": { "statusCode": 422, "message": "Transaction is not eligible for BNPL", "decision": "DECLINED", "reasons": ["over_customer_limit"] } }
Status Meaning
400 The request is invalid. message says what — often a list, one entry per field. Fix and resend.
401 The API key is missing, wrong, revoked, or the merchant is suspended.
404 That plan, customer or endpoint does not exist (or is not yours).
409 A conflict. On a charge it means a payment for that installment is already in progress.
422 A decline. BNPL is not being offered for this customer or amount: read reasons (see Eligibility). Show the customer another way to pay.
429 Too many requests.
5xx Our side. Safe to retry reads, and creates that are idempotent (below).

Idempotency: retrying safely#

Networks fail. You can always repeat a request that may or may not have arrived, without charging a customer twice:

  • Starting a plan is idempotent on your merchantReference. Send the same reference again and you get the original plan back — no second charge. Use a fresh reference for a genuinely new purchase.
  • You may also send an Idempotency-Key header on POST /v1/transactions; a repeated key returns the original plan even if the reference changed.
  • Charging an installment that is already paid returns it unchanged.
  • A full refund repeated does nothing more. A partial refund requires an Idempotency-Key, because repeating it would cut the plan twice.

What next#

Follow the money from first quote to last instalment: Eligibility & quotes → Transactions & installments → Webhooks. Want us to host the customer's side? See Hosted checkout. How and when you get paid: Settlement economics.