Finfort BNPL Engine Developers Swagger UI ↗

Transactions & installments

A transaction is one BNPL plan: one purchase, one customer, a schedule of installments. You start it, charge each installment as it falls due, and refund or cancel it if the purchase changes.

Start a plan#

POST /v1/transactions — creates the plan and charges the downpayment to the customer's mobile money. Only call it once the customer has chosen a window and accepted the terms. Send the customer's national ID as customer.nationalId if they are not verified yet (it is checked in the same call). Each installment may include interest (interestDue) as well as principal, if FinFort prices your windows with interest; the quote shows it. FinFort collects every payment on a plan, the downpayment included, by asking the customer on their own phone; there is no way to report a payment taken elsewhere, and cash is never accepted.

{
  "merchantReference": "order_1001",
  "customer": { "externalRef": "user_42", "fullName": "Amara Okonkwo", "phone": "0700123456", "email": "amara@example.com" },
  "principalAmount": 2400000,
  "currency": "UGX",
  "paymentWindowDays": 30,
  "upfrontAmount": 1000000,
  "merchantEligible": true,
  "termsAccepted": true,
  "metadata": { "bookingId": "b_77" }
}
Field
merchantReference Your unique id for this purchase. Retrying with the same value returns the same plan instead of charging again.
customer or customerId The customer's details (created, or updated if externalRef exists), or the id of one you created earlier.
paymentWindowDays One of the windows in your quote. Any other value is a 400.
upfrontAmount Optional: the upfront amount the customer chose, as in the quote (at least minimumUpfront). Too little is a 422 (upfront_below_minimum) and nothing is created or charged.
termsAccepted Must be exactly true. We never coerce it from a string.
metadata Anything you want back later (not shown to the customer).

The response is the plan with all its installments. Read status, not the HTTP status:

status Meaning
ACTIVE The downpayment was charged and we have advanced you the price. Installments 2+ are scheduled.
FAILED The downpayment could not be charged (e.g. insufficient balance). The request still returns 201. Nothing was advanced; ask the customer to try again with a new merchantReference.
PENDING_DOWNPAYMENT Only when payments run through a provider that asks the customer to approve on their phone (MTN MoMo). The request is still 201; the plan becomes ACTIVE or FAILED once the customer answers (we also ask MTN directly if its callback is late), and you get downpayment.settled or downpayment.failed. Don't treat it as failed, and don't create a second plan for the same order. The sandbox answers instantly, so you won't see this there unless FinFort has switched it to MoMo.

If the customer or amount isn't eligible you get a 422 decline instead — no plan is created (see Eligibility).

Two more 422s create nothing and are not about the customer:

  • exceeds_payment_channel_limit (with maxAmount): the plan would need one payment — the upfront payment, an installment, or FinFort's payout to you — bigger than a single mobile-money transaction can carry. A larger upfrontAmount or a smaller price fixes it; the quote marks such windows available: false.
  • finfort_funds_insufficient: FinFort cannot finance it right now; try again later.

The customer's phone number is locked while they owe. Changing the phone of a customer (same externalRef) who has a plan that is not finished — waiting for the downpayment, running, or cancelled for non-payment — is a 409 code: "phone_locked", whether through POST /v1/customers or a new plan. If a customer really has a new number, ask FinFort to change it.

Plan statuses#

Status
PENDING_DOWNPAYMENT Created, downpayment not yet taken (transient).
ACTIVE Running.
COMPLETED Every installment paid.
CANCELLED Cancelled before the downpayment, or by us after an installment went more than 3 days overdue (where your agreement keeps the debt collectable: the customer still owes it).
FAILED The downpayment failed.
REFUNDED Reversed by a full refund.
FORFEITED The customer defaulted on goods you were holding back until full payment (your agreement says so). You get transaction.forfeited: void the booking and return the advance to FinFort (merchantOwes); FinFort refunds the customer what they paid less the agreed forfeit. The customer is not chased.

Every running plan has paymentLinkUrl: FinFort's own page where the customer pays any amount towards it. Payments through it are always asked of the customer's registered MoMo number. FinFort texts the customer the link before each due date, and (if FinFort has switched it on) asks them to pay on the due date itself. You can show the link in your app too; you get the usual repayment.succeeded / installment.paid webhooks whoever started the payment.

If FinFort uses late fees, a late installment's amountDue grows by its lateFeeDue (you get installment.late_fee_charged), and the plan ends only if it is still unpaid some days after its last installment was due. Otherwise a plan ends 3 days after a missed installment.

Read plans#

  • GET /v1/transactions/{id} — one plan, with installments (and any refunds).
  • GET /v1/transactions?merchantReference=…&customerId=…&status=… — your plans, newest first.
  • GET /v1/transactions/{id}/installments and …/installments/{sequence}.

