API reference
Transport documents
Guias de transporte for goods in transit: drafts, issuing before the goods move, cancellation and PDFs. 8 operations.
List transport documents
GET /transport-documents
Returns a paginated, filterable list of transport documents. By default returns 20 documents starting at offset 0.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
offset | query | number | Number of records to skip (offset) |
limit | query | number | Maximum number of records to return |
sort | query | string | Sort field and order (e.g. movementDate:desc) |
search | query | string | Global search term (number, recipient, etc.) |
movementType | query | string | Filter by movement type One of: GUIA_DE_ATIVOS_PROPRIOS, GUIA_DE_CONSIGNACAO, GUIA_DE_DEVOLUCAO, GUIA_DE_REMESSA, GUIA_DE_TRANSPORTE |
issueStatus | query | string | Filter by issue status One of: CANCELED, DRAFT, ISSUED |
curl 'https://api.fiz.co/transport-documents' \
--header "x-api-key: $FIZ_API_KEY"import { Fiz } from '@fiz-co/sdk';
const fiz = new Fiz(); // reads FIZ_API_KEY
const result = await fiz.transportDocuments.list();from fiz_sdk import Fiz
fiz = Fiz() # reads FIZ_API_KEY
result = fiz.transport_documents.list()<?php
require 'vendor/autoload.php';
$fiz = new Fiz\Fiz(); // reads FIZ_API_KEY
$result = $fiz->transportDocuments->list();Response 200
List of transport documents returned successfully
| Field | Type | Description |
|---|---|---|
[]. | string | |
[]. | string | Document number. On a draft, a provisional number. |
[]. | string · can be null | Unique document code (ATCUD). Null until issued. |
[]. | string · can be null | Identification code the AT assigns when the document is reported. Null until issued. |
[]. | string · can be null | Warning the AT returned when the document was reported, if any. |
[]. | string | Transport document type (GR, GT, GA, GC, GD) One of: GUIA_DE_REMESSA, GUIA_DE_TRANSPORTE, GUIA_DE_ATIVOS_PROPRIOS, GUIA_DE_CONSIGNACAO, GUIA_DE_DEVOLUCAO |
[]. | string | SAF-T status: N normal, T invoiced, A cancelled One of: N, T, A |
[]. | string | Draft, issued (reported to the AT) or cancelled One of: DRAFT, ISSUED, CANCELED |
[]. | string (date-time) | |
[]. | string (date-time) | Start of transport |
[]. | string (date-time) · can be null | |
[]. | string · can be null | Vehicle license plate |
[]. | boolean | false on an unvalued transport document: the PDF shows no prices and the AT receives 0.00. The line prices stay stored. |
[]. | string · can be null | |
[]. | string (date-time) | |
[]. | string (date-time) · can be null | Draft revision. Send it as expectedUpdatedAt when issuing. |
[]. | string (date-time) · can be null | |
[]. | object · can be null | Reporting to the AT. Null on a draft. |
[]. | string | |
[]. | string | |
[]. | string · can be null | |
[]. | string · can be null | |
[]. | string · can be null | |
[]. | boolean · can be null | |
[]. | string (date-time) | |
[]. | object | |
[]. | string | |
[]. | object | |
[]. | string | |
[]. | string | |
[]. | string | |
[]. | string | |
[]. | string | |
[]. | string | |
[]. | object · can be null | |
[]. | string · can be null | |
[]. | object | |
[]. | string | |
[]. | string · can be null | |
[]. | string · can be null | |
[]. | string · can be null | |
[]. | string · can be null | |
[]. | string · can be null | |
[]. | object | |
[]. | string · can be null | Saved address this one was copied from |
[]. | string | |
[]. | string | |
[]. | string | |
[]. | string | |
[]. | string | |
[]. | object · can be null | |
[]. | string · can be null | Saved address this one was copied from |
[]. | string | |
[]. | string | |
[]. | string | |
[]. | string | |
[]. | string | |
[]. | object[] · can be null | |
[]. | string · can be null | Catalogue item sent on the line |
[]. | object · can be null | |
[]. | number · can be null | |
[]. | number · can be null | |
[]. | number · can be null | |
[]. | number · can be null | |
[]. | object · can be null | |
[]. | string · can be null | |
[]. | string · can be null | |
[]. | string | One of: PRODUCT, SERVICE |
[]. | number · can be null | |
[]. | string · can be null | |
[]. | string · can be null | One of: NORMAL, INTERMEDIATE, REDUCED, EXEMPT |
[]. | string · can be null |
Errors
400Invalid parameters401Unauthorized - API key missing or invalid429The OAuth connection’s request limit is reached. Nothing was executed: repeat the same request after Retry-After seconds.
Create draft transport document
POST /transport-documents
Creates a draft transport document without issuing it or reporting it to the AT. Use POST /transport-documents/{id}/issue to issue and report it to the AT.
Request body
Data required to create the draft transport document
| Field | Type | Description |
|---|---|---|
movementType required | string | Movement type. GUIA_DE_REMESSA (delivery to a customer), GUIA_DE_DEVOLUCAO (return), GUIA_DE_TRANSPORTE (generic transport), GUIA_DE_ATIVOS_PROPRIOS (transfer between own facilities), GUIA_DE_CONSIGNACAO (consignment). One of: GUIA_DE_ATIVOS_PROPRIOS, GUIA_DE_CONSIGNACAO, GUIA_DE_DEVOLUCAO, GUIA_DE_REMESSA, GUIA_DE_TRANSPORTE |
movementDate required | string | Movement date (ISO 8601 with timezone). Cannot be earlier than today — the transport document must be reported to the AT before the transport starts. |
movementStartTime required | string | Loading date/time (ISO 8601 with timezone). Must be in the future: the transport document is issued before the goods leave, and the AT refuses it after that time. |
movementEndTime | string | Expected unloading date/time (optional, ISO 8601 with timezone) |
addressFrom required | object | Loading location |
addressFrom. required | string | Location name (e.g. warehouse, store, facility) |
addressFrom. required | string | Address (street, number, floor) |
addressFrom. required | string | Postal code |
addressFrom. required | string | Locality |
addressFrom. required | string | Country (ISO 3166-1 alpha-2 code) |
addressFrom. | string | Identifier of a saved address (optional). Links this address to an address book record. |
addressTo | object | Unloading location (optional) |
addressTo. required | string | Location name (e.g. warehouse, store, facility) |
addressTo. required | string | Address (street, number, floor) |
addressTo. required | string | Postal code |
addressTo. required | string | Locality |
addressTo. required | string | Country (ISO 3166-1 alpha-2 code) |
addressTo. | string | Identifier of a saved address (optional). Links this address to an address book record. |
customer | object | Recipient of the goods. Required for all movement types except GUIA_DE_ATIVOS_PROPRIOS (movement of own assets). Only Portuguese recipients (country = "PT") are accepted — transport documents are reported to the Portuguese AT. |
customer. required | object | Recipient data |
customer. required | string | Recipient name |
customer. | string | Recipient NIF (tax number) |
customer. | string | Recipient address |
customer. | string | Recipient postal code |
customer. | string | Recipient locality |
customer. | string | Recipient country (ISO 3166-1 alpha-2) |
customer. | string | Identifier of an existing customer (optional). Use the "id" returned by GET /customers. |
isValued | boolean | Valued transport document (optional, default true). With false the document is unvalued (guia não valorizada): the PDF shows no prices and every line is reported to the AT with a unit price of 0.00. Use it when goods move without a sale (return, transfer, consignment). The line prices stay stored and apply again if the document is made valued again. |
vehicleID | string | Vehicle license plate (optional) |
items required | object[] | Transported goods and their quantities |
items[]. required | string | Item identifier. Use the "id" returned by GET /items. |
items[]. required | number | Transported quantity |
# Once per operation. Keep it and reuse it on every retry.
IDEMPOTENCY_KEY=$(uuidgen)curl --request POST 'https://api.fiz.co/transport-documents' \
--header "x-api-key: $FIZ_API_KEY" \
--header 'Content-Type: application/json' \
--header "Idempotency-Key: ${IDEMPOTENCY_KEY:?set the operation key first, in the step above}" \
--data '{
"movementType": "GUIA_DE_REMESSA",
"movementDate": "2026-11-27T08:00:00.000Z",
"movementStartTime": "2026-11-27T08:30:00.000Z",
"addressFrom": {
"name": "Armazém Lisboa",
"addressDetail": "Rua da Prata, 12, 2.º",
"postalCode": "1100-052",
"city": "Lisboa",
"country": "PT"
},
"items": [
{
"id": "68483e978073231c3947077c",
"quantity": 10
}
],
"customer": {
"data": {
"name": "Padaria Central, Lda"
}
}
}'import { Fiz } from '@fiz-co/sdk';
const fiz = new Fiz(); // reads FIZ_API_KEY
const result = await fiz.transportDocuments.create({
movementType: 'GUIA_DE_REMESSA',
movementDate: '2026-11-27T08:00:00.000Z',
movementStartTime: '2026-11-27T08:30:00.000Z',
addressFrom: {
name: 'Armazém Lisboa',
addressDetail: 'Rua da Prata, 12, 2.º',
postalCode: '1100-052',
city: 'Lisboa',
country: 'PT',
},
items: [
{
id: '68483e978073231c3947077c',
quantity: 10,
},
],
customer: {
data: {
name: 'Padaria Central, Lda',
},
},
});from fiz_sdk import Fiz
fiz = Fiz() # reads FIZ_API_KEY
result = fiz.transport_documents.create({
"movementType": "GUIA_DE_REMESSA",
"movementDate": "2026-11-27T08:00:00.000Z",
"movementStartTime": "2026-11-27T08:30:00.000Z",
"addressFrom": {
"name": "Armazém Lisboa",
"addressDetail": "Rua da Prata, 12, 2.º",
"postalCode": "1100-052",
"city": "Lisboa",
"country": "PT",
},
"items": [
{
"id": "68483e978073231c3947077c",
"quantity": 10,
},
],
"customer": {
"data": {
"name": "Padaria Central, Lda",
},
},
})<?php
require 'vendor/autoload.php';
$fiz = new Fiz\Fiz(); // reads FIZ_API_KEY
$result = $fiz->transportDocuments->create([
'movementType' => 'GUIA_DE_REMESSA',
'movementDate' => '2026-11-27T08:00:00.000Z',
'movementStartTime' => '2026-11-27T08:30:00.000Z',
'addressFrom' => [
'name' => 'Armazém Lisboa',
'addressDetail' => 'Rua da Prata, 12, 2.º',
'postalCode' => '1100-052',
'city' => 'Lisboa',
'country' => 'PT',
],
'items' => [
[
'id' => '68483e978073231c3947077c',
'quantity' => 10,
],
],
'customer' => [
'data' => [
'name' => 'Padaria Central, Lda',
],
],
]);Response 201
Draft transport document created successfully
| Field | Type | Description |
|---|---|---|
id | string | |
documentNumber | string | Document number. On a draft, a provisional number. |
atcud | string · can be null | Unique document code (ATCUD). Null until issued. |
atDocCodeID | string · can be null | Identification code the AT assigns when the document is reported. Null until issued. |
atWarning | string · can be null | Warning the AT returned when the document was reported, if any. |
movementType | string | Transport document type (GR, GT, GA, GC, GD) One of: GUIA_DE_REMESSA, GUIA_DE_TRANSPORTE, GUIA_DE_ATIVOS_PROPRIOS, GUIA_DE_CONSIGNACAO, GUIA_DE_DEVOLUCAO |
movementStatus | string | SAF-T status: N normal, T invoiced, A cancelled One of: N, T, A |
issueStatus | string | Draft, issued (reported to the AT) or cancelled One of: DRAFT, ISSUED, CANCELED |
movementDate | string (date-time) | |
movementStartTime | string (date-time) | Start of transport |
movementEndTime | string (date-time) · can be null | |
vehicleID | string · can be null | Vehicle license plate |
isValued | boolean | false on an unvalued transport document: the PDF shows no prices and the AT receives 0.00. The line prices stay stored. |
unitId | string · can be null | |
createdAt | string (date-time) | |
updatedAt | string (date-time) · can be null | Draft revision. Send it as expectedUpdatedAt when issuing. |
canceledAt | string (date-time) · can be null | |
syncWithAt | object · can be null | Reporting to the AT. Null on a draft. |
syncWithAt. | string | |
syncWithAt. | string | |
syncWithAt. | string · can be null | |
syncWithAt. | string · can be null | |
syncWithAt. | string · can be null | |
syncWithAt. | boolean · can be null | |
syncWithAt. | string (date-time) | |
issuer | object | |
issuer. | string | |
issuer. | object | |
issuer. | string | |
issuer. | string | |
issuer. | string | |
issuer. | string | |
issuer. | string | |
issuer. | string | |
customer | object · can be null | |
customer. | string · can be null | |
customer. | object | |
customer. | string | |
customer. | string · can be null | |
customer. | string · can be null | |
customer. | string · can be null | |
customer. | string · can be null | |
customer. | string · can be null | |
addressFrom | object | |
addressFrom. | string · can be null | Saved address this one was copied from |
addressFrom. | string | |
addressFrom. | string | |
addressFrom. | string | |
addressFrom. | string | |
addressFrom. | string | |
addressTo | object · can be null | |
addressTo. | string · can be null | Saved address this one was copied from |
addressTo. | string | |
addressTo. | string | |
addressTo. | string | |
addressTo. | string | |
addressTo. | string | |
items | object[] · can be null | |
items[]. | string · can be null | Catalogue item sent on the line |
items[]. | object · can be null | |
items[]. | number · can be null | |
items[]. | number · can be null | |
items[]. | number · can be null | |
items[]. | number · can be null | |
items[]. | object · can be null | |
items[]. | string · can be null | |
items[]. | string · can be null | |
items[]. | string | One of: PRODUCT, SERVICE |
items[]. | number · can be null | |
items[]. | string · can be null | |
items[]. | string · can be null | One of: NORMAL, INTERMEDIATE, REDUCED, EXEMPT |
items[]. | string · can be null |
Errors
400Invalid data401Unauthorized - API key missing or invalid409A request with this idempotency key is still being processed, or the outcome of the first attempt is unknown422The idempotency key was already used with a different request body429The OAuth connection’s request limit is reached. Nothing was executed: repeat the same request after Retry-After seconds.
Get transport document by ID
GET /transport-documents/{id}
Returns a transport document, including ATCUD, document number and the AT communication status (syncWithAt).
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id required | path | string | Transport document identifier |
curl 'https://api.fiz.co/transport-documents/ID' \
--header "x-api-key: $FIZ_API_KEY"import { Fiz } from '@fiz-co/sdk';
const fiz = new Fiz(); // reads FIZ_API_KEY
const result = await fiz.transportDocuments.retrieve('ID');from fiz_sdk import Fiz
fiz = Fiz() # reads FIZ_API_KEY
result = fiz.transport_documents.retrieve("ID")<?php
require 'vendor/autoload.php';
$fiz = new Fiz\Fiz(); // reads FIZ_API_KEY
$result = $fiz->transportDocuments->retrieve('ID');Response 200
Transport document found
| Field | Type | Description |
|---|---|---|
id | string | |
documentNumber | string | Document number. On a draft, a provisional number. |
atcud | string · can be null | Unique document code (ATCUD). Null until issued. |
atDocCodeID | string · can be null | Identification code the AT assigns when the document is reported. Null until issued. |
atWarning | string · can be null | Warning the AT returned when the document was reported, if any. |
movementType | string | Transport document type (GR, GT, GA, GC, GD) One of: GUIA_DE_REMESSA, GUIA_DE_TRANSPORTE, GUIA_DE_ATIVOS_PROPRIOS, GUIA_DE_CONSIGNACAO, GUIA_DE_DEVOLUCAO |
movementStatus | string | SAF-T status: N normal, T invoiced, A cancelled One of: N, T, A |
issueStatus | string | Draft, issued (reported to the AT) or cancelled One of: DRAFT, ISSUED, CANCELED |
movementDate | string (date-time) | |
movementStartTime | string (date-time) | Start of transport |
movementEndTime | string (date-time) · can be null | |
vehicleID | string · can be null | Vehicle license plate |
isValued | boolean | false on an unvalued transport document: the PDF shows no prices and the AT receives 0.00. The line prices stay stored. |
unitId | string · can be null | |
createdAt | string (date-time) | |
updatedAt | string (date-time) · can be null | Draft revision. Send it as expectedUpdatedAt when issuing. |
canceledAt | string (date-time) · can be null | |
syncWithAt | object · can be null | Reporting to the AT. Null on a draft. |
syncWithAt. | string | |
syncWithAt. | string | |
syncWithAt. | string · can be null | |
syncWithAt. | string · can be null | |
syncWithAt. | string · can be null | |
syncWithAt. | boolean · can be null | |
syncWithAt. | string (date-time) | |
issuer | object | |
issuer. | string | |
issuer. | object | |
issuer. | string | |
issuer. | string | |
issuer. | string | |
issuer. | string | |
issuer. | string | |
issuer. | string | |
customer | object · can be null | |
customer. | string · can be null | |
customer. | object | |
customer. | string | |
customer. | string · can be null | |
customer. | string · can be null | |
customer. | string · can be null | |
customer. | string · can be null | |
customer. | string · can be null | |
addressFrom | object | |
addressFrom. | string · can be null | Saved address this one was copied from |
addressFrom. | string | |
addressFrom. | string | |
addressFrom. | string | |
addressFrom. | string | |
addressFrom. | string | |
addressTo | object · can be null | |
addressTo. | string · can be null | Saved address this one was copied from |
addressTo. | string | |
addressTo. | string | |
addressTo. | string | |
addressTo. | string | |
addressTo. | string | |
items | object[] · can be null | |
items[]. | string · can be null | Catalogue item sent on the line |
items[]. | object · can be null | |
items[]. | number · can be null | |
items[]. | number · can be null | |
items[]. | number · can be null | |
items[]. | number · can be null | |
items[]. | object · can be null | |
items[]. | string · can be null | |
items[]. | string · can be null | |
items[]. | string | One of: PRODUCT, SERVICE |
items[]. | number · can be null | |
items[]. | string · can be null | |
items[]. | string · can be null | One of: NORMAL, INTERMEDIATE, REDUCED, EXEMPT |
items[]. | string · can be null |
Errors
401Unauthorized - API key missing or invalid404Transport document not found429The OAuth connection’s request limit is reached. Nothing was executed: repeat the same request after Retry-After seconds.
Update draft transport document
PATCH /transport-documents/{id}
Updates a draft transport document. Only the sent fields are changed. Only draft (DRAFT) transport documents can be updated.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id required | path | string | Transport document identifier |
Request body
Fields to update
| Field | Type | Description |
|---|---|---|
movementType | string | Movement type One of: GUIA_DE_ATIVOS_PROPRIOS, GUIA_DE_CONSIGNACAO, GUIA_DE_DEVOLUCAO, GUIA_DE_REMESSA, GUIA_DE_TRANSPORTE |
movementDate | string | Movement date (ISO 8601 with timezone). Cannot be earlier than today. |
movementStartTime | string | Loading date/time (ISO 8601 with timezone). Must be in the future: the transport document is issued before the goods leave, and the AT refuses it after that time. |
movementEndTime | string | Expected unloading date/time (ISO 8601 with timezone) |
addressFrom | object | Loading location |
addressFrom. required | string | Location name (e.g. warehouse, store, facility) |
addressFrom. required | string | Address (street, number, floor) |
addressFrom. required | string | Postal code |
addressFrom. required | string | Locality |
addressFrom. required | string | Country (ISO 3166-1 alpha-2 code) |
addressFrom. | string | Identifier of a saved address (optional). Links this address to an address book record. |
addressTo | object | Unloading location |
addressTo. required | string | Location name (e.g. warehouse, store, facility) |
addressTo. required | string | Address (street, number, floor) |
addressTo. required | string | Postal code |
addressTo. required | string | Locality |
addressTo. required | string | Country (ISO 3166-1 alpha-2 code) |
addressTo. | string | Identifier of a saved address (optional). Links this address to an address book record. |
customer | object | Recipient of the goods |
customer. required | object | Recipient data |
customer. required | string | Recipient name |
customer. | string | Recipient NIF (tax number) |
customer. | string | Recipient address |
customer. | string | Recipient postal code |
customer. | string | Recipient locality |
customer. | string | Recipient country (ISO 3166-1 alpha-2) |
customer. | string | Identifier of an existing customer (optional). Use the "id" returned by GET /customers. |
isValued | boolean | Valued transport document (optional, default true). With false the document is unvalued (guia não valorizada): the PDF shows no prices and every line is reported to the AT with a unit price of 0.00. Use it when goods move without a sale (return, transfer, consignment). The line prices stay stored and apply again if the document is made valued again. |
vehicleID | string | Vehicle license plate |
items | object[] | Transported goods and their quantities |
items[]. required | string | Item identifier. Use the "id" returned by GET /items. |
items[]. required | number | Transported quantity |
# Once per operation. Keep it and reuse it on every retry.
IDEMPOTENCY_KEY=$(uuidgen)curl --request PATCH 'https://api.fiz.co/transport-documents/ID' \
--header "x-api-key: $FIZ_API_KEY" \
--header 'Content-Type: application/json' \
--header "Idempotency-Key: ${IDEMPOTENCY_KEY:?set the operation key first, in the step above}" \
--data '{
"movementType": "GUIA_DE_REMESSA",
"movementDate": "2026-11-27T08:00:00.000Z",
"movementStartTime": "2026-11-27T08:30:00.000Z"
}'import { Fiz } from '@fiz-co/sdk';
const fiz = new Fiz(); // reads FIZ_API_KEY
const result = await fiz.transportDocuments.update('ID', {
movementType: 'GUIA_DE_REMESSA',
movementDate: '2026-11-27T08:00:00.000Z',
movementStartTime: '2026-11-27T08:30:00.000Z',
});from fiz_sdk import Fiz
fiz = Fiz() # reads FIZ_API_KEY
result = fiz.transport_documents.update("ID", {
"movementType": "GUIA_DE_REMESSA",
"movementDate": "2026-11-27T08:00:00.000Z",
"movementStartTime": "2026-11-27T08:30:00.000Z",
})<?php
require 'vendor/autoload.php';
$fiz = new Fiz\Fiz(); // reads FIZ_API_KEY
$result = $fiz->transportDocuments->update('ID', [
'movementType' => 'GUIA_DE_REMESSA',
'movementDate' => '2026-11-27T08:00:00.000Z',
'movementStartTime' => '2026-11-27T08:30:00.000Z',
]);Response 200
Transport document updated successfully
| Field | Type | Description |
|---|---|---|
id | string | |
documentNumber | string | Document number. On a draft, a provisional number. |
atcud | string · can be null | Unique document code (ATCUD). Null until issued. |
atDocCodeID | string · can be null | Identification code the AT assigns when the document is reported. Null until issued. |
atWarning | string · can be null | Warning the AT returned when the document was reported, if any. |
movementType | string | Transport document type (GR, GT, GA, GC, GD) One of: GUIA_DE_REMESSA, GUIA_DE_TRANSPORTE, GUIA_DE_ATIVOS_PROPRIOS, GUIA_DE_CONSIGNACAO, GUIA_DE_DEVOLUCAO |
movementStatus | string | SAF-T status: N normal, T invoiced, A cancelled One of: N, T, A |
issueStatus | string | Draft, issued (reported to the AT) or cancelled One of: DRAFT, ISSUED, CANCELED |
movementDate | string (date-time) | |
movementStartTime | string (date-time) | Start of transport |
movementEndTime | string (date-time) · can be null | |
vehicleID | string · can be null | Vehicle license plate |
isValued | boolean | false on an unvalued transport document: the PDF shows no prices and the AT receives 0.00. The line prices stay stored. |
unitId | string · can be null | |
createdAt | string (date-time) | |
updatedAt | string (date-time) · can be null | Draft revision. Send it as expectedUpdatedAt when issuing. |
canceledAt | string (date-time) · can be null | |
syncWithAt | object · can be null | Reporting to the AT. Null on a draft. |
syncWithAt. | string | |
syncWithAt. | string | |
syncWithAt. | string · can be null | |
syncWithAt. | string · can be null | |
syncWithAt. | string · can be null | |
syncWithAt. | boolean · can be null | |
syncWithAt. | string (date-time) | |
issuer | object | |
issuer. | string | |
issuer. | object | |
issuer. | string | |
issuer. | string | |
issuer. | string | |
issuer. | string | |
issuer. | string | |
issuer. | string | |
customer | object · can be null | |
customer. | string · can be null | |
customer. | object | |
customer. | string | |
customer. | string · can be null | |
customer. | string · can be null | |
customer. | string · can be null | |
customer. | string · can be null | |
customer. | string · can be null | |
addressFrom | object | |
addressFrom. | string · can be null | Saved address this one was copied from |
addressFrom. | string | |
addressFrom. | string | |
addressFrom. | string | |
addressFrom. | string | |
addressFrom. | string | |
addressTo | object · can be null | |
addressTo. | string · can be null | Saved address this one was copied from |
addressTo. | string | |
addressTo. | string | |
addressTo. | string | |
addressTo. | string | |
addressTo. | string | |
items | object[] · can be null | |
items[]. | string · can be null | Catalogue item sent on the line |
items[]. | object · can be null | |
items[]. | number · can be null | |
items[]. | number · can be null | |
items[]. | number · can be null | |
items[]. | number · can be null | |
items[]. | object · can be null | |
items[]. | string · can be null | |
items[]. | string · can be null | |
items[]. | string | One of: PRODUCT, SERVICE |
items[]. | number · can be null | |
items[]. | string · can be null | |
items[]. | string · can be null | One of: NORMAL, INTERMEDIATE, REDUCED, EXEMPT |
items[]. | string · can be null |
Errors
400Invalid data or transport document already issued401Unauthorized - API key missing or invalid404Transport document not found409A request with this idempotency key is still being processed, or the outcome of the first attempt is unknown422The idempotency key was already used with a different request body429The OAuth connection’s request limit is reached. Nothing was executed: repeat the same request after Retry-After seconds.
Delete draft transport document
DELETE /transport-documents/{id}
Deletes a draft transport document. Already issued documents cannot be deleted — use POST /transport-documents/{id}/cancel to cancel them.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id required | path | string | Transport document identifier |
# Once per operation. Keep it and reuse it on every retry.
IDEMPOTENCY_KEY=$(uuidgen)curl --request DELETE 'https://api.fiz.co/transport-documents/ID' \
--header "x-api-key: $FIZ_API_KEY" \
--header "Idempotency-Key: ${IDEMPOTENCY_KEY:?set the operation key first, in the step above}"import { Fiz } from '@fiz-co/sdk';
const fiz = new Fiz(); // reads FIZ_API_KEY
const result = await fiz.transportDocuments.delete('ID');from fiz_sdk import Fiz
fiz = Fiz() # reads FIZ_API_KEY
result = fiz.transport_documents.delete("ID")<?php
require 'vendor/autoload.php';
$fiz = new Fiz\Fiz(); // reads FIZ_API_KEY
$result = $fiz->transportDocuments->delete('ID');Response 200
Transport document deleted successfully
| Field | Type | Description |
|---|---|---|
id | string | |
documentNumber | string | Document number. On a draft, a provisional number. |
atcud | string · can be null | Unique document code (ATCUD). Null until issued. |
atDocCodeID | string · can be null | Identification code the AT assigns when the document is reported. Null until issued. |
atWarning | string · can be null | Warning the AT returned when the document was reported, if any. |
movementType | string | Transport document type (GR, GT, GA, GC, GD) One of: GUIA_DE_REMESSA, GUIA_DE_TRANSPORTE, GUIA_DE_ATIVOS_PROPRIOS, GUIA_DE_CONSIGNACAO, GUIA_DE_DEVOLUCAO |
movementStatus | string | SAF-T status: N normal, T invoiced, A cancelled One of: N, T, A |
issueStatus | string | Draft, issued (reported to the AT) or cancelled One of: DRAFT, ISSUED, CANCELED |
movementDate | string (date-time) | |
movementStartTime | string (date-time) | Start of transport |
movementEndTime | string (date-time) · can be null | |
vehicleID | string · can be null | Vehicle license plate |
isValued | boolean | false on an unvalued transport document: the PDF shows no prices and the AT receives 0.00. The line prices stay stored. |
unitId | string · can be null | |
createdAt | string (date-time) | |
updatedAt | string (date-time) · can be null | Draft revision. Send it as expectedUpdatedAt when issuing. |
canceledAt | string (date-time) · can be null | |
syncWithAt | object · can be null | Reporting to the AT. Null on a draft. |
syncWithAt. | string | |
syncWithAt. | string | |
syncWithAt. | string · can be null | |
syncWithAt. | string · can be null | |
syncWithAt. | string · can be null | |
syncWithAt. | boolean · can be null | |
syncWithAt. | string (date-time) | |
issuer | object | |
issuer. | string | |
issuer. | object | |
issuer. | string | |
issuer. | string | |
issuer. | string | |
issuer. | string | |
issuer. | string | |
issuer. | string | |
customer | object · can be null | |
customer. | string · can be null | |
customer. | object | |
customer. | string | |
customer. | string · can be null | |
customer. | string · can be null | |
customer. | string · can be null | |
customer. | string · can be null | |
customer. | string · can be null | |
addressFrom | object | |
addressFrom. | string · can be null | Saved address this one was copied from |
addressFrom. | string | |
addressFrom. | string | |
addressFrom. | string | |
addressFrom. | string | |
addressFrom. | string | |
addressTo | object · can be null | |
addressTo. | string · can be null | Saved address this one was copied from |
addressTo. | string | |
addressTo. | string | |
addressTo. | string | |
addressTo. | string | |
addressTo. | string | |
items | object[] · can be null | |
items[]. | string · can be null | Catalogue item sent on the line |
items[]. | object · can be null | |
items[]. | number · can be null | |
items[]. | number · can be null | |
items[]. | number · can be null | |
items[]. | number · can be null | |
items[]. | object · can be null | |
items[]. | string · can be null | |
items[]. | string · can be null | |
items[]. | string | One of: PRODUCT, SERVICE |
items[]. | number · can be null | |
items[]. | string · can be null | |
items[]. | string · can be null | One of: NORMAL, INTERMEDIATE, REDUCED, EXEMPT |
items[]. | string · can be null |
Errors
400Transport document already issued — cannot be deleted401Unauthorized - API key missing or invalid404Transport document not found409A request with this idempotency key is still being processed, or the outcome of the first attempt is unknown422The idempotency key was already used with a different request body429The OAuth connection’s request limit is reached. Nothing was executed: repeat the same request after Retry-After seconds.
Issue transport document
POST /transport-documents/{id}/issue
Issues the transport document and reports it to the AT. The document becomes ISSUED and receives a document number and ATCUD. The AT communication status is returned in "syncWithAt" (PROCESSING, SYNCED or FAILED). Reporting to the AT requires the account to have AT synchronization enabled and validated credentials. The document must be issued before the loading time (movementStartTime): after it, issuing is refused with 400 and the document has to be corrected with PATCH /transport-documents/{id}. Portuguese postal codes must be in the NNNN-NNN format. Issuing is a fiscal act and cannot be undone; an issued document can only be cancelled (POST /transport-documents/{id}/cancel) before the transport starts.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id required | path | string | Transport document identifier |
Request body
| Field | Type | Description |
|---|---|---|
expectedUpdatedAt | string (date-time) | The transport document version you verified (updatedAt, or createdAt if it was never changed). Issuing is refused with 409 if the document changed in the meantime. |
# Once per operation. Keep it and reuse it on every retry.
IDEMPOTENCY_KEY=$(uuidgen)curl --request POST 'https://api.fiz.co/transport-documents/ID/issue' \
--header "x-api-key: $FIZ_API_KEY" \
--header 'Content-Type: application/json' \
--header "Idempotency-Key: ${IDEMPOTENCY_KEY:?set the operation key first, in the step above}" \
--data '{
"expectedUpdatedAt": "2026-01-31T10:00:00.000Z"
}'# Once per fiscal operation, before the call. Store it with the document:
# a retry after a lost response reuses it and gets the recorded result, or a 409
# without Retry-After when the outcome is unknown: then check the document first.
export IDEMPOTENCY_KEY=$(uuidgen)import { Fiz } from '@fiz-co/sdk';
const fiz = new Fiz(); // reads FIZ_API_KEY
const idempotencyKey = process.env.IDEMPOTENCY_KEY; // from the step above, the same on every retry
if (!idempotencyKey) throw new Error('Set IDEMPOTENCY_KEY first, in the step above');
const result = await fiz.transportDocuments.issue('ID', {
expectedUpdatedAt: '2026-01-31T10:00:00.000Z',
}, { idempotencyKey });# Once per fiscal operation, before the call. Store it with the document:
# a retry after a lost response reuses it and gets the recorded result, or a 409
# without Retry-After when the outcome is unknown: then check the document first.
export IDEMPOTENCY_KEY=$(uuidgen)import os
from fiz_sdk import Fiz
fiz = Fiz() # reads FIZ_API_KEY
idempotency_key = os.environ["IDEMPOTENCY_KEY"] # from the step above, the same on every retry
result = fiz.transport_documents.issue("ID", {
"expectedUpdatedAt": "2026-01-31T10:00:00.000Z",
}, idempotency_key=idempotency_key)# Once per fiscal operation, before the call. Store it with the document:
# a retry after a lost response reuses it and gets the recorded result, or a 409
# without Retry-After when the outcome is unknown: then check the document first.
export IDEMPOTENCY_KEY=$(uuidgen)<?php
require 'vendor/autoload.php';
$fiz = new Fiz\Fiz(); // reads FIZ_API_KEY
// from the step above, the same on every retry
$idempotencyKey = getenv('IDEMPOTENCY_KEY') ?: throw new RuntimeException('Set IDEMPOTENCY_KEY first, in the step above');
$result = $fiz->transportDocuments->issue('ID', [
'expectedUpdatedAt' => '2026-01-31T10:00:00.000Z',
], ['idempotencyKey' => $idempotencyKey]);Response 200
Transport document issued successfully
| Field | Type | Description |
|---|---|---|
id | string | |
documentNumber | string | Document number. On a draft, a provisional number. |
atcud | string · can be null | Unique document code (ATCUD). Null until issued. |
atDocCodeID | string · can be null | Identification code the AT assigns when the document is reported. Null until issued. |
atWarning | string · can be null | Warning the AT returned when the document was reported, if any. |
movementType | string | Transport document type (GR, GT, GA, GC, GD) One of: GUIA_DE_REMESSA, GUIA_DE_TRANSPORTE, GUIA_DE_ATIVOS_PROPRIOS, GUIA_DE_CONSIGNACAO, GUIA_DE_DEVOLUCAO |
movementStatus | string | SAF-T status: N normal, T invoiced, A cancelled One of: N, T, A |
issueStatus | string | Draft, issued (reported to the AT) or cancelled One of: DRAFT, ISSUED, CANCELED |
movementDate | string (date-time) | |
movementStartTime | string (date-time) | Start of transport |
movementEndTime | string (date-time) · can be null | |
vehicleID | string · can be null | Vehicle license plate |
isValued | boolean | false on an unvalued transport document: the PDF shows no prices and the AT receives 0.00. The line prices stay stored. |
unitId | string · can be null | |
createdAt | string (date-time) | |
updatedAt | string (date-time) · can be null | Draft revision. Send it as expectedUpdatedAt when issuing. |
canceledAt | string (date-time) · can be null | |
syncWithAt | object · can be null | Reporting to the AT. Null on a draft. |
syncWithAt. | string | |
syncWithAt. | string | |
syncWithAt. | string · can be null | |
syncWithAt. | string · can be null | |
syncWithAt. | string · can be null | |
syncWithAt. | boolean · can be null | |
syncWithAt. | string (date-time) | |
issuer | object | |
issuer. | string | |
issuer. | object | |
issuer. | string | |
issuer. | string | |
issuer. | string | |
issuer. | string | |
issuer. | string | |
issuer. | string | |
customer | object · can be null | |
customer. | string · can be null | |
customer. | object | |
customer. | string | |
customer. | string · can be null | |
customer. | string · can be null | |
customer. | string · can be null | |
customer. | string · can be null | |
customer. | string · can be null | |
addressFrom | object | |
addressFrom. | string · can be null | Saved address this one was copied from |
addressFrom. | string | |
addressFrom. | string | |
addressFrom. | string | |
addressFrom. | string | |
addressFrom. | string | |
addressTo | object · can be null | |
addressTo. | string · can be null | Saved address this one was copied from |
addressTo. | string | |
addressTo. | string | |
addressTo. | string | |
addressTo. | string | |
addressTo. | string | |
items | object[] · can be null | |
items[]. | string · can be null | Catalogue item sent on the line |
items[]. | object · can be null | |
items[]. | number · can be null | |
items[]. | number · can be null | |
items[]. | number · can be null | |
items[]. | number · can be null | |
items[]. | object · can be null | |
items[]. | string · can be null | |
items[]. | string · can be null | |
items[]. | string | One of: PRODUCT, SERVICE |
items[]. | number · can be null | |
items[]. | string · can be null | |
items[]. | string · can be null | One of: NORMAL, INTERMEDIATE, REDUCED, EXEMPT |
items[]. | string · can be null |
Errors
400Transport document invalid, already issued, loading time already passed or postal code invalid401Unauthorized - API key missing or invalid404Transport document not found409The transport document changed since the version given in expectedUpdatedAt; nothing was reported to the AT422The idempotency key was already used with a different request body429The OAuth connection’s request limit is reached. Nothing was executed: repeat the same request after Retry-After seconds.
Cancel transport document
POST /transport-documents/{id}/cancel
Cancels an already issued transport document and reports the cancellation to the AT. The document becomes CANCELED. Only issued (ISSUED) transport documents can be cancelled, and only before the loading time: the AT does not accept a cancellation after the transport has started.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id required | path | string | Transport document identifier |
# Once per operation. Keep it and reuse it on every retry.
IDEMPOTENCY_KEY=$(uuidgen)curl --request POST 'https://api.fiz.co/transport-documents/ID/cancel' \
--header "x-api-key: $FIZ_API_KEY" \
--header "Idempotency-Key: ${IDEMPOTENCY_KEY:?set the operation key first, in the step above}"# Once per fiscal operation, before the call. Store it with the document:
# a retry after a lost response reuses it and gets the recorded result, or a 409
# without Retry-After when the outcome is unknown: then check the document first.
export IDEMPOTENCY_KEY=$(uuidgen)import { Fiz } from '@fiz-co/sdk';
const fiz = new Fiz(); // reads FIZ_API_KEY
const idempotencyKey = process.env.IDEMPOTENCY_KEY; // from the step above, the same on every retry
if (!idempotencyKey) throw new Error('Set IDEMPOTENCY_KEY first, in the step above');
const result = await fiz.transportDocuments.cancel('ID', { idempotencyKey });# Once per fiscal operation, before the call. Store it with the document:
# a retry after a lost response reuses it and gets the recorded result, or a 409
# without Retry-After when the outcome is unknown: then check the document first.
export IDEMPOTENCY_KEY=$(uuidgen)import os
from fiz_sdk import Fiz
fiz = Fiz() # reads FIZ_API_KEY
idempotency_key = os.environ["IDEMPOTENCY_KEY"] # from the step above, the same on every retry
result = fiz.transport_documents.cancel("ID", idempotency_key=idempotency_key)# Once per fiscal operation, before the call. Store it with the document:
# a retry after a lost response reuses it and gets the recorded result, or a 409
# without Retry-After when the outcome is unknown: then check the document first.
export IDEMPOTENCY_KEY=$(uuidgen)<?php
require 'vendor/autoload.php';
$fiz = new Fiz\Fiz(); // reads FIZ_API_KEY
// from the step above, the same on every retry
$idempotencyKey = getenv('IDEMPOTENCY_KEY') ?: throw new RuntimeException('Set IDEMPOTENCY_KEY first, in the step above');
$result = $fiz->transportDocuments->cancel('ID', ['idempotencyKey' => $idempotencyKey]);Response 200
Transport document cancelled successfully
| Field | Type | Description |
|---|---|---|
id | string | |
documentNumber | string | Document number. On a draft, a provisional number. |
atcud | string · can be null | Unique document code (ATCUD). Null until issued. |
atDocCodeID | string · can be null | Identification code the AT assigns when the document is reported. Null until issued. |
atWarning | string · can be null | Warning the AT returned when the document was reported, if any. |
movementType | string | Transport document type (GR, GT, GA, GC, GD) One of: GUIA_DE_REMESSA, GUIA_DE_TRANSPORTE, GUIA_DE_ATIVOS_PROPRIOS, GUIA_DE_CONSIGNACAO, GUIA_DE_DEVOLUCAO |
movementStatus | string | SAF-T status: N normal, T invoiced, A cancelled One of: N, T, A |
issueStatus | string | Draft, issued (reported to the AT) or cancelled One of: DRAFT, ISSUED, CANCELED |
movementDate | string (date-time) | |
movementStartTime | string (date-time) | Start of transport |
movementEndTime | string (date-time) · can be null | |
vehicleID | string · can be null | Vehicle license plate |
isValued | boolean | false on an unvalued transport document: the PDF shows no prices and the AT receives 0.00. The line prices stay stored. |
unitId | string · can be null | |
createdAt | string (date-time) | |
updatedAt | string (date-time) · can be null | Draft revision. Send it as expectedUpdatedAt when issuing. |
canceledAt | string (date-time) · can be null | |
syncWithAt | object · can be null | Reporting to the AT. Null on a draft. |
syncWithAt. | string | |
syncWithAt. | string | |
syncWithAt. | string · can be null | |
syncWithAt. | string · can be null | |
syncWithAt. | string · can be null | |
syncWithAt. | boolean · can be null | |
syncWithAt. | string (date-time) | |
issuer | object | |
issuer. | string | |
issuer. | object | |
issuer. | string | |
issuer. | string | |
issuer. | string | |
issuer. | string | |
issuer. | string | |
issuer. | string | |
customer | object · can be null | |
customer. | string · can be null | |
customer. | object | |
customer. | string | |
customer. | string · can be null | |
customer. | string · can be null | |
customer. | string · can be null | |
customer. | string · can be null | |
customer. | string · can be null | |
addressFrom | object | |
addressFrom. | string · can be null | Saved address this one was copied from |
addressFrom. | string | |
addressFrom. | string | |
addressFrom. | string | |
addressFrom. | string | |
addressFrom. | string | |
addressTo | object · can be null | |
addressTo. | string · can be null | Saved address this one was copied from |
addressTo. | string | |
addressTo. | string | |
addressTo. | string | |
addressTo. | string | |
addressTo. | string | |
items | object[] · can be null | |
items[]. | string · can be null | Catalogue item sent on the line |
items[]. | object · can be null | |
items[]. | number · can be null | |
items[]. | number · can be null | |
items[]. | number · can be null | |
items[]. | number · can be null | |
items[]. | object · can be null | |
items[]. | string · can be null | |
items[]. | string · can be null | |
items[]. | string | One of: PRODUCT, SERVICE |
items[]. | number · can be null | |
items[]. | string · can be null | |
items[]. | string · can be null | One of: NORMAL, INTERMEDIATE, REDUCED, EXEMPT |
items[]. | string · can be null |
Errors
400Transport document not issued or already cancelled401Unauthorized - API key missing or invalid404Transport document not found409A request with this idempotency key is still being processed, or the outcome of the first attempt is unknown422The idempotency key was already used with a different request body429The OAuth connection’s request limit is reached. Nothing was executed: repeat the same request after Retry-After seconds.
Download transport document PDF
GET /transport-documents/{id}/pdf
Generates and returns the download link for a transport document PDF. The PDF includes the QR code and the ATCUD, as required by the AT.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id required | path | string | Transport document identifier |
isDuplicate | query | boolean | Mark PDF as duplicate |
curl 'https://api.fiz.co/transport-documents/ID/pdf' \
--header "x-api-key: $FIZ_API_KEY"import { Fiz } from '@fiz-co/sdk';
const fiz = new Fiz(); // reads FIZ_API_KEY
const result = await fiz.transportDocuments.pdf('ID');from fiz_sdk import Fiz
fiz = Fiz() # reads FIZ_API_KEY
result = fiz.transport_documents.pdf("ID")<?php
require 'vendor/autoload.php';
$fiz = new Fiz\Fiz(); // reads FIZ_API_KEY
$result = $fiz->transportDocuments->pdf('ID');Response 200
PDF generated successfully
| Field | Type | Description |
|---|---|---|
id | string | PDF file ID |
name | string · can be null | PDF file name |
url | string · can be null | PDF download URL |
Errors
401Unauthorized - API key missing or invalid404Transport document not found429The OAuth connection’s request limit is reached. Nothing was executed: repeat the same request after Retry-After seconds.
Errors
Errors share one shape: statusCode, message, code and error, with the request id in the X-Request-Id header.