# listInvoices

The org's invoice history, newest first: `count` (1..24, default 12) finalized invoices, never drafts. Each has `number`, `status` (open, paid, uncollectible, void), `createdAt`, `dueAt` (an emailed invoice's due date, kept after payment, so read `status`), `totalCents`, `amountPaidCents`, `amountRemainingCents` (still owed), `currency` and `hostedInvoiceUrl`, the page where a person views, downloads or pays it; link it, never paste amounts as a receipt. Amounts are cents: divide by 100. An empty list means no finalized invoice among the org's recent Stripe invoices, not proof it was never billed. Read-only. An open one an admin pays from chat with getInvoicePayment then payInvoice; else link its hostedInvoiceUrl with its amount and due date. Needs the spending permission: refused without it (the refusal text is the generic spending one), tell the person an admin or a teammate who manages spending sees invoices on Settings > Billing.

- Call: `POST https://server.goliathdata.com/api/v1/call` with `{ "operationId": "listInvoices", "variables": {...} }`
- Scope: `ADMIN`
- Type: query
- Idempotency: a read; rejects `Idempotency-Key`
- Rate-limited: no

## Variables

- `count`: `Int`

## Response (data, an example)

```json
{
  "subscriptionQuery": {
    "invoices": [
      {
        "id": "…",
        "number": "…",
        "status": "…",
        "createdAt": "2026-01-01T00:00:00.000Z",
        "dueAt": "2026-01-01T00:00:00.000Z",
        "totalCents": 0,
        "amountPaidCents": 0,
        "amountRemainingCents": 0,
        "currency": "…",
        "hostedInvoiceUrl": "…"
      }
    ]
  }
}
```

## Example

```bash
curl https://server.goliathdata.com/api/v1/call \
  -H "Authorization: Bearer $GOLIATH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "operationId": "listInvoices",
    "variables": {}
  }'
```
