Skip to content

cucuDocumento

Downloads the PDF (A4), signed XML, 80 mm ticket, SIAT ticket, mini ticket or ZIP of an invoice (public links: the CUF acts as the credential), or resends the invoice by email to the client or another address. The download is returned as base64.

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: “Descargar o enviar documento”.

FieldTypeRequiredDescription
credentials_idcredentialsYescucu credential
operationselectNoOperation — download, email
invoice_idtextNoInvoice ID (UUID) — The id CUCU returns on issue. If empty, set the CUF
cuftextNoCUF — Unique Invoice Code. Used when no ID is given
formatselectNoFormat — pdf, xml, ticket, ticketsiat, chititicket, zip, info
emailtextNoDestination email — Resend only. Empty = the client original email
include_contentbooleanNoReturn content (base64) — Turn off if you only need the URL
max_mbnumberNoMax size (MB)
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
{
"operation": "download",
"format": "pdf",
"filename": "factura_2872F7294502.pdf",
"content_type": "application/pdf",
"size": 48213,
"content_base64": "JVBERi0xLjQ…",
"url": "https://api.cucu.bo/api/v1/public/invoice/2872F…/pdf"
}

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",
"operation": "download",
"cuf": "2872F7294502332E637FABFBC3654EA82202AD48E0969F14EBEB8AF74",
"format": "pdf"
}
  • Formats: pdf, ticket, ticketsiat, chititicket, xml and zip. Downloads are public: the CUF acts as credential and the API key is NOT sent.
  • Content is returned as base64 (can be turned off to get just the URL). There is a configurable size cap.
  • It can also resend the invoice by email (to another recipient if given).