An installment has sequence (1 is the downpayment), type, amountDue, dueDate, status (PENDING, PAID, FAILED — only for a downpayment that couldn't be taken —, OVERDUE, CANCELLED) and paidAt.

The plan also carries financedBalance (price − upfront), outstandingBalance (what the customer still owes), feeSplit (gross, finfortShare, merchantShare), closedAt, and disbursements — your payouts for it (see Settlement). Each installment has amountPaid, which is less than amountDue while it is part-paid.

Take a repayment of any amount#

POST /v1/transactions/{id}/repayments with an Idempotency-Key header (required) — charges the customer any amount from 1 up to outstandingBalance towards the plan, for "pay what you like" or "clear my balance" screens.

{ "amount": 150000 }
  • It returns the repayment. With MTN MoMo it is usually PENDING while the customer approves on their phone; then SUCCEEDED or FAILED (you also get repayment.succeeded / repayment.failed). GET /v1/transactions/{id}/repayments/{repaymentId} asks MTN if it is still pending, so polling it every few seconds shows the outcome promptly.
  • Nothing changes until the payment is confirmed. Then it is applied to the unpaid installments, earliest due first; one may be left part-paid. allocations says how, outstandingAfter what is left. The plan completes on the repayment that clears it.
  • The same key returns the same repayment — never a second charge. Generate one key per customer action and reuse it on retries. Reusing a key with a different amount is a 422 (idempotency_key_reused).
  • One repayment (or installment charge) per plan at a time: another while one is pending is a 409. More than is owed is a 422 (amount_exceeds_outstanding); a repaid plan is 422 (plan_fully_repaid). More than one mobile-money payment can carry is a 422 (exceeds_payment_channel_limit, with maxAmount): split it into several repayments.
  • A plan cancelled for non-payment still takes repayments (the customer still owes it). When it is paid off in full it stays CANCELLED and we send transaction.debt_settled.
  • GET /v1/transactions/{id}/repayments lists them, newest first.

Close a fully repaid plan#

POST /v1/transactions/{id}/close — once a plan is COMPLETED and you have delivered what it paid for (for example, issued the ticket you held until repayment), close it. Sets closedAt and sends transaction.closed. Closing again changes nothing; a plan that is not fully repaid is a 422 (plan_not_fully_repaid).

Charge an installment#

POST /v1/transactions/{id}/installments/{sequence}/charge — charges installment sequence (2 or later) to the customer's mobile money. Installment 1 is charged for you when the plan starts.

  • It returns the installment. status: "PAID" means success. With MTN MoMo the customer approves on their phone first: you get the installment back still PENDING, then installment.paid or installment.failed shortly after; the plan completes automatically when the last one is paid.
  • Charging an installment that is already paid returns it unchanged.
  • 409 means a payment for it is already in progress — wait and re-read it; don't retry blindly.
  • A charge can fail (for instance, insufficient balance). The installment stays PENDING — the response still shows status: "PENDING" — and you receive an installment.failed webhook with the reason. Charge it again when the customer is ready.
  • An OVERDUE or CANCELLED installment can't be charged (400). A part-paid one is charged only what is left on it.
  • A free-amount repayment in progress on the plan makes a charge wait (409).

You decide when to charge: typically when the installment is due, or when the customer chooses to pay early or pay several at once (charge them in order). We send an installment.reminder.due webhook 2 days before each due date so you can remind the customer.

If a customer doesn't pay#

There is a 3-day grace period after each due date. If an installment is still unpaid after it, we cancel the plan (transaction.cancelled with reason installment_overdue_past_grace_period). The customer's debt stays with FinFort's collections — you keep the money you were advanced — and the customer is blocked from new plans until it is sorted out.

Cancel or refund#

Which one depends on whether money has moved.

Situation Call
The downpayment hasn't been charged yet POST /v1/transactions/{id}/cancel
The purchase is cancelled after the downpayment, before FinFort has paid you POST /v1/transactions/{id}/refund
The purchase is cancelled after FinFort has paid you POST /v1/transactions/{id}/refund — filed for FinFort's approval (202)

Refunds after you have been paid. Once FinFort has paid you for a plan, your refund call is filed for a FinFort manager's approval: it answers 202 with { "status": "PENDING_APPROVAL", "approvalRequestId": … } and nothing changes yet — the customer still owes and the plan keeps running. You get refund.pending_approval; then transaction.refunded (or transaction.partially_refunded) when it is approved, or refund.rejected with the reason. Calling again while it waits returns the same request; asking for a different refund meanwhile is 409 code: "approval_already_pending". Repeating a full refund that already happened returns the refunded plan.

Full refund#

{ "reason": "flight_cancelled_by_airline" }

Everything is reversed: the plan becomes REFUNDED, every unpaid installment is cancelled so the customer is never chased for something they won't receive, and what they paid is returned to them. FinFort funds the refund; you hand back the principal we advanced and the fee is clawed back. We send transaction.refunded. Repeating the call changes nothing.

Partial refund#

The price drops — for example when one of two travellers cancels. Send an amount and an Idempotency-Key header:

curl -X POST "$BNPL_URL/v1/transactions/$ID/refund" \
  -H "Authorization: Bearer $BNPL_API_KEY" -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"reason": "one_traveller_cancelled", "amount": 600000}'
  • The reduction comes off the unpaid installments, spread evenly. Three unpaid installments of 350,000 with a 600,000 refund become three of 150,000. Paid installments are never touched.
  • If the refund is larger than what's still owed, those installments are cancelled and the rest is returned to the customer in cash; if nothing is left to pay, the plan completes.
  • The fee is refunded in proportion (refund 30% of the price, get 30% of the fee back), so two half-refunds cost the customer the same as one full refund.
  • amount must be less than what's left of the price; to refund everything, omit it.
  • Without the idempotency key you get a 400, because repeating a partial refund would cut the plan twice. Re-sending the same key applies it once.

Each refund is recorded on the plan (refunds[]) with what it reduced and what is owed back to the customer. We send transaction.partially_refunded.

Returning money to the customer's wallet is not yet automated: today a refund records what is owed and stops all collection. Your agreement with FinFort describes how the payout is made.