Finfort BNPL Engine Developers Swagger UI ↗

Webhooks & signing

We tell your server what happens to a plan with signed HTTP callbacks. Webhooks are how you should learn that an installment was paid, a plan completed, or a checkout ended — don't poll.

Register an endpoint#

POST /v1/webhook-endpoints with the URL of your handler:

{ "url": "https://shop.example/webhooks/bnpl", "eventTypes": ["installment.paid", "transaction.completed"] }

eventTypes is the list you want; an empty list means every event. An unknown event name is rejected (a typo would otherwise silently never fire). The response contains the endpoint's secret — store it; you use it to verify signatures. You may supply your own secret (at least 16 characters).

Manage endpoints with GET /v1/webhook-endpoints, PATCH /v1/webhook-endpoints/{id} (change URL, events, or active) and DELETE. POST /v1/webhook-endpoints/{id}/test queues a signed webhook.test event so you can check your handler end to end.

What we send#

Each delivery is a POST with a JSON body:

{
  "eventId": "7f6c…",
  "eventType": "installment.paid",
  "createdAt": "2026-10-16T09:00:00.000Z",
  "data": { "transactionId": "5d2b…", "sequence": 2, "amount": 420000 }
}

and the headers Content-Type: application/json and X-BNPL-Signature.

Events#

Event Sent when data
transaction.created A plan was created transactionId, merchantReference, principalAmount, currency
downpayment.settled The downpayment was charged and the price advanced transactionId, merchantReference, amount, principalAdvanced
downpayment.failed The downpayment couldn't be charged transactionId, merchantReference, failureReason
installment.paid An installment was paid transactionId, sequence, amount
installment.failed An installment charge failed transactionId, sequence, failureReason
installment.reminder.due An installment is due within 2 days transactionId, sequence, amountDue, dueDate
transaction.completed Every installment is paid transactionId, merchantReference
transaction.cancelled Cancelled by you, or by us for non-payment transactionId, merchantReference, reason (merchant_requested or installment_overdue_past_grace_period)
transaction.refunded A full refund transactionId, merchantReference, refundId, reason, amountPaidByCustomer, amountReturnedToCustomer, currency
transaction.partially_refunded A partial refund transactionId, merchantReference, refundId, reason, principalAmount, feeAmount, installmentReduction, amountReturnedToCustomer, currency
repayment.succeeded A free-amount repayment was confirmed and applied repaymentId, transactionId, merchantReference, amount, currency, allocations, unappliedAmount, outstandingBalance, nextDue
repayment.failed A repayment was not completed (nothing was taken) repaymentId, transactionId, merchantReference, amount, failureReason
transaction.closed You closed a fully repaid plan transactionId, merchantReference
refund.pending_approval Your refund of a plan FinFort had already paid you for is waiting for a FinFort manager transactionId, approvalRequestId, amount, reason
refund.rejected FinFort refused (or could not carry out) that refund; nothing changed transactionId, approvalRequestId, amount, reason
installment.late_fee_charged A late fee was added to an overdue installment (when FinFort uses late fees rather than ending plans after 3 days) transactionId, merchantReference, sequence, lateFee, amountDue, currency
transaction.forfeited A customer defaulted on goods you were withholding: void the booking and return merchantOwes to FinFort; FinFort refunds the customer customerRefund transactionId, merchantReference, merchantOwes, customerRefund, currency
transaction.debt_settled A plan cancelled for non-payment has since been paid off in full (it stays CANCELLED) transactionId, merchantReference
disbursement.succeeded A payout to you went through disbursementId, transactionId, merchantReference, kind (FINANCED_BALANCE or UPFRONT_REMITTANCE), amount, currency, providerRef
disbursement.failed A payout failed every automatic attempt (FinFort is on it) as above, plus failureReason, attempts
checkout.completed / .declined / .failed A hosted checkout ended sessionId, merchantReference, transactionId, and reasons for declines
webhook.test You asked for a test event message

Verify the signature#

Always verify. Anyone who knows your URL can post to it; the signature is how you know it's us. The header looks like

X-BNPL-Signature: t=1760605200,v1=5257a869e7ecebeda32affa62cdca3fa51cad7e77a0e56ff536d0ce8e108d8bd

where t is the unix time we signed at and v1 is the hex HMAC-SHA256, keyed with your endpoint secret, of the string "<t>.<raw request body>".

  1. Take the raw request body exactly as received. Re-serialising parsed JSON changes the bytes and breaks the signature.
  2. Compute the HMAC and compare it to v1 in constant time.
  3. Reject if t is more than 5 minutes from your clock — that stops someone replaying a captured webhook.

With the SDK (Node):

import express from 'express';
import { constructWebhookEvent, BnplSignatureError } from '@finfort/bnpl-sdk';

app.post('/webhooks/bnpl', express.raw({ type: 'application/json' }), (req, res) => {
  try {
    const event = constructWebhookEvent(req.body, req.header('x-bnpl-signature'), process.env.BNPL_WEBHOOK_SECRET!);
    // …handle event.eventType / event.data (see "Handling events" below)…
    res.sendStatus(200);
  } catch (err) {
    if (err instanceof BnplSignatureError) return res.sendStatus(400);
    throw err;
  }
});

Python:

import hmac, hashlib, re, time

def verify(raw_body: bytes, header: str, secret: str, tolerance=300) -> bool:
    m = re.fullmatch(r"t=(\d+),v1=([0-9a-f]{64})", header or "")
    if not m or abs(time.time() - int(m[1])) > tolerance:
        return False
    expected = hmac.new(secret.encode(), m[1].encode() + b"." + raw_body, hashlib.sha256).hexdigest()
    return hmac.compare_digest(expected, m[2])

PHP:

function verify(string $raw, ?string $header, string $secret, int $tolerance = 300): bool {
    if (!preg_match('/^t=(\d+),v1=([0-9a-f]{64})$/', $header ?? '', $m)) return false;
    if (abs(time() - (int)$m[1]) > $tolerance) return false;
    return hash_equals(hash_hmac('sha256', $m[1] . '.' . $raw, $secret), $m[2]);
}

Handling events#

  • Respond with any 2xx quickly (we wait up to 10 seconds), then do the work. Anything else — or a timeout — counts as a failure.
  • Events can arrive more than once and out of order. De-duplicate on eventId. When the order matters, don't trust the payload's view of the world: GET /v1/transactions/{id} and act on the plan's current status.
  • Handlers must be idempotent: marking an order paid twice should be harmless.
  • Every plan event carries transactionId (and usually your merchantReference) so you can find your order.

Delivery and retries#

Events are written in the same database transaction as the change they announce, so none is lost even if we crash, and are delivered at least once. Delivery runs about every 30 seconds. A failed delivery is retried with growing delays — 1 min, 5 min, 30 min, 2 h, then every 12 h — up to 10 attempts, after which the event is marked EXHAUSTED.

GET /v1/webhook-events lists your events with their status (PENDING, DELIVERING, DELIVERED, FAILED, EXHAUSTED), attempts and lastError; filter by status or transactionId. After fixing your endpoint, POST /v1/webhook-events/{id}/redeliver queues an event again.

Your endpoint must be reachable from the internet. A URL like http://localhost:4000 only works when the platform runs on the same machine; during development, expose your handler with a tunnel.