build_facturae
Build a Facturae 3.2.2 invoice XML from plain data, compute totals, and check it against the official XSD to catch invalid invoices before signing or sending.
Instructions
Build a Facturae 3.2.2 invoice (XML) from plain data, with totals computed and the official XSD checked.
invoice:
number (max 20), series, issue_date, operation_date?, currency (EUR), description?, notes?,
legal_literals? [text], receiver_contract_reference?,
seller / buyer: nif, name (company name, or first name with first_surname/second_surname for a person),
address, post_code, town, province, country (ISO alfa-3, default ESP), residence? (R/U/E), email?, phone?;
buyer.face: {oficina_contable, organo_gestor, unidad_tramitadora, organo_proponente?} DIR3 codes for
public administration invoices (FACe), or administrative_centres: [{code, role 01-04, name?}],
lines: [{description, quantity, unit_price, tax_rate (21, 10, 4, 0...), discount_pct?, surcharge_rate?
(recargo de equivalencia 5.2, 1.4, 0.5), tax_type? (01 IVA, 03 IGIC, 02 IPSI), unit? (01 unidades),
receiver_reference?, file_reference?, article_code?}],
withholding?: {rate} (IRPF retention, e.g. 15 or 7), payment?: {due_date, method (transferencia,
domiciliacion, efectivo, tarjeta...), iban, bic?}.
Amounts accept "1.234,56" or "1234.56". Returns xml (UTF-8, unsigned), xml_base64, totals and the
validation report. Invalid data is refused before charging. Sign the XML (XAdES) before sending to FACe.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| invoice | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||