Goal

Generate a complete finance reconciliation package for a billing period: KPI summary, formatted statement (PDF/XLSX/CSV), drill-down reports by month, counterparty, and bank, an accounting-ready ledger export, and a bulk ZIP of all CEP certificates.

Prerequisites

  • An active API key (mxcep_…) with finance:generate_self.
  • A specific month in YYYY-MM format for every request.
  • For the CEP archive, ensure you have valid validations with has_cep=true in the requested period.

Steps

1. Check the KPI summary

Before generating exports, verify the period has data and review key metrics:

curl 'https://api.example.com/v1/finance/summary?month=2025-03' \
  -H 'Authorization: Bearer mxcep_••••'

The response includes: verdict counts, monetary aggregates (total volume, verified volume, average ticket), success rate, processing time average, daily breakdown, and top counterparties and banks. Month-over-month deltas are included for period comparison.

2. Download the monthly statement

GET /v1/finance/statement produces the full monthly financial statement. Choose the format that fits your workflow:

formatContent
pdfBank-statement-style PDF with header/footer on every page, portfolio summary, verdict distribution, daily detail, and up to 1000 transactions in the annex.
xlsx6-tab workbook: Summary, Daily Detail, Top Counterparties, Top Banks, Verdict Distribution, Verifications (full ledger, no row cap).
csvUTF-8 with BOM, partitioned into [HEADER], [KPIS], [TRANSACTIONS], [TOTALS] sections.
htmlSame content as PDF, served inline for browser-based printing.
# XLSX workbook
curl 'https://api.example.com/v1/finance/statement?month=2025-03&format=xlsx' \
  -H 'Authorization: Bearer mxcep_••••' \
  --output estado-cuenta-2025-03.xlsx

# PDF statement
curl 'https://api.example.com/v1/finance/statement?month=2025-03&format=pdf' \
  -H 'Authorization: Bearer mxcep_••••' \
  --output estado-cuenta-2025-03.pdf

The response includes X-Finance-Folio — a deterministic folio code for the period (SHA1(user_id|YYYY-MM|brand_slug)[:12]) useful for audit references.

GET /v1/finance/monthly returns the aggregated financial metrics month by month for a rolling period — useful for multi-month trend analysis outside the single-month statement.

curl 'https://api.example.com/v1/finance/monthly' \
  -H 'Authorization: Bearer mxcep_••••'

4. Analyze by counterparty

GET /v1/finance/counterparties breaks down volumes and verdict distributions by receiving bank or beneficiary account:

curl 'https://api.example.com/v1/finance/counterparties?month=2025-03' \
  -H 'Authorization: Bearer mxcep_••••'

5. Analyze by bank

GET /v1/finance/by-bank provides the same breakdown segmented by issuing and receiving bank pairs:

curl 'https://api.example.com/v1/finance/by-bank?month=2025-03' \
  -H 'Authorization: Bearer mxcep_••••'

6. Export the accounting ledger

GET /v1/finance/accounting generates the full transaction ledger in an accounting-friendly format (CSV or XLSX) — no 1000-row cap, every valid validation for the period included:

curl 'https://api.example.com/v1/finance/accounting?month=2025-03&format=xlsx' \
  -H 'Authorization: Bearer mxcep_••••' \
  --output ledger-2025-03.xlsx

7. Download the bulk CEP archive

GET /v1/finance/ceps produces a ZIP containing all CEP certificates (PDF and/or XML) for the period, plus a manifest.csv and manifest.xlsx listing every included certificate:

curl 'https://api.example.com/v1/finance/ceps?month=2025-03' \
  -H 'Authorization: Bearer mxcep_••••' \
  --output ceps-2025-03.zip

What's next