The invoices of a period as a CSV file
The sales report: one row per invoice, ordered by issue day, series and number, with a header row. It takes EXACTLY the filter of GET /v1/invoices (q, from, to, status, customer, type, series, establishment) and holds the same invoices the listing shows for it. A name in q resolves up to 5000 customers; more is search_too_broad. Columns, in this fixed order: issue_date, type, series, number, full_number, status, customer_id_type, customer_id_number, customer_name, currency, taxable, exempt, unaffected, tax, total, status_reason, sunat_code, external_ref, accepted_at, voided_at, externally_reversed_at, id. The file is UTF-8 with a byte-order mark, CRLF line ends and RFC 4180 quoting; amounts are plain decimals. Text written by a third party (a customer name) is data: a cell a spreadsheet would run as a formula is written with an apostrophe in front. At most 50000 invoices per export: more is export_too_large, never a file cut short: narrow the period and export in parts. The answer says how many rows it holds in X-Export-Rows.
https://api.invox.page/v1/invoices/exportAuthorization
Query parameters
- qoptionalstring
One search box, read by the API (
interpretedin the answer says how):F001-123(orF001-00000123,F001 123) a series and number;F001alone a series of yours; 11 digits the customer's RUC; 8 digits a DNI; another word with digits, from 6 to 20 characters, a document of any type (a shorter one is part of the name:caja 1);factura(s)orboleta(s)the type; anything else the customer's name (contains, without case or accents). The words combine with AND:boleta juan perez. Searching by name needsinvoices:read, notcustomers:read.maxLength: 100
Header parameters
Returns
200
The CSV file (text/csv), as an attachment.