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

# Electronic tax documents

> Understand which electronic tax documents the `invoices` product returns, how to tell issued from received documents, and how to read the Servicio de Impuestos Internos (SII) registry and acknowledgment statuses.

This page explains which electronic tax documents the `invoices` product returns, how to classify each document, and how Fintoc keeps them up to date. For every attribute, see the [Invoice object](/api/fiscal-api/fiscal-invoices/fiscal-invoices-object).

## Which documents you get

In Chile, the Servicio de Impuestos Internos (SII) publishes electronic tax documents (Documento Tributario Electrónico, DTE) in the taxpayer's purchase and sales registry (Registro de Compras y Ventas). The registry includes the documents the taxpayer issues or receives. Fee receipts for professional services (boletas de honorarios) live in a separate registry.

A `Link` created with the `invoices` product returns every document in the purchase and sales registry: invoices, credit and debit notes, dispatch guides, settlements, export documents, and receipt summaries. It returns both issued and received documents. It also returns the fee receipts the taxpayer issued and received. [List invoices](/api/fiscal-api/fiscal-invoices/fiscal-invoices-list) and [Get an invoice](/api/fiscal-api/fiscal-invoices/fiscal-invoices-get) return every document as an `Invoice` object, from either registry.

## Issued and received documents

The `issue_type` attribute tells you the direction of the document from the point of view of the taxpayer who owns the `Link`.

| `issue_type` | Meaning                                               | Counterparty                                                         |
| :----------- | :---------------------------------------------------- | :------------------------------------------------------------------- |
| `issued`     | The taxpayer issued the document. It is a sale.       | `receiver` holds the customer's tax ID and name. `issuer` is `null`. |
| `received`   | The taxpayer received the document. It is a purchase. | `issuer` holds the supplier's tax ID and name. `receiver` is `null`. |

Filter by direction with the `issue_type` parameter of [List invoices](/api/fiscal-api/fiscal-invoices/fiscal-invoices-list).

## Classify a document

The `Invoice` object holds the attributes shared by every document. The `institution_invoice` field holds the detail the SII reports for that type of document: type, statuses, value-added tax (VAT) breakdown, and fee receipt data. Use the following attributes to tell the documents apart.

### Document type

`institution_invoice.document_type` is the SII code of the document. For example, `33` is an electronic invoice, `61` is an electronic credit note, and `39` is an electronic receipt. See the full list in [Document types](/guides/movements/fiscal-links/document-types).

`document_type` is `null` for fee receipts, which the SII doesn't code as an electronic tax document (DTE). Identify them with `institution_invoice.is_services_invoice`.

### Fee receipts

When `institution_invoice.is_services_invoice` is `true`, the document is a fee receipt for professional services. `institution_invoice.services_invoice` then holds the receipt's own data: the withheld amount, whether a third party issued it, and its `status` at the SII. Status values are `VIG` (valid), `ANUL` (annulled), `ObR` (observed), and `VCA` (valid with an annulment request). For any other document, `is_services_invoice` is `false` and `services_invoice` is `null`.

### Summary documents

The SII reports some documents as a daily summary instead of one row per document. These are receipts (`35`, `38`, `39`, and `41`), the special monthly voucher (`47`), and electronic payments (`48`). Fintoc returns one `Invoice` per day and document type for them, with the total of the day.

For a summary document, `institution_invoice.total_documents` holds the number of documents grouped. The `number`, `issuer`, and `receiver` attributes are `null`, because the summary has no folio and no single counterparty.

### Registry status

`institution_invoice.invoice_status` tells you in which tab of the purchase and sales registry the SII reports the document.

