HubfiscalUpdateDocument
Description
Section titled “Description”Updates one or more fields of an existing document in the Hub Fiscal database. The document can be identified by its internal Hub ID, the external entity ID (Shopify order ID) or the order number. Only fields with a value are updated — empty fields are ignored to prevent overwriting existing data.
Typical use cases:
- Update status after a fiscal provider responds
- Attach the ticket HTML/PDF after it becomes available
- Record error messages when fiscalization fails
- Update fiscal document number after provider assigns it
Configuration
Section titled “Configuration”| Field | Type | Required | Description |
|---|---|---|---|
| credentials_id | credentials | Yes | Hub Fiscal SQL Server (MSSQL) credential |
| document_id | text | No | Internal Hub Fiscal document ID |
| entity_id | text | No | External entity ID (Shopify order ID) |
| order_number | text | No | Visible order number (e.g. PT14684) |
| status | select | No | New status: pending, processing, completed, failed, voided |
| fiscal_provider | text | No | Fiscal provider name |
| fiscal_doc_id | text | No | Document ID in fiscal provider |
| fiscal_doc_number | text | No | Invoice number from fiscal provider |
| ticket_html | textarea | No | Ticket HTML content. Also reads from data.ticket_html, data.html or data.document.html |
| ticket_pdf | textarea | No | Ticket PDF in base64 |
| contact_name | text | No | Contact name |
| contact_nif | text | No | Contact tax number (NIF) |
| contact_email | text | No | Contact email |
| total_net | text | No | Net total |
| total_tax | text | No | Tax total |
| total_gross | text | No | Gross total |
| error_message | textarea | No | Error message (for failed documents) |
| timeout | text | No | Timeout in milliseconds (default: 30000) |
At least one identifier is required: document_id, entity_id or order_number.
Credentials
Section titled “Credentials”Uses the same credential type as HubfiscalCreateDocument (hubfiscalCreateDocument provider).
Output
Section titled “Output”{ "success": true, "rows_affected": 1, "document": { "id": 42, "entity_id": "6702987051221", "order_number": "PT14684", "status": "completed", "fiscal_doc_number": "FT 2026/1", "total_gross": 19.90 }, "fields_updated": ["status", "fiscal_doc_number", "ticket_html"], "message": "Documento actualizado (3 campos)"}Usage Example
Section titled “Usage Example”Update status and attach ticket after Bill.pt responds:
{ "credentials_id": "10", "entity_id": "{{id}}", "status": "completed", "fiscal_doc_number": "{{document_number}}", "ticket_html": "{{document.html}}"}Mark a document as failed:
{ "credentials_id": "10", "order_number": "PT14684", "status": "failed", "error_message": "Bill.pt API timeout after 30s"}- Only fields with non-empty values are updated; empty fields are ignored
- The update is logged in the Hub Fiscal
logstable automatically - If
document_idis provided, it takes priority overentity_idandorder_number - The
ticket_pdffield accepts base64 input and converts it to binary for storage - Returns
rows_affected: 0if the document was not found (no error thrown)
Related Nodes
Section titled “Related Nodes”- HubfiscalCreateDocument - Create/register document
- HubfiscalGetDocuments - Query and filter documents
- HubfiscalExportPdf - Export PDF/HTML tickets