---
title: "Get a PDF export"
method: GET
path: "/v1/erp/payouts/payables/pdf_exports/{id}"
tags: ["Payable"]
---

# Get a PDF export

`GET /v1/erp/payouts/payables/pdf_exports/{id}`

## Request

- Base URL: `https://api.cardda.com`
- URL: `https://api.cardda.com/v1/erp/payouts/payables/pdf_exports/{id}`
- Auth: HTTP bearer

Returns a payable PDF export of the current user (exports of other users return `404`).
Exports belong to the user, so the `company-id` header is not used.
Poll this endpoint every few seconds until `status` is `completed`, `failed` or `expired`.

Once `completed`, `files` holds one ZIP per company. Each `files[].url` is signed for
**1 hour** and is re-signed on every call, so request the export again if a link expired.
The ZIP files are purged 7 days after completion (`status` becomes `expired`, `files` is
empty). See `POST /v1/erp/payouts/payables/pdf_exports` for the ZIP layout, the
`indice.csv` format and a full polling example.

## Parameters

- `#/paths/~1v1~1erp~1payouts~1rules~1%7Bid%7D/get/parameters/1` (unresolved $ref)

## Response `200`

The export.

- PdfExport: An asynchronous bulk download of payable PDFs. Created with `POST /v1/erp/payouts/payables/pdf_exports` and polled with `GET /v1/erp/payouts/payables/pdf_exports/{id}` until `status` is `completed`, `failed` or `expired` (after `expired`, create a new export to get the files again). Each completed export produces **one ZIP file per company** (`files[]`). Every ZIP contains one folder per document type that has documents (folders such as `Facturas/`, `Boletas de honorarios/`, `Reembolsos/`, `Anticipos/` or `Otros/`), plus an `indice.csv` index (UTF-8 with BOM, `;` separator) with the columns `Empresa;Fecha emisión;Razón social emisor;RUT emisor;Tipo;Folio;Monto;Estado;Motivo;Archivo` where `Estado` is `incluido` or `falló`, and `Motivo` explains why a document failed (or, for a manual payable without a PDF, that its attachment was included instead).
  - `id` string, uuid, required
  - `status` 'fetching' | 'zipping' | 'completed' | 'failed' | 'expired', required: - `fetching`: the PDFs are being retrieved (stored documents, attachments and, when needed, the SII). - `zipping`: the ZIP files are being built. - `completed`: the ZIP files are ready in `files`. - `failed`: the export could not be completed. - `expired`: the ZIP files were purged (7 days after completion); `files` is empty. Create a new export.
  - `progress` object, required: Counters of the payables in the export. All four are always present.
    - `total` integer, required: Number of payables in the export.
    - `processed` integer, required: Payables already handled (included + failed).
    - `included` integer, required: Payables whose document made it into the ZIP. Includes manual payables without a PDF whose attachments were included instead.
    - `failed` integer, required: Payables whose document could not be obtained. They are still listed in `indice.csv` with `Estado = falló`.
  - `failures_by_reason` object[]: Failed payables grouped by reason, sorted by `count` descending. `manual_without_pdf` is a manual payable with neither a PDF nor attachments; one that has attachments is included (not failed) with its attachments. `stored_file_unreadable` is a PDF stored in Cardda that could not be read; `interrupted` marks the documents still pending when the export failed.
    - `reason` 'manual_without_pdf' | 'missing_admin_key' | 'missing_company_key' | 'missing_bar_code' | 'sii_not_found' | 'sii_timeout' | 'sii_unavailable' | 'sii_session_limit' | 'not_retrieved' | 'fetch_error' | 'stored_file_unreadable' | 'interrupted'
    - `count` integer
    - `message` string: Human-readable explanation (Spanish). Starts in lowercase because it is meant to follow the count, e.g. `137: la empresa no tiene…`.
  - `include_attachments` boolean: Whether the attachments of payables that do have a PDF were included.
  - `company_ids` string[]: Companies covered by the export.
  - `date_from` string, date, nullable: Start of the issue-date range of the exported payables (used in the ZIP filename).
  - `date_to` string, date, nullable: End of the issue-date range of the exported payables (used in the ZIP filename).
  - `created_at` string, date-time
  - `completed_at` string, date-time, nullable
  - `expires_at` string, date-time, nullable: When the ZIP files will be purged (7 days after `completed_at`). `null` until completed.
  - `files` object[], required: One ZIP per company. Empty until `status` is `completed`. Each `url` is a signed link valid for **1 hour** and is re-signed on every `GET`, so fetch the export again to get a fresh link.
    - `company_id` string, uuid
    - `company_name` string
    - `filename` string, required
    - `byte_size` integer
    - `url` string, uri, required: Signed download URL, valid for 1 hour.

## Other responses

- `401`: Unauthorized
- `404`: Export not found (or it belongs to another user)

---

[API](https://skmtc.dev/cardda/apis/erp-api.md) - [All operations](https://skmtc.dev/cardda/apis/erp-api/llms.txt) - [OpenAPI document](https://skmtc.dev/cardda/apis/erp-api/revisions/0730ed26bc3c?raw)