| `invoice_status` | Meaning                                                                                               |
| :--------------- | :---------------------------------------------------------------------------------------------------- |
| `registered`     | The document is part of the official registry (the SII's **Registro** tab).                           |
| `pending`        | The document was received but awaits acknowledgment from the receiver (the SII's **Pendientes** tab). |

Filter by registry status with the `invoice_status` parameter of [List invoices](/api/fiscal-api/fiscal-invoices/fiscal-invoices-list).

### Acknowledgment status

`institution_invoice.confirmation_status` shows the result of the SII's acknowledgment or claim process (acuse de recibo) for a received invoice. The receiver has 8 calendar days to acknowledge or claim the invoice. If the receiver does nothing, the SII acknowledges it automatically.

| `confirmation_status` | Meaning                                                          |
| :-------------------- | :--------------------------------------------------------------- |
| `C`                   | Acknowledged by the receiver within the term.                    |
| `A`                   | Acknowledged automatically when the term lapsed without a claim. |
| `P`                   | Paid in cash, so no acknowledgment is needed.                    |
| `G`                   | Acknowledged through the dispatch guides of the previous month.  |
| `R`                   | Claimed by the receiver.                                         |
| `null`                | The SII hasn't recorded an event yet.                            |

`null` is not a rejection and does not make the document invalid. The SII reports `null` in three cases: the document is still inside the 8-day term, the document type skips the acknowledgment process (receipts, credit and debit notes, and dispatch guides), or the document is `issued` and the counterparty has not acted. To know where the document stands, use `invoice_status`, `accepted_at`, and `rejected_at`.

### Other attributes

* `institution_invoice.transaction_category` is the classification the taxpayer gives to a received document in the purchase registry, such as `Del Giro` (part of the business activity), `Supermercado`, or `Activo Fijo`. It is `null` when the SII doesn't report it.
* `institution_invoice.has_note` is `true` when a credit or debit note references the document.
* Amounts (`total_amount`, `net_amount`, `institution_invoice.exempt_amount`, `institution_invoice.vat_amount`, and `institution_invoice.other_taxes`) are integers in CLP, the smallest unit of the currency.

## Filter the list

[List invoices](/api/fiscal-api/fiscal-invoices/fiscal-invoices-list) returns the documents sorted by descending `date`, paginated. These parameters narrow the result set.

| Parameter        | Effect                                                                                                                                                                   |
| :--------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `since`, `until` | Only documents with `date` inside the range. Both are ISO 8601 dates.                                                                                                    |
| `updated_since`  | Only documents that Fintoc created or updated on or after this ISO 8601 datetime with timezone offset, for example `2024-01-01T00:00:00Z`. Use it to sync incrementally. |
| `issue_type`     | Only `issued` or only `received` documents.                                                                                                                              |
| `invoice_status` | Only `registered` or only `pending` documents.                                                                                                                           |

## How Fintoc keeps invoices up to date

When your user creates the `Link`, Fintoc fetches the documents of the last 12 months. The documents become available after your user connects. Fintoc then refreshes the `Link` periodically with the refresh interval of your plan. Each refresh fetches the documents of the current and the previous month, because the SII can still change a document after the month closes.

Fintoc sends the `link.refresh_intent.succeeded` event when a refresh finishes. If the refresh does not complete, Fintoc sends `link.refresh_intent.failed`. See the [events reference](/api/main-resources/events-reference/types-of-events) for the payload. To refresh a `Link` created with the `invoices` product on demand, create a [Refresh Intent](/guides/movements/refresh-intents-walkthrough/index).

## Example

A received electronic invoice (`document_type` `33`), already part of the registry:

```json theme={null}
{
  "id": "inv_nMNejK7BT8oGbvO4",
  "object": "invoice",
  "currency": "CLP",
  "date": "2021-06-25T04:00:00.000Z",
  "institution_id": "cl_fiscal_sii",
  "institution_invoice": {
    "accepted_at": "2021-06-26T12:00:00.000Z",
    "common_use_vat": null,
    "confirmation_status": "A",
    "construction_company_credit": 0,
    "container_deposit_guarantee": 0,
    "document_type": 33,
    "domestic_ticket_sales": 0,
    "exempt_amount": 0,
    "exempt_commissions": 0,
    "fixed_assets_net_amount": null,
    "fixed_assets_vat_amount": null,
    "free_zone_tax": 0,
    "has_note": false,
    "international_ticket_sales": 0,
    "invoice_status": "registered",
    "is_services_invoice": false,
    "net_commissions": 0,
    "non_credit_tax_amount": null,
    "non_refundable_vat_amount": null,
    "non_refundable_vat_code": null,
    "non_withheld_vat": 0,
    "other_taxes": {
      "other_taxes_detail": [
        {
          "tax_amount": 400,
          "tax_code": 14,
          "tax_rate": "19"
        }
      ],
      "total_amount": 400
    },
    "out_of_time_vat": 0,
    "own_vat": 0,
    "partial_vat_withheld": 0,
    "receipt_reference_number": null,
    "received_at": "2021-06-25T19:27:04.000Z",
    "reference_number": null,
    "reference_type_code": null,
    "rejected_at": null,
    "services_invoice": null,
    "settlement_issuer_id": null,
    "third_party_vat": 0,
    "tobacco": {
      "cigarettes": 0,
      "cigars": 0,
      "processed_tobacco": 0
    },
    "total_documents": null,
    "total_vat_withheld": 0,
    "transaction_category": "Del Giro",
    "vat_amount": 1900,
    "vat_commissions": null
  },
  "issue_type": "received",
  "issuer": {
    "id": "111111111",
    "institution_tax_payer": null,
    "name": "Test Customer 1"
  },
  "net_amount": 10000,
  "number": "135",
  "receiver": null,
  "tax_period": "06/2021",
  "total_amount": 12300
}
```
