Skip to content

Payments API ​

Use the Payments API to record and retrieve payments associated with invoices.

Payment object ​

FieldTypeDescription
idstringPayment ID with the pay_ prefix.
invoice_idstringInvoice receiving the payment.
customer_idstringCustomer associated with the invoice.
amountintegerPayment amount.
currencystringISO 4217 currency code.
methodstringbank_transfer, cash, card, mobile_money, or other.
statusstringpending, completed, failed, or refunded.
referencestring | nullPayment reference.
paid_atstringISO 8601 timestamp.
created_atstringISO 8601 timestamp.

List payments ​

http
GET /payments

Filters: invoice_id, customer_id, status, method, from, to, page, limit.

Create a payment ​

http
POST /payments

Required: invoice_id, amount, method.

Financial writes should include an idempotency key.

bash
curl -X POST https://api.cedius.app/v1/payments   -H "Authorization: Bearer cedius_test_sk_example"   -H "Content-Type: application/json"   -H "Idempotency-Key: payment-order-4832"   -d '{
    "invoice_id": "inv_91ac20",
    "amount": 161250,
    "method": "bank_transfer",
    "reference": "TRX-20260910-8821"
  }'

201 Created

json
{
  "data": {
    "id": "pay_72bd13",
    "invoice_id": "inv_91ac20",
    "customer_id": "cus_4d7c21",
    "amount": 161250,
    "currency": "NGN",
    "method": "bank_transfer",
    "status": "completed",
    "reference": "TRX-20260910-8821",
    "paid_at": "2026-09-10T08:45:00Z",
    "created_at": "2026-09-10T08:45:02Z"
  }
}

Invoice status behavior ​

When completed payments equal the invoice total:

text
invoice.status -> paid

When completed payments are greater than zero but below the total:

text
invoice.status -> partially_paid

Retrieve a payment ​

http
GET /payments/{payment_id}

Completed payments are not directly edited. Corrections should use an explicit financial operation such as a refund.

Cedius is an illustrative API documentation portfolio project.