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

# LibreDTE routes: migration to the mirror API

> The /api/v3/integration/libredte/chile routes now mirror the LibreDTE API. The previous routes keep working, with deprecation headers, until 6 January 2027.

> [!WARNING]
>
> The routes listed under **Before** are **deprecated** and will be removed on
> **6 January 2027** (`Sunset: Wed, 06 Jan 2027 00:00:00 GMT`). They keep
> their request and response contract until then. Move to the routes under
> **After** at your own pace.

## What changed

`horizon-api` now exposes the LibreDTE API as a **mirror**: same paths, same
path parameter names and same Spanish body and response fields as
[LibreDTE](https://developers.libredte.cl), under
`/api/v3/integration/libredte/chile`. A request you can send to LibreDTE can be
sent to the mirror route with the same body.

* Every response of a deprecated route carries three headers:
  * `Deprecation: true`
  * `Sunset: Wed, 06 Jan 2027 00:00:00 GMT`
  * `Link: <successor path>; rel="successor-version"`
* Mirror routes only act for the issuer configured in the platform. Another
  `emisor` (or `RUTEmisor`) returns `400` with reason
  `libredte_emitter_mismatch`.
* Mirror routes share the outbound LibreDTE rate limit with the deprecated
  routes. A denied call returns `429` with `retry_after_seconds`.
* Mirror routes require their own permission actions (column **Permission**).
  They are not granted to customer roles; ask the platform team to grant them
  to your service account.

## Before and after

All paths are relative to `/api/v3/integration/libredte/chile`.

| Before (deprecated) | After (mirror) | Permission |
| - | - | - |
| `POST /document/draft` | `POST /dte/documentos/emitir` | `integration:libredte:chile:dte:documentos:emitir` |
| `DELETE /document/draft` | `DELETE /dte/dte_tmps/eliminar/{receptor}/{dte}/{codigo}/{emisor}` | `integration:libredte:chile:dte:dte-tmps:eliminar` |
| `POST /document/emit` | `POST /dte/documentos/generar` | `integration:libredte:chile:dte:documentos:generar` |
| `GET /document/pdf` | `GET /dte/dte_emitidos/pdf/{dte}/{folio}/{emisor}` | `integration:libredte:chile:dte:dte-emitidos:pdf` |
| `GET /document/status` | `GET /dte/dte_emitidos/estado/{dte}/{folio}/{emisor}` | `integration:libredte:chile:dte:dte-emitidos:estado` |
| `POST /document/email` | `POST /dte/dte_emitidos/enviar_email/{dte}/{folio}/{emisor}` | `integration:libredte:chile:dte:dte-emitidos:enviar-email` |
| `POST /issued/search` | `POST /dte/dte_emitidos/buscar/{emisor}` | `integration:libredte:chile:dte:dte-emitidos:buscar` |
| `POST /charge/search` | `POST /pagos/cobros/buscar/{emisor}` | `integration:libredte:chile:pagos:cobros:buscar` |
| `POST /charge/info` | `GET /pagos/cobros/info/{codigo}/{emisor}` | `integration:libredte:chile:pagos:cobros:info` |
| `POST /charge/pay` | `POST /pagos/cobros/pagar/{cobro}/{emisor}` | `integration:libredte:chile:pagos:cobros:pagar` |

## Field mapping

The deprecated routes took English fields; the mirror takes the LibreDTE names.

| Deprecated field | Mirror field |
| - | - |
| `emitter` | `emisor` (path) |
| `receiver` | `receptor` |
| `document`, `type` | `dte` |
| `code`, `charge` | `codigo`, `cobro` |
| `format`, `continuous_paper` (query) | `formato`, `papelContinuo` (query) |
| `subject`, `message`, `transferable` | `asunto`, `mensaje`, `cedible` |
| `payment_method`, `payment_date` | `medio`, `fecha` |
| `send_email`, `create_accounting_entry`, `extra_data`, `notification_url` | `enviar_email`, `asiento`, `datos`, `url` |
| `document_type`, `items[]`, `receiver_*` | `Encabezado.IdDoc.TipoDTE`, `Detalle[]`, `Encabezado.Receptor.*` |

## Mirror-only operations

These operations exist only on the mirror. They follow the same rules (configured issuer, shared rate limit, own non-public permission).

| Route | Permission |
| - | - |
| `POST /dte/dte_tmps/actualizar/{receptor}/{dte}/{codigo}/{emisor}?fecha=YYYY-MM-DD` | `integration:libredte:chile:dte:dte-tmps:actualizar` |
| `GET /dte/dte_tmps/pdf/{receptor}/{dte}/{codigo}/{emisor}` | `integration:libredte:chile:dte:dte-tmps:pdf` |
| `GET /dte/dte_emitidos/info/{dte}/{folio}/{emisor}?getXML=1` | `integration:libredte:chile:dte:dte-emitidos:info` |
| `GET /dte/dte_emitidos/xml/{dte}/{folio}/{emisor}` | `integration:libredte:chile:dte:dte-emitidos:xml` |
| `POST /dte/dte_emitidos/actualizar_estado/{dte}/{folio}/{emisor}` | `integration:libredte:chile:dte:dte-emitidos:actualizar-estado` |

## Example

```bash Before theme={null}
curl -X GET \
  "$HORIZON_API/api/v3/integration/libredte/chile/document/status?type=39&folio=10&emitter=76624425" \
  -H "Authorization: Bearer $TOKEN"
```

```bash After theme={null}
curl -X GET \
  "$HORIZON_API/api/v3/integration/libredte/chile/dte/dte_emitidos/estado/39/10/76624425" \
  -H "Authorization: Bearer $TOKEN"
```

## Timeline

| Date | Event |
| - | - |
| 8 October 2026 | Mirror routes available; deprecated routes start sending the headers. |
| 6 January 2027 | Deprecated routes removed, once 30 days pass without external traffic. |


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