Skip to content

cucuEmitirLote

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”.

FieldTypeRequiredDescription
credentials_idcredentialsYescucu credential
invoicesjsonYesInvoices (JSON) — Array of invoices, each with the same fields as “Issue invoice” (camelCase or snake_case)
point_of_sale_idtextNoPoint of sale (UUID) — Shown in CUCU Branches and points of sale. Empty = the credential default point of sale
document_sectorselectNoSector (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_codenumberNoPayment method (common)
default_activity_economictextNoDefault economic activity (CAEB) — Applied to lines without activityEconomic
default_code_product_sintextNoDefault SIN product code — Applied to lines without codeProductSin
default_unit_measurenumberNoDefault unit of measure — 58 = Service, 1 = Unit, 57 = Piece (unit-measures catalog)
chunk_sizenumberNoInvoices per call — Max 20 (CUCU limit)
max_invoicesnumberNoMaximum invoices
invalid_itemsselectNoIf an invoice is invalid — abort, skip
batch_field_styleselectNoLine field names — CUCU docs use different names in the batch example (activityCode, sinProductCode, unitPrice). “Both” works with either · both, standard, legacy
fail_on_partialbooleanNoError if any fails
output_keytextNoOutput key — The result is added to data[key] keeping the rest of the data

This module requires a credential of type cucu with the fields:

  • API key: starts with sk_test_ (sandbox) or sk_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
{
"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.

{
"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 partial with 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).