API Reference · Payments
Invoices
Invoices with line items, an optional VAT amount you set, and optional part payments.
The invoice object
Represents a invoice entity in the rafiqPay system.
| Field | Type & Flags | Description |
|---|---|---|
| id | string | Invoice ID (inv_...). |
| total | string | Total invoice amount, including any VAT you added. |
| amountRemaining | string | Remaining unpaid balance. |
| allowPartPayments | boolean | Whether partial payments are accepted. |
Example invoice JSON
invoice example payload
{
"id": "inv_2026_0042",
"total": "451500.00",
"amountRemaining": "301500.00",
"allowPartPayments": true,
"status": "part_paid"
}Endpoints & Operations
POST/v1/billing/invoicesProposed
Create an invoice
Creates a draft invoice.
Request Example
POST /v1/billing/invoices
cURL · v1
curl -X POST "https://api.rafiqpay.net/v1/billing/invoices" \
-H "Authorization: Bearer rp_test_sk_kanzu_9f8a7b6c5d4e3f2a" \
-H "Idempotency-Key: idem_create-invoice_01" \
-H "Content-Type: application/json" \
-d '{
"customerId": "cus_amina_01",
"total": "451500.00",
"dueDate": "2026-12-01",
"allowPartPayments": true,
"minimumPartPayment": "50000.00"
}'Response (200 OK)
Response payload
{
"id": "inv_2026_0042",
"status": "draft"
}GET/v1/billing/invoices/:idProposed
Retrieve an invoice
Retrieves an invoice.
Request Example
GET /v1/billing/invoices/:id
cURL · v1
curl -X GET "https://api.rafiqpay.net/v1/billing/invoices/:id" \
-H "Authorization: Bearer rp_test_sk_kanzu_9f8a7b6c5d4e3f2a"Response (200 OK)
Response payload
{
"id": "inv_2026_0042",
"status": "part_paid"
}GET/v1/billing/invoicesProposed
List invoices
Lists invoices.
Request Example
GET /v1/billing/invoices
cURL · v1
curl -X GET "https://api.rafiqpay.net/v1/billing/invoices" \
-H "Authorization: Bearer rp_test_sk_kanzu_9f8a7b6c5d4e3f2a"Response (200 OK)
Response payload
{
"object": "list",
"data": [],
"hasMore": false,
"nextCursor": null
}POST/v1/billing/invoices/:id/sendProposed
Send an invoice
Finalises and emails the invoice to the customer.
Request Example
POST /v1/billing/invoices/:id/send
cURL · v1
curl -X POST "https://api.rafiqpay.net/v1/billing/invoices/:id/send" \
-H "Authorization: Bearer rp_test_sk_kanzu_9f8a7b6c5d4e3f2a" \
-H "Idempotency-Key: idem_send-invoice_01"Response (200 OK)
Response payload
{
"id": "inv_2026_0042",
"status": "sent"
}POST/v1/billing/invoices/:id/voidProposed
Void an invoice
Voids an unpaid invoice.
Request Example
POST /v1/billing/invoices/:id/void
cURL · v1
curl -X POST "https://api.rafiqpay.net/v1/billing/invoices/:id/void" \
-H "Authorization: Bearer rp_test_sk_kanzu_9f8a7b6c5d4e3f2a" \
-H "Idempotency-Key: idem_void-invoice_01"Response (200 OK)
Response payload
{
"id": "inv_2026_0042",
"status": "voided"
}POST/v1/billing/invoices/:id/offline-paymentsProposed
Record an offline payment
Records an external bank transfer against an invoice.
Request Example
POST /v1/billing/invoices/:id/offline-payments
cURL · v1
curl -X POST "https://api.rafiqpay.net/v1/billing/invoices/:id/offline-payments" \
-H "Authorization: Bearer rp_test_sk_kanzu_9f8a7b6c5d4e3f2a" \
-H "Idempotency-Key: idem_offline-payment-invoice_01" \
-H "Content-Type: application/json" \
-d '{
"amount": "150000.00",
"reference": "NIP-99182"
}'Response (200 OK)
Response payload
{
"id": "inv_2026_0042",
"status": "part_paid"
}Related Webhook Events
These events are dispatched to your webhook endpoints when actions occur on this resource: