# Actions on a document (/en/docs/emision/acciones)

## Retry [#retry]

For a document in `failed` — you ran out of folios (the pre-authorised numbers a document must
carry), the certificate expired, the SII (Chile's tax authority) was down.

```bash
curl -X POST https://api.facturia.cl/v1/documents/doc_01K2R7.../retry \
  -H "Authorization: Bearer $FACTURIA_KEY" -H "Facturia-Empresa: $EMPRESA"
```

It reuses the folio already assigned. &#x2A;*It never creates a second document.**

## Send by email [#send-by-email]

```bash
curl -X POST https://api.facturia.cl/v1/documents/doc_01K2R7.../send \
  -H "Authorization: Bearer $FACTURIA_KEY" -H "Facturia-Empresa: $EMPRESA" \
  -H "Content-Type: application/json" \
  -d '{"to":["pagos@andina.cl"],"attach":["pdf","xml"]}'
```

If you would rather it went out only once the document reaches `accepted`, set `email_document_to` on
the receptor when you issue and do not call this endpoint.

## Annul a document [#anular-un-documento]

> **Trap — In Chile there is no “deleting a factura” (an issued invoice)**
>
> Annulling means issuing a credit note that references the original with code 1. This convenience
> endpoint issues it for you, but the result is a new document, with its own folio, and the original
> stays in the record forever. There is no `DELETE` that makes it disappear, and there never will be.

```bash
curl -X POST https://api.facturia.cl/v1/documents/doc_01K2R7.../credit_note \
  -H "Authorization: Bearer $FACTURIA_KEY" -H "Facturia-Empresa: $EMPRESA" \
  -H "Idempotency-Key: $(uuidgen)" -H "Content-Type: application/json" \
  -d '{"code":1,"reason":"Anula factura por acuerdo comercial"}'
```

The endpoint returns a new `document` (type 61) and links the two: the original gains `annulled_by`
and the note carries `references[0]`.

`code: 2` (corrects text) and `code: 3` (corrects amounts) are accepted too; with `code: 3` you pass
`items` with the corrected amounts.

## Ask whether it is cedible [#ask-whether-it-is-cedible]

```bash
curl -X POST https://api.facturia.cl/v1/documents/doc_01K2R7.../cesion \
  -H "Authorization: Bearer $FACTURIA_KEY" -H "Facturia-Empresa: $EMPRESA"
```

It asks the SII's registry whether that factura can be ceded to a factoring company and stores the
answer in the document's `cesion` object. It is **read-only**: it cedes nothing. All the detail — the
codes, the two rejections and why this is not the same as the printed cedible copy — is in
[Cesibilidad](/en/docs/emision/cesion).

## What does not exist [#what-does-not-exist]

* There is no `PATCH` on an issued document. An accepted DTE (*documento tributario electrónico*,
  Chile's electronic tax document) is a tax record.
* There is no `DELETE`. See above.
* There is no "resend to the SII" separate from `retry`: if the document is `rejected`, the folio is
  burned and the right move is to issue a new one with corrected data.
