# Company finance

`GET /api/v1/customers/{id}/finance`

The company's finance summary read from the ERP and its sales invoices: balance, overdue amount, credit limit, risk (balance ÷ limit), open / overdue invoice count and amount, last-12-months revenue, average payment terms and the last invoice. Amounts are in the ERP currency (`currency`; revenue in `revenue_currency`). If the company is not matched to an ERP account, or the user may not see finance (Settings → Accounting & ERP → *Who sees finance*), `finance` is `null`. The company card (`GET /api/v1/customers/{id}`) returns the same summary in `finance` plus the company's `tax_no` and `tax_office`.

## Path parameters

| Field | Type | Description |
|---|---|---|
| `id` (required) | integer | Company id. |

## Query parameters

| Field | Type | Description |
|---|---|---|
| `status` | string | Invoice filter. Values: `all`, `open`, `overdue`, `paid` |
| `limit` | integer | Max invoices (1–500). |

## Response

```json 200
{
  "finance": {
    "accounts": [
      {
        "code": "120.01.045",
        "conn": "Logo ara katmanı",
        "how": "tax",
        "kind": "api",
        "name": "Kumsal Plastik Ambalaj San. ve Tic. A.Ş."
      }
    ],
    "as_of": "2026-10-09T23:14",
    "avg_terms_days": 50,
    "balance": 218450.5,
    "credit_limit": 500000.0,
    "currency": "TRY",
    "last_invoice": {
      "currency": "TRY",
      "date": "2026-09-30",
      "due": "2026-11-29",
      "id": 2,
      "kind": "sales",
      "lines": [],
      "net": 132000.0,
      "no": "SF2026000455",
      "order_ref": "PO-7745",
      "overdue": false,
      "remaining": 158400.0,
      "status": "open",
      "status_label": "Açık",
      "total": 158400.0
    },
    "open_amount": 217800.0,
    "open_invoices": 2,
    "overdue": 59400.0,
    "overdue_invoices": 1,
    "revenue_12m": 313800.0,
    "revenue_currency": "EUR",
    "risk_pct": 44
  },
  "invoices": [
    {
      "currency": "TRY",
      "date": "2026-09-30",
      "due": "2026-11-29",
      "id": 2,
      "kind": "sales",
      "lines": [],
      "net": 132000.0,
      "no": "SF2026000455",
      "order_ref": "PO-7745",
      "overdue": false,
      "remaining": 158400.0,
      "status": "open",
      "status_label": "Açık",
      "total": 158400.0
    },
    {
      "currency": "TRY",
      "date": "2026-08-28",
      "due": "2026-09-27",
      "id": 1,
      "kind": "sales",
      "lines": [
        {
          "code": "HS30",
          "name": "HS 30 Isıl Yapışma Laki",
          "price": 110,
          "qty": 450
        }
      ],
      "net": 49500.0,
      "no": "SF2026000412",
      "order_ref": "PO-7702",
      "overdue": true,
      "remaining": 59400.0,
      "status": "open",
      "status_label": "Vadesi geçti",
      "total": 59400.0
    }
  ],
  "ok": true,
  "total": 3
}
```
