Invoices API
List Invoices
GET /api/v1/invoicesQuery Parameters:
| Parameter | Type | Description |
|---|---|---|
status | string | Filter by status (draft, sent, paid, overdue, voided) |
customer_id | string | Filter by customer |
from_date | string | Filter by issue date (ISO 8601) |
to_date | string | Filter by issue date (ISO 8601) |
search | string | Search in invoice number and customer name |
page | number | Page number |
limit | number | Items per page |
Create Invoice
POST /api/v1/invoicesRequest Body:
json
{
"customer_id": "customer-uuid",
"issue_date": "2026-01-15",
"due_date": "2026-02-15",
"currency": "USD",
"notes": "Thank you for your business",
"payment_terms": "Net 30",
"discount_type": "percentage",
"discount_value": 10,
"template_id": "template-uuid",
"items": [
{
"product_id": "product-uuid",
"description": "Web Development",
"quantity": 40,
"unit_price": 150,
"unit": "hour",
"tax_id": "tax-uuid"
}
]
}Get Invoice
GET /api/v1/invoices/:idReturns the invoice with all line items, customer details, and payment history.
Update Invoice
PUT /api/v1/invoices/:idSame body as create. Only draft invoices can be edited.
Delete Invoice
DELETE /api/v1/invoices/:idOnly draft invoices can be deleted.
Publish
POST /api/v1/invoices/:id/publishPublishes the invoice and generates a share token. Changes status from draft to sent.
Unpublish
POST /api/v1/invoices/:id/unpublishRevokes the share token and returns the invoice to draft status.
Void
POST /api/v1/invoices/:id/voidVoids the invoice. Cannot be undone.
Mark as Paid
POST /api/v1/invoices/:id/mark-paidMarks the invoice as fully paid.
Mark as Sent
POST /api/v1/invoices/:id/mark-sentMarks a draft invoice as sent without emailing.
Send by Email
POST /api/v1/invoices/:id/sendSends the invoice to the customer via email. Requires SMTP configuration.
Duplicate
POST /api/v1/invoices/:id/duplicateCreates a new draft invoice with the same customer and line items.
Credit Note
POST /api/v1/invoices/:id/credit-noteGenerates a credit note from the invoice.
Record Payment
POST /api/v1/invoices/:id/paymentsRequest Body:
json
{
"amount": 500.00,
"method": "bank_transfer",
"reference": "TXN-12345",
"date": "2026-01-20"
}List Payments
GET /api/v1/invoices/:id/paymentsDelete Payment
DELETE /api/v1/invoices/:id/payments/:paymentIdNext Invoice Number
GET /api/v1/invoices/next-numberReturns the next sequential invoice number based on your numbering pattern.
Export CSV
GET /api/v1/invoices/export/csvBatch Operations
POST /api/v1/invoices/batchRequest Body:
json
{
"action": "delete",
"ids": ["uuid-1", "uuid-2"]
}Trash
GET /api/v1/invoices/trash/list
POST /api/v1/invoices/trash/batch