FugokuFugoku Docs
Mask

Invoices

Create, list, and download invoices

Invoices

Create invoices, mark them as paid, and download PDF copies.

List Invoices

GET /v1/invoices
curl 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/invoices

Request Body:

FieldTypeRequiredDescription
currencystringYesUSD or NGN
amountCentsintegerYesAmount in cents (must be positive)
taxRatenumberNoTax rate 0–1 (default 0)
lineItemsarrayNoArray of { description, quantity, unitPriceCents }
dueDatestringYesDue date (ISO 8601)
metadataobjectNoAdditional 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/pay
curl -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/pdf

Returns 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.

On this page