Skip to main content

build_from_data

Function build_from_data 

Source
pub fn build_from_data(
    data: &InvoiceBuildData,
) -> Result<InvoiceXmlResult, FiscalError>
Expand description

Build an NF-e/NFC-e XML directly from a fully populated InvoiceBuildData.

This is the FFI-friendly alternative to the typestate InvoiceBuilder. Intended for bindings (Node.js, Python, WASM) where the data arrives as a deserialized struct rather than through chainable setters.

Returns InvoiceXmlResult containing the unsigned XML and access key.

ยงErrors

Returns FiscalError if the data is invalid (unknown state code, invalid tax data, etc.).