Skip to content

cucuEmitirFactura

Issues a Bolivian electronic invoice with CUCU (SIN SIAT): validates the data, builds the CUF, signs and sends it to the SIAT. Supports 20 sectors (sales, rental, export, education, lodging, minerals…). Returns the invoice, its CUF and links to the PDF, XML and tickets. Protects against duplicates with the idempotency key.

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

FieldTypeRequiredDescription
credentials_idcredentialsYescucu credential
point_of_sale_idtextNoPoint of sale (UUID) — Shown in CUCU Branches and points of sale. Empty = the credential default point of sale
document_sectorselectNoSector — Sector-specific data goes in “Sector fields”. Required per sector → 2 Property rental: billedPeriod · 3 Goods export: buyerAddress, incoterm, incotermDetail, destinationPort, destinationPlace, codeCountry, details[].codeNandina · 5 Free zone: receptionPartyNumber · 9 Foreign currency exchange: currencyOperationType, currencyCode, exchangeRate, officialExchangeRate · 11 Education: studentName, billedPeriod · 13 Utilities: month, gestation, city, zone, meterNumber, customerAddress, consumptionPeriod · 16 Lodging: qtyGuests, qtyRooms, dateEntryLodging · 17 Hospitals and clinics: details[].specialty, details[].doctorSpecialty, details[].doctorName, details[].doctorDocument, details[].doctorRegistrationNumber · 20 Minerals export: buyerAddress, bulkConcentrate, origin, destinationPort, codeCountry, incoterm, lotNumber, netWetKilos, netDryKilos, exchangeRate, exchangeRateAnb, realizationExpenses, details[].codeNandina, details[].gradeDescription, details[].extractionQuantity, details[].extractionUnitMeasure · 21 Domestic minerals sale: buyerAddress, bulkConcentrate, origin, incoterm, lotNumber, netWetKilos, netDryKilos, exchangeRate, exchangeRateAnb, realizationExpenses, details[].codeNandina, details[].gradeDescription, details[].extractionQuantity, details[].extractionUnitMeasure · 28 Services export: buyerAddress, destinationPlace, codeCountry · 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
client_document_typeselectNoClient document type — 5, 1, 2, 3, 4
client_document_numbertextYesDocument number — NIT: 7 to 15 digits (dots and dashes accepted)
client_business_nametextYesBusiness name — The CUCU registry gives the official name from the NIT
client_emailtextNoClient email — If set, CUCU emails the invoice to the client
client_complementtextNoDocument complement
client_codetextNoClient code — Your internal code (sent to SIAT). Empty = the document number
exception_codeselectNoException code (NIT only) — “, 0, 1
payment_method_codenumberNoPayment method (SIAT code) — 1 = cash, 2/3 = card (payment-methods catalog, up to 308)
card_numbertextNoCard number — Only with payment method 2 or 3. CUCU keeps the first and last 4 digits
detailsjsonYesInvoice lines (JSON) — Array of lines: description, quantity, priceUnit and optional amountDiscount, codeProduct, unitMeasure, activityEconomic, codeProductSin. Also accepts cantidad, precio_unitario, descuento… Missing fields come from the defaults below
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)
sector_fieldsjsonNoSector fields (JSON) — Header data of the chosen sector, with CUCU names. Validated before sending
additional_discountnumberNoAdditional discount — Global discount in Bs. SIAT validates total = Σ subtotals − additional discount
gift_card_amountnumberNoGift card amount
currency_codenumberNoCurrency code — Foreign currency only (1 = bolivianos)
exchange_ratenumberNoExchange rate
observationstextNoObservations — Up to 500 characters; shown on the PDF
is_ticketbooleanNoAttach 80 mm ticket to the email
idempotency_modeselectNoDuplicate protection — With a key, a retry after a failure does not duplicate the invoice: CUCU returns the one already issued. For two identical invoices in a loop use a manual key (e.g. the order id) · auto, manual, off
idempotency_keytextNoIdempotency key — 1–255 visible characters, no spaces. Recommended: the sale id
include_rawbooleanNoInclude raw response
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": true,
"replayed": false,
"environment": "production",
"invoice": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"invoiceNumber": 1,
"cuf": "2872F7294502332E637FABFBC3654EA82202AD48E0969F14EBEB8AF74",
"state": "VALIDATED",
"amountTotal": 500
},
"urls": {
"pdf": "https://api.cucu.bo/api/v1/public/invoice/2872F…/pdf",
"xml": "https://api.cucu.bo/api/v1/public/invoice/2872F…/xml",
"verify": "https://api.cucu.bo/f/2872F…"
},
"totals_check": {
"expected": 500,
"actual": 500,
"match": true
},
"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",
"document_sector": "1",
"client_document_number": "1023456789",
"client_business_name": "EMPRESA DEMO S.R.L.",
"details": [
{
"description": "Servicio de desarrollo",
"quantity": 1,
"priceUnit": 500
}
],
"output_key": "cucu"
}
  • Issues one invoice per call. The idempotency key is derived from the body: if the workflow is retried CUCU returns the same invoice instead of duplicating it (replayed: true).
  • Everything is validated before calling the API: tax ID, document types, payment method, sector-specific fields and lines. If something is missing the error says what and nothing is sent.
  • A sk_test_ key means sandbox (no fiscal validity). If the key and the “Environment” field contradict each other nothing is sent.
  • If SIAT is down the invoice may end up in contingency (OFFLINE_PENDING): reported in warnings.
  • Sectors 3 (export) and 9 (multi-currency) are listed as sandbox-only in the CUCU documentation.