List documents (sales)
bsale_list_documentsList issued documents (boletas, facturas, notas de credito, guias...) newest-first as Bsale returns them, with number, dates, net/tax/total amounts, state, SII status and public PDF link. Filter by emission date range, document type, client, office, folio number or SII code. Use expand (details, payments, client, office, document_type) to embed related data. GET /v1/documents.json.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Results per page, 1-50 (default 25). | |
| state | No | 0 = active records (Bsale default), 1 = inactive. | |
| expand | No | ||
| number | No | Document folio number. | |
| offset | No | Items to skip (default 0). Pass the previous reply's next_offset. | |
| code_sii | No | Tax code of the document type, e.g. 33 factura, 39 boleta, 61 nota de credito (Chile) or "01" (Peru). Not available for Mexico: use document_type_id. | |
| client_id | No | ||
| office_id | No | Branch (sucursal) id. | |
| emitted_to | No | A date, yyyy-mm-dd. | |
| client_code | No | Client tax id (RUT/RUC/RFC) as stored in Bsale. | |
| emitted_from | No | A date, yyyy-mm-dd. | |
| informed_sii | No | Tax authority declaration status (SII, SUNAT or SAT): 0 accepted, 1 sent, 2 rejected. | |
| document_type_id | No | Document type id (see bsale_list_document_types). |