> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zabcik.me/llms.txt
> Use this file to discover all available pages before exploring further.

# Account statements

> Download account statements as binary payloads and safely convert them to text.

# Account statements

<Note>
  Statements are returned as **binary payloads** with helpers to inspect content type and text — suitable for archiving or reconciliation jobs.
</Note>

Use `getAccountStatement` to request statements for date ranges, currency, and format.

```ts theme={null}
import { Currency, StatementFormat } from 'gopay-sdk';

const statement = await client.getAccountStatement({
  goid: 8123456789,
  date_from: '2026-01-01',
  date_to: '2026-01-31',
  currency: Currency.CZK,
  format: StatementFormat.CSV_A,
});
```

## Response shape

```ts theme={null}
type AccountStatementResponse = {
  data: ArrayBuffer;
  contentType: string | null;
  contentDisposition: string | null;
  toText(encoding?: string): string;
};
```

Example:

```ts theme={null}
console.log(statement.contentType);
console.log(statement.contentDisposition);
console.log(statement.toText().slice(0, 200));
```

## Supported formats

Use `StatementFormat` enum values such as:

* `XLS_A`, `XLS_B`, `XLS_C`
* `CSV_A`, `CSV_B`, `CSV_C`, `CSV_D`, `CSV_E`
* `ABO_A`, `ABO_B`
* `PDF_A`

## Tips

* Prefer CSV variants for service-to-service parsing.
* Use `contentDisposition` to infer suggested filename.
* Store binary payload in secure storage if retaining statements.
