List Invoices
Get a list of invoices with filtering.
Request
Method: GET
URL: /api/invoices
Headers: Authorization: Bearer {token}
Example Request
curl -X GET "https://example.com/api/invoices" \
-H "Authorization: Bearer {token}"
Success Response (200)
{
"records": [
{
"id": 1,
"invoice_number": "INV-001",
"client_id": 1,
"status": "sent",
"total": 15000000,
"due_date": "1403-06-30",
"created_at": "1403-05-15"
}
],
"meta": {
"total": 30,
"current_page": 1,
"per_page": 20
}
}
Errors
| Code | Description |
|---|---|
| 401 | Invalid token |
Create Invoice
Create a new invoice for a client.
Request
Method: POST
URL: /api/invoices
Headers: Authorization: Bearer {token}
Content-Type: application/json
Example Request
curl -X POST "https://example.com/api/invoices" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{
"client_id": 1,
"items": [
{"title": "Consulting", "quantity": 10, "rate": 500000}
],
"due_date": "1403-07-15"
}'
Success Response (201)
{
"record": {
"id": 2,
"invoice_number": "INV-002",
"client_id": 1,
"status": "draft",
"total": 5000000,
"due_date": "1403-07-15"
}
}
Errors
| Code | Description |
|---|---|
| 401 | Invalid token |
| 422 | Validation error |