Skip to main content

Webhooks & Events

The Kulpay Collection API provides webhook endpoints to receive real-time notifications about collection request lifecycle events. Webhooks enable integration between biller systems, payment processors, and the Kulpay ecosystem.

Overview

Webhook Endpoints

All webhook endpoints accept POST requests with application/json content type.


Bill Created

POST /v1/collection-requests/web-hook/bill-created

Notifies the system when a new bill/invoice has been created by a biller. This webhook receives the full collection request data and creates the corresponding records in the system.

Request Body:

The request body is a full CollectionRequest object:

{
"id": "cr_abc123",
"account_id": "acc_xyz789",
"description": "Monthly electricity bill - January 2026",
"amount": {
"currency": "MZN",
"value": 4500.00
},
"payer": {
"first_name": "João",
"last_name": "Silva",
"legal_name": "",
"vat_number": "",
"address": {
"country": "Mozambique",
"state_province": "Maputo",
"city": "Maputo",
"street": "Av. Eduardo Mondlane 1234"
},
"contact": {
"phone_number": "+258840000001",
"email": "joao.silva@email.com"
},
"type": "individual",
"delivery_method": "sms"
},
"collection_method_details": [
{
"type": "simo_erv",
"collection_method_id": "cm_def456",
"reference_number": "123456789",
"entity_number": "12345"
}
],
"invoice_metadata": {
"invoice_number": "INV-2026-001234",
"issue_date": "2026-01-15",
"due_date": "2026-02-15",
"invoice_type": "utility",
"source_channel": "erp",
"reference_number": "REF-001234"
},
"financial_details": {
"line_items": "Electricity consumption - 350 kWh",
"products_info": {
"quantity": 1,
"unit_price": 4500.00,
"subtotals": 4500.00
},
"tax_info": {
"iva": 0.0
},
"discount": 0.0,
"total_amount": {
"currency": "MZN",
"value": 4500.00
},
"fx_rate": "1.0"
},
"biller": {
"account_id": "acc_xyz789",
"business_name": "EDM - Electricidade de Moçambique",
"issuer_nuit": "400000001",
"contact": {
"phone_number": "+258840000000",
"email": "billing@edm.co.mz"
}
},
"status": "pending",
"created_at": "2026-01-15T10:00:00Z"
}

Response: Empty (200 OK)


Bill Paid

POST /v1/collection-requests/{id}/web-hook/bill-paid

Notifies the system when a bill has been paid through an external channel (e.g., bank transfer, SIMO ERV payment).

Path Parameters:

ParameterTypeDescription
idstringCollection request ID

Request Body:

The request body is a CustomerBill object:

{
"id": "cr_abc123",
"bill_id": "bill_pay789",
"invoice_identification": {
"invoice_number": "INV-2026-001234",
"issue_date": "2026-01-15",
"due_date": "2026-02-15",
"invoice_type": "utility",
"reference_number": "REF-001234"
},
"issuer_information": {
"account_id": "acc_xyz789",
"business_name": "EDM - Electricidade de Moçambique",
"issuer_nuit": "400000001"
},
"payer_type": "individual",
"payer": {
"first_name": "João",
"last_name": "Silva",
"contact": {
"phone_number": "+258840000001"
},
"type": "individual",
"delivery_method": "sms"
},
"payment_options": {
"payment_methods": "bank",
"payment_terms": "net_30"
},
"status_history": {
"invoice_status": "paid",
"paid_at": "2026-01-20T14:30:00Z"
},
"created_at": "2026-01-15T10:00:00Z"
}

Response: Empty (200 OK)


Bill Opened

POST /v1/collection-requests/{id}/web-hook/bill-opened

Notifies the system when a customer has viewed/opened the bill. This is used for tracking invoice delivery and engagement.

Path Parameters:

ParameterTypeDescription
idstringCollection request ID

Request Body:

Same CustomerBill structure as Bill Paid.

Response:

{
"account_id": "acc_xyz789",
"collection_request": {
"id": "cr_abc123",
"account_id": "acc_xyz789",
"description": "Monthly electricity bill - January 2026",
"amount": {
"currency": "MZN",
"value": 4500.00
},
"status": "viewed"
}
}

Bill Delivered

POST /v1/collection-requests/{id}/web-hook/bill-delivered

Notifies the system when a bill has been successfully delivered to the payer (via SMS, email, or ERP).

Path Parameters:

ParameterTypeDescription
idstringCollection request ID

Request Body:

{
"id": "cr_abc123",
"invoice_identification": {
"invoice_number": "INV-2026-001234",
"issue_date": "2026-01-15",
"due_date": "2026-02-15",
"invoice_type": "utility",
"reference_number": "REF-001234"
}
}

Response: Empty (200 OK)


Customer Paid

POST /v1/collection-requests/{id}/web-hook/customer-paid

Notifies the system when a Kulpay customer has paid a bill through the Kulpay mobile app. This webhook is triggered after the in-app payment is confirmed.

Path Parameters:

ParameterTypeDescription
idstringCollection request ID

Request Body:

{
"id": "cr_abc123",
"customer_id": "cus_abc12345",
"invoice_number": "INV-2026-001234",
"reference_number": "REF-001234",
"third_party_reference": "3PR-EDM-001234",
"invoice_type": "utility",
"paid_amount": {
"currency": "MZN",
"value": 4500.00
},
"paid_at": "2026-01-20T14:30:00Z",
"transaction_reference": "txn_abc123",
"gateway_transaction_id": "gw_txn_xyz789"
}
FieldTypeRequiredDescription
idstringYesCollection request ID
customer_idstringYesKulpay customer who made the payment
invoice_numberstringYesInvoice number being paid
reference_numberstringYesBill reference number
third_party_referencestringYesExternal reference from the biller
invoice_typestringYesType of invoice
paid_amountAmountYesAmount paid (currency + value)
paid_attimestampYesWhen the payment was made
transaction_referencestringYesInternal transaction reference
gateway_transaction_idstringYesPayment gateway transaction ID

Response: Empty (200 OK)


Kulpay Notification

POST /v1/collection-requests/{id}/web-hook/kulpay

Sends a notification to a Kulpay customer about a bill. This can be used to remind customers about pending bills or to deliver new invoices directly to their Kulpay app.

Path Parameters:

ParameterTypeDescription
idstringCollection request ID

Request Body:

{
"id": "cr_abc123",
"customer_id": "cus_abc12345",
"customer_bill_id": "bill_pay789",
"title": "New bill from EDM",
"info_msg": "You have a new electricity bill of 4,500.00 MZN due on February 15, 2026.",
"sent_at": "2026-01-16T08:00:00Z"
}
FieldTypeRequiredDescription
idstringYesCollection request ID
customer_idstringYesTarget Kulpay customer
customer_bill_idstringYesBill ID for viewing details in-app
titlestringYesNotification title
info_msgstringYesNotification message body
sent_attimestampYesWhen the notification was sent

Response: Empty (200 OK)


Webhook Event Flow

The typical lifecycle of a collection request through webhooks:

Event Summary

EventTriggerDirectionDescription
bill-createdBiller creates invoiceBiller → APINew invoice ingested into the system
bill-deliveredBill sent to payerAPI → BillerConfirmation that bill was delivered
bill-openedCustomer views billKulpay App → APITracks bill engagement
bill-paidPayment confirmedBiller/Bank → APIExternal payment notification
customer-paidIn-app paymentKulpay App → APIKulpay customer payment
kulpaySystem notificationAPI → Kulpay AppPush notification to customer