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

# GET /v1/ecommerce/invoicing/types

> The electronic tax documents (DTE) your company can issue today, and whether it allows credit invoices.

Returns the DTE documents your company can issue right now and whether it allows credit invoices. A document is listed only when the issuer is active, its certificate is installed, and it has folios left for that document.

Read it before offering a receipt (boleta) or an invoice (factura) at your point of sale, so you never send a `dte.document` the company cannot issue.

## Endpoint

```
GET https://api.keebai.com/v1/ecommerce/invoicing/types
```

## Required scope

`ecommerce:invoicing:read`

## Headers

| Header | Required | Value |
| - | - | - |
| `Authorization` | Yes | `Bearer kbai_pk_<token>` |

## Example request

```bash curl theme={"system"}
curl https://api.keebai.com/v1/ecommerce/invoicing/types \
  -H "Authorization: Bearer kbai_pk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
```

```js JavaScript theme={"system"}
const response = await fetch("https://api.keebai.com/v1/ecommerce/invoicing/types", {
  headers: { Authorization: `Bearer ${process.env.KEEBAI_API_TOKEN}` },
});
const { documents, credit_invoices } = await response.json();
```

```python Python theme={"system"}
import os, requests

resp = requests.get(
    "https://api.keebai.com/v1/ecommerce/invoicing/types",
    headers={"Authorization": f"Bearer {os.environ['KEEBAI_API_TOKEN']}"},
    timeout=10,
)
resp.raise_for_status()
documents = resp.json()["documents"]
```

## Response

### 200 OK

```json theme={"system"}
{
  "documents": ["receipt", "invoice"],
  "types": [39, 33],
  "credit_invoices": { "enabled": true, "default_days": 30 },
  "env": "prod"
}
```

| Field | Type | Description |
| - | - | - |
| `documents` | `string[]` | Documents the company can issue today. Send one of these as `dte.document`. See the table below. |
| `types` | `number[]` | The same documents, as SII codes. |
| `credit_invoices` | `object` | `enabled`: whether the company allows invoices on sales that are not fully paid. `default_days`: days until the due date when you send no `due_date`. |
| `env` | `string \| null` | `prod` or `cert` (the tax authority's certification environment). `null` when no document can be issued. |

### Documents

| `document` | SII code | Document |
| - | - | - |
| `receipt` | `39` | Boleta electrónica |
| `exempt_receipt` | `41` | Boleta exenta electrónica |
| `invoice` | `33` | Factura electrónica |
| `exempt_invoice` | `34` | Factura exenta electrónica |

### 401 Unauthorized

Missing, invalid, revoked, or expired token.

### 403 Forbidden

The token does not have the `ecommerce:invoicing:read` scope.

### 502 Bad Gateway

`ECOMMERCE_UPSTREAM_ERROR` — the ecommerce service could not answer.

## Operational notes

* **Credit invoices are a company setting.** They are enabled in **Sales › Settings** in the Keebai portal, off by default. Receipts always need full payment.
* **An empty list means the company cannot issue.** The issuer is not configured or active, the certificate is missing, or the folios ran out. That is fixed in the portal, not through this API.
* **A document can drop out of the list.** When the folios of a document run out, it stops appearing until more are loaded. Read the list again instead of caching it for days.


## OpenAPI

````yaml GET /v1/ecommerce/invoicing/types
openapi: 3.0.0
info:
  title: Keebai Public API
  description: Superficie pública REST autenticada con Personal Access Tokens (PAT).
  version: 1.0.0
  contact: {}
servers:
  - url: https://api.keebai.com
    description: Production
security: []
tags: []
paths:
  /v1/ecommerce/invoicing/types:
    get:
      tags:
        - ecommerce
      summary: Documentos tributarios que la empresa puede emitir
      description: >-
        Los documentos con emisor activo, certificado instalado y folios
        disponibles en el ambiente configurado, y si la empresa permite facturas
        a crédito.
      operationId: PublicEcommerceOperationsController_dteTypes
      parameters: []
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicDteTypesResponseDto'
      security:
        - PAT: []
components:
  schemas:
    PublicDteTypesResponseDto:
      type: object
      properties:
        documents:
          type: array
          description: Documentos que la empresa puede emitir hoy
          items:
            type: string
            enum:
              - invoice
              - exempt_invoice
              - receipt
              - exempt_receipt
        types:
          description: Los mismos documentos, con su código SII
          type: array
          items:
            type: number
        credit_invoices:
          $ref: '#/components/schemas/PublicDteCreditInvoicesDto'
        env:
          type: string
          nullable: true
          description: Ambiente del SII configurado, null sin emisor activo
      required:
        - documents
        - types
        - credit_invoices
        - env
    PublicDteCreditInvoicesDto:
      type: object
      properties:
        enabled:
          type: boolean
          description: La empresa permite emitir facturas a crédito sobre ventas no pagadas
        default_days:
          type: number
          description: Días de vencimiento por defecto
      required:
        - enabled
        - default_days
  securitySchemes:
    PAT:
      scheme: bearer
      bearerFormat: kbai_pk_<hex>
      type: http
      description: >-
        Personal Access Token con prefijo `kbai_pk_`. Generar desde el portal
        con permiso `developer.manage_tokens`.

````

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