Invoices
Create, list, and download invoices
Invoices
Create invoices, mark them as paid, and download PDF copies.
List Invoices
GET /v1/invoicescurl https://api.fugoku.com/v1/invoices \
-H "X-Fugoku-API-Key: $FUGOKU_API_TOKEN"Response:
{
"data": [
{
"id": "inv-abc123",
"invoiceNumber": "INV-A1B2C3",
"projectId": "proj-abc123",
"currency": "USD",
"amountCents": 12000,
"taxCents": 960,
"totalCents": 12960,
"status": "pending",
"dueDate": "2026-09-01T00:00:00Z",
"createdAt": "2026-08-01T00:00:00Z"
}
]
}Create Invoice
POST /v1/invoicesRequest Body:
| Field | Type | Required | Description |
|---|---|---|---|
currency | string | Yes | USD or NGN |
amountCents | integer | Yes | Amount in cents (must be positive) |
taxRate | number | No | Tax rate 0–1 (default 0) |
lineItems | array | No | Array of { description, quantity, unitPriceCents } |
dueDate | string | Yes | Due date (ISO 8601) |
metadata | object | No | Additional metadata |
curl -X POST https://api.fugoku.com/v1/invoices \
-H "X-Fugoku-API-Key: $FUGOKU_API_TOKEN" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: unique-key-123" \
-d '{
"currency": "USD",
"amountCents": 12000,
"taxRate": 0.08,
"dueDate": "2026-09-01",
"lineItems": [
{ "description": "vm-standard (720h)", "quantity": 1, "unitPriceCents": 1200 }
]
}'Response (201):
{
"data": {
"id": "inv-abc123",
"invoiceNumber": "INV-A1B2C3",
"currency": "USD",
"amountCents": 12000,
"taxCents": 960,
"totalCents": 12960,
"status": "pending"
}
}Mark Invoice as Paid
PATCH /v1/invoices/:id/paycurl -X PATCH https://api.fugoku.com/v1/invoices/inv-abc123/pay \
-H "X-Fugoku-API-Key: $FUGOKU_API_TOKEN"Sets the invoice status to paid and records the payment timestamp.
Download Invoice PDF
GET /v1/invoices/:id/pdfReturns the invoice as a PDF file.
curl -o invoice.pdf https://api.fugoku.com/v1/invoices/inv-abc123/pdf \
-H "X-Fugoku-API-Key: $FUGOKU_API_TOKEN"Response: application/pdf (binary file download)
The PDF includes invoice number, line items, subtotal, tax, and total.