POST /v1/ecommerce/sales/:id/dte
Issue the electronic tax document (DTE) of an existing sale: a receipt (boleta) or an invoice (factura), paid or on credit.
dte, or one whose DTE failed when it was created with POST /v1/ecommerce/sales.
Endpoint
Required scope
ecommerce:invoicing:issue
ecommerce:invoicing:issue requires the permission to issue DTE in your Keebai role, unless you are the company owner or a superuser. See scopes.Headers
Path parameters
Body
Example request
Response
200 OK
The call answers with what was issued and what failed. A DTE that cannot be issued comes back infailed with its reason, not as an HTTP error.
Failure reasons
400 Bad Request
The body does not match the schema,DUE_DATE_INVALID (due_date is not YYYY-MM-DD or is before today), or dte_issuer_missing: the company has not registered its DTE issuer yet. That is configured in the portal.
401 Unauthorized
Missing, invalid, revoked, or expired token.403 Forbidden
The token does not have theecommerce:invoicing:issue scope.
404 Not Found
No sale with that id, or it belongs to a different company.422 Unprocessable Entity
RECEIVER_DATA_REQUIRED — the invoice receiver is incomplete and the RUT has no stored data to fill it. missing lists the fields. Nothing is issued.
502 Bad Gateway
ECOMMERCE_UPSTREAM_ERROR — the ecommerce service could not answer.
Operational notes
- Branch on
failed, not only on the status. A request that did not issue anything can still succeed at the HTTP level. already_issuedmakes retries safe. Calling again for a sale that already has its DTE does not issue a second one; it comes back infailedwith that reason.- Check the documents first.
GET /v1/ecommerce/invoicing/typestells you whichdocumentvalues the company can issue today and whether it allows credit invoices. - Invoices can go on credit. With credit invoices enabled in Sales › Settings, an invoice on a sale that is not fully paid is issued as a credit invoice with its due date. Record the payment later from the Keebai portal or with the MCP tool
keebai_ecommerce_sale_payment_add. - Read the issued documents with
GET /v1/ecommerce/sales/{id}/documents.
Authorizations
Personal Access Token con prefijo kbai_pk_. Generar desde el portal con permiso developer.manage_tokens.
Path Parameters
Body
invoice (factura), exempt_invoice (factura exenta), receipt (boleta), exempt_receipt (boleta exenta). La factura exige receiver; con un RUT ya facturado basta receiver.rut
invoice, exempt_invoice, receipt, exempt_receipt Vencimiento (YYYY-MM-DD) de una factura emitida a crédito, sobre una venta que no está pagada completa. Sin él, hoy más los días configurados en la empresa. Se ignora si la venta está pagada
"2026-12-10"
Guarda el receptor en el cliente para la próxima factura