cucuEmitirLote
Description
Section titled “Description”Issues several invoices in one call (CUCU accepts 20 per request; the node splits bigger batches). Validates ALL before sending any and returns each result. No idempotency key: if the network fails mid-batch, check with “Query → search” before retrying. This is not the SIAT massive emission (use “Massive emission” for that).
Part of the Bolivia Fiscal Hub as an alternative to connecting directly to SIAT: CUCU is an authorised provider handling signing, CUIS/CUFD codes and submission to the SIN. Node: “Emitir facturas en lote”.
Configuration
Section titled “Configuration”| Field | Type | Required | Description |
|---|---|---|---|
| credentials_id | credentials | Yes | cucu credential |
| invoices | json | Yes | Invoices (JSON) — Array of invoices, each with the same fields as “Issue invoice” (camelCase or snake_case) |
| point_of_sale_id | text | No | Point of sale (UUID) — Shown in CUCU Branches and points of sale. Empty = the credential default point of sale |
| document_sector | select | No | Sector (common) — “, 1, 2, 3, 5, 8, 9, 11, 13, 15, 16, 17, 20, 21, 22, 28, 34, 35, ELECTRONIC_HEALTH_SERVICE, ELECTRONIC_AIRLINE, ELECTRONIC_GAMES_LUCK |
| payment_method_code | number | No | Payment method (common) |
| default_activity_economic | text | No | Default economic activity (CAEB) — Applied to lines without activityEconomic |
| default_code_product_sin | text | No | Default SIN product code — Applied to lines without codeProductSin |
| default_unit_measure | number | No | Default unit of measure — 58 = Service, 1 = Unit, 57 = Piece (unit-measures catalog) |
| chunk_size | number | No | Invoices per call — Max 20 (CUCU limit) |
| max_invoices | number | No | Maximum invoices |
| invalid_items | select | No | If an invoice is invalid — abort, skip |
| batch_field_style | select | No | Line field names — CUCU docs use different names in the batch example (activityCode, sinProductCode, unitPrice). “Both” works with either · both, standard, legacy |
| fail_on_partial | boolean | No | Error if any fails |
| output_key | text | No | Output key — The result is added to data[key] keeping the rest of the data |
Credentials
Section titled “Credentials”This module requires a credential of type cucu with the fields:
- API key: starts with
sk_test_(sandbox) orsk_live_(production); the environment is inferred from the prefix - Environment: automatic, testing or production (if it contradicts the key, nothing is sent)
- Default point of sale (UUID): used when the node does not specify one
- Company ID (UUID): for branches and certificate status
- Webhook secret (
whsec_…): to verify event signatures
Output
Section titled “Output”{ "success": false, "total": 45, "successful": 44, "failed": 1, "chunks": 3, "environment": "sandbox", "results": [ { "index": 0, "success": true, "invoice_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "invoice_number": 1, "cuf": "2872F7294502332E637FABFBC3654EA82202AD48E0969F14EBEB8AF74" }, { "index": 23, "success": false, "stage": "cucu", "error": "NIT invalido" } ], "warnings": []}The output is stored under the configured key (output_key, default cucu) and the rest of data is kept. On error: error.message, error.type and, where applicable, status, code and siat_code.
Usage Example
Section titled “Usage Example”{ "credentials_id": "cred-cucu", "point_of_sale_id": "660e8400-e29b-41d4-a716-446655440004", "invoices": "{{data.facturas}}", "invalid_items": "abort", "output_key": "cucu"}- Validates ALL invoices before sending any (unless you choose “skip invalid”). Splits into calls of 20 (CUCU limit) and re-maps indexes so
results[i]matches the input list. - The batch endpoint documents no idempotency: a timeout is not retried, to avoid duplicates. If it fails midway the error carries
partialwith what was confirmed; check with “CUCU: Query” before resending. - The CUCU docs use different line names in batches (
activityCode,sinProductCode,unitPrice,discount); by default both sets of names are sent (both).
Related Nodes
Section titled “Related Nodes”- cucuEmitirFactura - Emitir factura
- cucuEmisionMasiva - Emisión masiva
- cucuConsultar - Consultar facturas