DOCS Live

PSPs and wallets

Selling bills in your app

Sell electricity, water, TV, airtime and school fees to your customers in four calls — list, look up, quote, pay.

As a PSP, bank or wallet you sell every biller on KulPay to your customers through one API: list the billers and products, look the customer's reference up, quote the purchase, pay it, and give the customer their receipt and any token.

You pay from your prefunded balance with KulPay, or, without one, KulPay collects from the payer's wallet first (funding: "collect").

Before you start

A PSP key with bills:read and bills:write, a prefunded balance (or collection enabled), and a webhook endpoint for bill_payment.*.

The flow at a glance

#WhoWhat happens
1Your systemLists the billers and products (cache them).
2CustomerChooses a product and gives their reference (a meter, an account, a number).
3Your systemLooks the reference up and shows the customer's name, masked.
4Your systemQuotes the purchase and shows the total, fee included.
5Your systemPays the quote and gives the customer their receipt and any token.

1. List billers and products

Your system.

GET /v1/billers · API reference

The active billers and the products open to you: amount rules, the reference to ask for and its pattern, whether a lookup is required, the payer's fee and offers (bundles, bouquets). The answer carries an ETag: cache it and revalidate with If-None-Match.

2. Look the reference up

Your system.

POST /v1/bill-payments/lookups · API reference

Asks the biller who the reference belongs to, before any money is taken. A found reference gives a lookup_id valid 15 minutes, the name masked, the amount due and the limits.

Request

{
  "biller": "EDM",
  "product": "CREDELEC",
  "customer_reference": "01234567890"
}

Response

{
  "lookup_id": "3KWPl4LcDleeGYpoU9aYN7alhT5",
  "status": "found",
  "biller": "EDM",
  "product": "CREDELEC",
  "customer_reference": "01234567890",
  "customer_name": "C****** T**** 7***",
  "currency": "MZN",
  "constraints": {
    "min": "10.00",
    "max": "50000.00"
  },
  "expires_at": "2026-10-22T10:29:58Z",
  "cached": false
}

3. Quote the purchase

Your system.

POST /v1/bill-payments/quotes · API reference

With the lookup_id and an amount or an offer. The quote has the amount, the payer's fee, the total to collect, the breakdown (units, lines) and expires within 10 minutes. It is paid as issued or not at all.

Request

{
  "biller": "EDM",
  "product": "CREDELEC",
  "lookup_id": "3KWPl4LcDleeGYpoU9aYN7alhT5",
  "amount": "250"
}

Response

{
  "id": "3KWPl4pk0XxRI4TEVI6avRgrj1y",
  "status": "quoted",
  "biller": "EDM",
  "product": "CREDELEC",
  "customer_reference": "01234567890",
  "amount": "250.00",
  "payer_fee": "5.00",
  "total": "255.00",
  "currency": "MZN",
  "breakdown": {
    "units": "25.00",
    "unit_type": "kWh"
  },
  "quote_expires_at": "2026-10-22T10:24:58Z"
}

4. Pay the quote

Your system, with an `Idempotency-Key`.

POST /v1/bill-payments · API reference

From your balance: 201 with succeeded (tokens, PINs, receipt in artifacts) or failed (nothing charged). When the biller has not answered within 25 seconds: 202 with sending or pending, and KulPay keeps asking with the same request ID until it knows. Never pay again for the same purchase: follow it by webhook or GET /v1/bill-payments/{id}.

Without a balance, send funding: "collect" and collect: {method, phone}: KulPay collects from the payer's wallet first, then pays the bill, and refunds the payer if the bill then fails.

Request

{
  "quote_id": "3KWPl4pk0XxRI4TEVI6avRgrj1y",
  "partner_reference": "POS-9",
  "payer": {
    "phone": "258841234567"
  }
}

Response

{
  "id": "3KWPl4pk0XxRI4TEVI6avRgrj1y",
  "status": "succeeded",
  "total": "255.00",
  "currency": "MZN",
  "funding": "balance",
  "partner_reference": "POS-9",
  "supplier_reference": "FK2026102245631213",
  "artifacts": [
    {
      "type": "token",
      "value": "12345678901234567890",
      "units": "25.00",
      "unit_type": "kWh"
    }
  ]
}

5. Give the payer what they bought

Your system.

GET /v1/bill-payments/{id} · API reference

Show the token or PIN and the receipt. The payment carries a receipt_url, a hosted receipt the payer can open. POST /v1/bill-payments/{id}/resend sends the token or receipt to the payer again by SMS or email (at most three times).

States

StateWhat it means
quoted

Priced; pay before quote_expires_at.

collecting

Collecting from the payer's wallet first.

sending

Sent to the biller; waiting for its answer.

pending

The biller has not answered for sure; KulPay keeps asking.

succeeded

Delivered. Give the payer the token or receipt.

failed

Not delivered; nothing charged (or the collection refunded).

When the money moves

From your balance, the total is reserved when you pay and charged when the biller delivers; a failure releases it. With collection, the payer is charged first and refunded if the bill fails. Your commission per sale is in your balance and settlement reports.

Events

EventWhat it tells you
bill_payment.succeeded

Delivered, with its artifacts.

bill_payment.failed

Not delivered.

bill_payment.pending

Still waiting for the biller.

bill_payment.refunded

A collected payment was refunded to the payer.

Errors that matter here

Every error is application/problem+json with a stable code; branch on the code, not the message. The full list is in the error catalogue.

ErrorWhenWhat to do
422 amount_out_of_range

The amount is outside the product's limits; the problem gives them.

Ask for an amount within them.

422 quote_expired

The quote expired before payment.

Refresh it (POST /v1/bill-payments/quotes/{id}/refresh).

422 insufficient_balance

Your prefunded balance cannot cover the total.

Top up, or use collection.

503 biller_unavailable

The biller did not answer.

Retry after Retry-After.

Testing it

Test billers answer fixed references in test mode; pay with your test balance and check each state, including pending (follow it, never pay twice).


All flows · API reference · Error catalogue