# Exports

> Markdown edition of https://api.fiz.co/docs/api/exports. Português: https://api.fiz.co/docs/api/exports.md?lang=pt. Index: https://api.fiz.co/llms.txt

Exports of the company’s invoicing data, such as the SAF-T (PT) file. 1 operation.

## Export SAF-T PT

GET `/exports/saft-pt`

Generates SAF-T PT for the entire connected company, including sales documents and customer data. Supply month=YYYY-MM for a full calendar month, or startDate and endDate for an inclusive period; do not combine the two formats. Requires saft\_pt.export or an API key, and export permission. invoicing.read and invoicing.read\_all do not grant this access. Download the XML from the returned URL before it expires.

Authentication: an API key (`x-api-key`) or an OAuth access token.

### Parameters

| Name | In | Type | Description |
| --- | --- | --- | --- |
| `month` | query | string | Full calendar month (YYYY-MM), from the first through the last day, inclusive. An alternative to startDate and endDate; do not combine the two formats. |
| `startDate` | query | string (date) | First day of the period, inclusive (YYYY-MM-DD). Required together with endDate when month is omitted. |
| `endDate` | query | string (date) | Last day of the period, inclusive (YYYY-MM-DD). Required together with startDate when month is omitted; must be on or after startDate. |

**curl**

```shell
curl 'https://api.fiz.co/exports/saft-pt?month=2026-10' \
  --header "x-api-key: $FIZ_API_KEY"
```

**TypeScript**

```ts
import { Fiz } from '@fiz-co/sdk';

const fiz = new Fiz(); // reads FIZ_API_KEY
const result = await fiz.exports.saftPt({
  month: '2026-10',
});
```

**Python**

```python
from fiz_sdk import Fiz

fiz = Fiz()  # reads FIZ_API_KEY
result = fiz.exports.saft_pt({
    "month": "2026-10",
})
```

**PHP**

```php
<?php
require 'vendor/autoload.php';

$fiz = new Fiz\Fiz(); // reads FIZ_API_KEY
$result = $fiz->exports->saftPt([
    'month' => '2026-10',
]);
```

### Response `200`

Temporary download link for the SAF-T PT file

| Field | Type | Description |
| --- | --- | --- |
| `url` | string | Temporary URL for downloading the SAF-T PT XML. Do not share this URL. |
| `createdAt` | string (date-time) · can be null | File creation time, when supplied by the exporter |
| `ttl` | number · can be null | URL lifetime supplied by the exporter, in seconds |

### Errors

-   `400` Invalid period or company invoicing is not configured
-   `401` Missing or invalid authentication
-   `403` No permission to export SAF-T PT for the entire company
-   `429` The OAuth connection’s request limit is reached. Nothing was executed: repeat the same request after Retry-After seconds.
-   `502` The exporter returned no download link

## Errors

Errors share one shape: `statusCode`, `message`, `code` and `error`, with the request id in the `X-Request-Id` header.

## All resources

-   [Company](https://api.fiz.co/docs/api/company) ([Markdown](https://api.fiz.co/docs/api/company.md))
-   [Customers](https://api.fiz.co/docs/api/customers) ([Markdown](https://api.fiz.co/docs/api/customers.md))
-   [Items](https://api.fiz.co/docs/api/items) ([Markdown](https://api.fiz.co/docs/api/items.md))
-   [Invoices](https://api.fiz.co/docs/api/invoices) ([Markdown](https://api.fiz.co/docs/api/invoices.md))
-   [Recurring invoices](https://api.fiz.co/docs/api/recurring-invoices) ([Markdown](https://api.fiz.co/docs/api/recurring-invoices.md))
-   [Pro formas](https://api.fiz.co/docs/api/pro-formas) ([Markdown](https://api.fiz.co/docs/api/pro-formas.md))
-   [Transport documents](https://api.fiz.co/docs/api/transport-documents) ([Markdown](https://api.fiz.co/docs/api/transport-documents.md))
-   [Series](https://api.fiz.co/docs/api/series) ([Markdown](https://api.fiz.co/docs/api/series.md))
-   [PDF templates](https://api.fiz.co/docs/api/pdf-templates) ([Markdown](https://api.fiz.co/docs/api/pdf-templates.md))
-   [Exports](https://api.fiz.co/docs/api/exports) ([Markdown](https://api.fiz.co/docs/api/exports.md))
-   [Expenses](https://api.fiz.co/docs/api/expenses) ([Markdown](https://api.fiz.co/docs/api/expenses.md))
-   [VAT](https://api.fiz.co/docs/api/vat) ([Markdown](https://api.fiz.co/docs/api/vat.md))
-   [Bank](https://api.fiz.co/docs/api/bank) ([Markdown](https://api.fiz.co/docs/api/bank.md))
