GET https://api.veriko.mx/v1/finance/statement

Monthly statement (PDF / XLSX / CSV / HTML)

Audience
public
Auth
API key
Permission
finance:generate_self
How-to guide →

Monthly financial statement in four formats:

  • format=pdf (default, application/pdf): bank-statement-style PDF with repeating header and "Page X of Y" footer, portfolio summary, verdict distribution, top counterparties and banks, daily breakdown, and up to 1000 appendix rows (LedgerPdfRenderer::ROW_CAP).
  • format=xlsx (application/vnd.openxmlformats-officedocument.spreadsheetml.sheet): workbook with 6 sheets (Resumen, Detalle diario, Top contrapartes, Top bancos, Veredicto, Verificaciones). The Verificaciones sheet carries the full monthly ledger uncapped.
  • format=csv (text/csv; charset=utf-8): UTF-8 BOM CSV partitioned into [HEADER], [KPIS], [TRANSACTIONS], and [TOTALS] sections. Keep the order if parsing by marker.
  • format=html (text/html; charset=utf-8): same content as the PDF, served inline for browser-side printing.

All variants return X-Finance-Folio with the deterministic period folio (SHA1(user_id|YYYY-MM|brand_slug)[:12] upper-case). Downloads include X-Frame-Options: DENY and Cache-Control: no-cache, no-store. Scope: self by default. Admins with finance:generate_all may target another user via ?user_id=<uuid>. Accepts cookie or API key. The KPIs rendered in the PDF/XLSX come from the same computation as GET /v1/finance/summary; for CEPs as a separate ZIP archive use GET /v1/finance/ceps.

Parameters
Parameter In Type Required Description
format query string optional

Output format.

Default: pdf

month * query string required

Statement month in `YYYY-MM` format.

user_id query string (uuid) optional

Admins with `finance:generate_all` only. UUID of the user to query.

Request
curl -X GET 'https://api.veriko.mx/v1/finance/statement' \
  -H 'Authorization: Bearer mxcep_••••'

Python example — coming soon.

JavaScript example — coming soon.

PHP example — coming soon.

Response status codes GET /v1/finance/statement
Status Class Description Body
200 2xx Statement stream in the requested format. No body
400 4xx Invalid or missing `month` parameter ErrorResponse
401 4xx Authentication is required or the provided credentials are invalid. ErrorResponse
403 4xx Permisos insuficientes ErrorResponse
500 5xx `pdf_render_failed` when dompdf fails (OOM, missing font). `xlsx_render_failed` when phpspreadsheet fails. `csv_stream_failed` when `php://output` cannot be opened. For PDF/XLSX, try another format. ErrorResponse
Response headers 200
Header Type Description
Cache-Control string Disables intermediary caching of the download (deterministic folio, but sensitive content).
Content-Disposition string Suggested filename for the download.
X-Finance-Folio string Deterministic folio for the period (12 upper-hex chars). The same user+month pair always yields the same folio.
X-Frame-Options string Anti-DoS: downloads do not embed in an iframe.
Errors from GET /v1/finance/statement
Status Code Detail
400 invalid_month

'month' is required and must be YYYY-MM.

Envelope
meta.request_id
d5e6f7a8b9c1
401 unauthorized

Invalid or missing authentication credentials.

Envelope
meta.request_id
c4d5e6f7a8b9
403 forbidden

You do not have permission to access this resource.

Envelope
meta.request_id
d5e6f7a8b9c0