> For the complete documentation index, see [llms.txt](https://gdplabs.gitbook.io/sdk/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gdplabs.gitbook.io/sdk/computer-vision/ekyc/document-ocr/financial-statement.md).

# Financial Statement

Extract structured data from financial statements (balance sheets and income statements). Fields are returned dynamically based on document type, with multi-year column support.

## Read Financial Statement — `POST /ocr/v1/financial-statement`

### Request

**Required parameter:**

| Field   | Type                                            | Description                        |
| ------- | ----------------------------------------------- | ---------------------------------- |
| `image` | file (`.png`, `.jpg`, `.jpeg`, `.tiff`, `.pdf`) | The financial statement image file |

{% tabs %}
{% tab title="cURL" %}

```bash
curl -v -L -X POST 'https://api.vision.glair.ai/ocr/v1/financial-statement' \
  -H "Authorization: Basic $(printf "%s" "USERNAME:PASSWORD" | base64)" \
  -H 'x-api-key: API_KEY' \
  -F 'image=@"/path/to/financial-statement.pdf"'
```

{% endtab %}

{% tab title="Node.js" %}

```javascript
const response = await fetch('https://api.vision.glair.ai/ocr/v1/financial-statement', {
  method: 'POST',
  headers: {
    Authorization: `Basic ${Buffer.from('USERNAME:PASSWORD').toString('base64')}`,
    'x-api-key': 'API_KEY',
  },
  body: formData, // FormData with 'image' field
});
const data = await response.json();
```

{% endtab %}
{% endtabs %}

### Response

Each field in `read` returns an **array** of value objects — one per column detected (e.g., one per year in a multi-year statement). Each object includes a `field_info` array identifying the column.

**Balance Sheet example:**

```json
{
  "status": "SUCCESS",
  "reason": "File Successfully Read",
  "read": {
    "assets": [
      {
        "value": "10000000000",
        "confidence": 95,
        "field_info": [
          { "field_info_type": "year", "value": "2023" }
        ]
      },
      {
        "value": "9500000000",
        "confidence": 94,
        "field_info": [
          { "field_info_type": "year", "value": "2022" }
        ]
      }
    ],
    "current_assets": [
      {
        "value": "4000000000",
        "confidence": 95,
        "field_info": [{ "field_info_type": "year", "value": "2023" }]
      }
    ],
    "total_liabilities": [
      {
        "value": "6000000000",
        "confidence": 94,
        "field_info": [{ "field_info_type": "year", "value": "2023" }]
      }
    ],
    "equities": [
      {
        "value": "4000000000",
        "confidence": 95,
        "field_info": [{ "field_info_type": "year", "value": "2023" }]
      }
    ]
  }
}
```

**Income Statement example:**

```json
{
  "status": "SUCCESS",
  "reason": "File Successfully Read",
  "read": {
    "total_revenue": [
      {
        "value": "50000000000",
        "confidence": 96,
        "field_info": [{ "field_info_type": "year", "value": "2023" }]
      }
    ],
    "total_gross_profit_loss": [
      {
        "value": "20000000000",
        "confidence": 95,
        "field_info": [{ "field_info_type": "year", "value": "2023" }]
      }
    ],
    "total_profit_loss": [
      {
        "value": "8000000000",
        "confidence": 94,
        "field_info": [{ "field_info_type": "year", "value": "2023" }]
      }
    ]
  }
}
```

**Balance Sheet fields** (subset):

| Field                            | Description                  |
| -------------------------------- | ---------------------------- |
| `assets`                         | Total assets                 |
| `current_assets`                 | Current assets               |
| `non_current_assets`             | Non-current assets           |
| `liabilities`                    | Total liabilities            |
| `current_liabilities`            | Current liabilities          |
| `non_current_liabilities`        | Non-current liabilities      |
| `equities`                       | Total equity                 |
| `total_liabilities`              | Total liabilities            |
| `total_liabilities_and_equities` | Total liabilities and equity |

**Income Statement fields** (subset):

| Field                       | Description           |
| --------------------------- | --------------------- |
| `total_revenue`             | Total revenue         |
| `cost_of_sales_and_revenue` | Cost of sales/revenue |
| `total_gross_profit_loss`   | Gross profit/loss     |
| `operating_expenses`        | Operating expenses    |
| `operating_profit_loss`     | Operating profit/loss |
| `total_profit_before_tax`   | Profit before tax     |
| `total_profit_loss`         | Net profit/loss       |

Each field returns an array where each element has `value`, `confidence`, and `field_info[]` (with `field_info_type` and `value` identifying the column, e.g., year).

{% hint style="info" %}
For OCR accuracy limitations, see [OCR Overview](/sdk/computer-vision/ekyc/document-ocr.md).
{% endhint %}

***

## Response Codes

| Status                | HTTP | Condition                  |
| --------------------- | ---- | -------------------------- |
| `SUCCESS`             | 200  | Document read successfully |
| `NO_FILE`             | 400  | No image in request body   |
| `FILE_INVALID_FORMAT` | 415  | Unsupported file format    |

An associated `Request-Id` is returned in the response headers.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://gdplabs.gitbook.io/sdk/computer-vision/ekyc/document-ocr/financial-statement.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
