> ## Documentation Index
> Fetch the complete documentation index at: https://docs.usecroma.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Electronic invoicing

> Verify any electronic tax document issued in El Salvador against the Ministerio de Hacienda: whether it exists, its status, its sello de recepción and the document as Hacienda registered it.

Every invoice issued in El Salvador is a documento tributario electrónico (DTE) transmitted to the Ministerio de Hacienda, which stamps it with a sello de recepción. Facturas, comprobantes de crédito fiscal, notas de crédito and débito, comprobantes de retención, facturas de exportación and the rest each carry a código de generación, printed on the document and in its QR code.

Give that code, or the QR's link, and get back what Hacienda holds: whether the document exists, its status (received, with notes, adjusted, rejected or invalidated), the sello de recepción, the número de control, the dates, the totals and taxes, and every line. Compare it with the document in hand to tell a real invoice from an altered one. The receptor's identity is never returned.

`POST /sv/hacienda-sv/dte/v1` [Live](https://docs.usecroma.com/live-lookups.md)

One code in, what Hacienda registered out.

| Field | Type | Notes |
| - | - | - |
| `generation_code` | string | **Required.** The document's código de generación, e.g. `3F2504E0-4F89-41D3-9A0C-0305E82C3301`, or the link in its QR code. Case does not matter. |
| `environment` | enum | `production` (the default) for real documents, `test` for documents issued in Hacienda's test environment. Default `production`. |

```bash theme={"dark"}
curl https://api.croma.run/sv/hacienda-sv/dte/v1 \
  -H "Authorization: Bearer $CROMA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "generation_code": "3F2504E0-4F89-41D3-9A0C-0305E82C3301" }'
```

Returns `found`, `generation_code`, `environment`, `status`, `status_code` (Hacienda's own, e.g. `SR`), `status_label`, `description`, `invalidated`, `checked_at` and `document`: `generation_code`, `control_number`, `type_code` (`01` factura, `03` comprobante de crédito fiscal, `05` nota de crédito, and so on), `type`, `version`, `issued_date`, `issued_time`, `processed_at`, `reception_seal`, `currency`, `subtotal`, `taxed_total`, `exempt_total`, `non_subject_total`, `discount_total`, `taxes[]` (`code`, `description`, `amount`), `income_tax_withheld`, `vat_withheld`, `vat_perceived`, `operation_total`, `total`, `total_in_words`, `payment_condition` and `items[]` (`number`, `code`, `description`, `quantity`, `unit_price`, `discount`, `taxed_sale`, `exempt_sale`, `non_subject_sale`).

> [!NOTE]
>
> A code Hacienda does not hold returns `found: false` with HTTP 200, not an error. The code alone identifies a document; no issue date is needed.

> **[Full reference](https://docs.usecroma.com/api-reference/overview.md)**
>
> Schemas, all response fields, and an interactive playground.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.