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.

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

Parameters

NameInTypeDescription
offsetquerynumberNumber of records to skip (offset)
limitquerynumberMaximum number of records to return
sortquerystringSort field and order (e.g. movementDate:desc)
searchquerystringGlobal search term (number, recipient, etc.)
movementTypequerystringFilter by movement type
One of: GUIA_DE_ATIVOS_PROPRIOS, GUIA_DE_CONSIGNACAO, GUIA_DE_DEVOLUCAO, GUIA_DE_REMESSA, GUIA_DE_TRANSPORTE
issueStatusquerystringFilter 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

FieldTypeDescription
[].idstring
[].documentNumberstringDocument number. On a draft, a provisional number.
[].atcudstring · can be nullUnique document code (ATCUD). Null until issued.
[].atDocCodeIDstring · can be nullIdentification code the AT assigns when the document is reported. Null until issued.
[].atWarningstring · can be nullWarning the AT returned when the document was reported, if any.
[].movementTypestringTransport 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
[].movementStatusstringSAF-T status: N normal, T invoiced, A cancelled
One of: N, T, A
[].issueStatusstringDraft, issued (reported to the AT) or cancelled
One of: DRAFT, ISSUED, CANCELED
[].movementDatestring (date-time)
[].movementStartTimestring (date-time)Start of transport
[].movementEndTimestring (date-time) · can be null
[].vehicleIDstring · can be nullVehicle license plate
[].isValuedbooleanfalse on an unvalued transport document: the PDF shows no prices and the AT receives 0.00. The line prices stay stored.
[].unitIdstring · can be null
[].createdAtstring (date-time)
[].updatedAtstring (date-time) · can be nullDraft revision. Send it as expectedUpdatedAt when issuing.
[].canceledAtstring (date-time) · can be null
[].syncWithAtobject · can be nullReporting to the AT. Null on a draft.
[].syncWithAt.statusstring
[].syncWithAt.actionstring
[].syncWithAt.atCodestring · can be null
[].syncWithAt.atMessagestring · can be null
[].syncWithAt.systemErrorstring · can be null
[].syncWithAt.isRetriableboolean · can be null
[].syncWithAt.updatedAtstring (date-time)
[].issuerobject
[].issuer.refstring
[].issuer.dataobject
[].issuer.data.namestring
[].issuer.data.taxPayerNumberstring
[].issuer.data.addressstring
[].issuer.data.postalCodestring
[].issuer.data.citystring
[].issuer.data.countrystring
[].customerobject · can be null
[].customer.refstring · can be null
[].customer.dataobject
[].customer.data.namestring
[].customer.data.taxpayerNumberstring · can be null
[].customer.data.addressstring · can be null
[].customer.data.postalCodestring · can be null
[].customer.data.citystring · can be null
[].customer.data.countrystring · can be null
[].addressFromobject
[].addressFrom.refstring · can be nullSaved address this one was copied from
[].addressFrom.namestring
[].addressFrom.addressDetailstring
[].addressFrom.postalCodestring
[].addressFrom.citystring
[].addressFrom.countrystring
[].addressToobject · can be null
[].addressTo.refstring · can be nullSaved address this one was copied from
[].addressTo.namestring
[].addressTo.addressDetailstring
[].addressTo.postalCodestring
[].addressTo.citystring
[].addressTo.countrystring
[].itemsobject[] · can be null
[].items[].refstring · can be nullCatalogue item sent on the line
[].items[].metaobject · can be null
[].items[].meta.quantitynumber · can be null
[].items[].meta.amountWithoutTaxnumber · can be null
[].items[].meta.amountWithTaxnumber · can be null
[].items[].meta.taxAmountnumber · can be null
[].items[].dataobject · can be null
[].items[].data.namestring · can be null
[].items[].data.descriptionstring · can be null
[].items[].data.typestringOne of: PRODUCT, SERVICE
[].items[].data.unitPricenumber · can be null
[].items[].data.unitTypestring · can be null
[].items[].data.vatRatestring · can be nullOne of: NORMAL, INTERMEDIATE, REDUCED, EXEMPT
[].items[].data.vatExemptionReasonstring · can be null

Errors

  • 400 Invalid parameters
  • 401 Unauthorized - API key missing or invalid
  • 429 The 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.

Authentication: an API key (x-api-key) or an OAuth access token. Send an Idempotency-Key to retry this call safely.

Request body

Data required to create the draft transport document

FieldTypeDescription
movementType requiredstringMovement 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 requiredstringMovement date (ISO 8601 with timezone). Cannot be earlier than today — the transport document must be reported to the AT before the transport starts.
movementStartTime requiredstringLoading 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.
movementEndTimestringExpected unloading date/time (optional, ISO 8601 with timezone)
addressFrom requiredobjectLoading location
addressFrom.name requiredstringLocation name (e.g. warehouse, store, facility)
addressFrom.addressDetail requiredstringAddress (street, number, floor)
addressFrom.postalCode requiredstringPostal code
addressFrom.city requiredstringLocality
addressFrom.country requiredstringCountry (ISO 3166-1 alpha-2 code)
addressFrom.refstringIdentifier of a saved address (optional). Links this address to an address book record.
addressToobjectUnloading location (optional)
addressTo.name requiredstringLocation name (e.g. warehouse, store, facility)
addressTo.addressDetail requiredstringAddress (street, number, floor)
addressTo.postalCode requiredstringPostal code
addressTo.city requiredstringLocality
addressTo.country requiredstringCountry (ISO 3166-1 alpha-2 code)
addressTo.refstringIdentifier of a saved address (optional). Links this address to an address book record.
customerobjectRecipient 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.data requiredobjectRecipient data
customer.data.name requiredstringRecipient name
customer.data.taxpayerNumberstringRecipient NIF (tax number)
customer.data.addressstringRecipient address
customer.data.postalCodestringRecipient postal code
customer.data.citystringRecipient locality
customer.data.countrystringRecipient country (ISO 3166-1 alpha-2)
customer.refstringIdentifier of an existing customer (optional). Use the "id" returned by GET /customers.
isValuedbooleanValued 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.
vehicleIDstringVehicle license plate (optional)
items requiredobject[]Transported goods and their quantities
items[].id requiredstringItem identifier. Use the "id" returned by GET /items.
items[].quantity requirednumberTransported 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

FieldTypeDescription
idstring
documentNumberstringDocument number. On a draft, a provisional number.
atcudstring · can be nullUnique document code (ATCUD). Null until issued.
atDocCodeIDstring · can be nullIdentification code the AT assigns when the document is reported. Null until issued.
atWarningstring · can be nullWarning the AT returned when the document was reported, if any.
movementTypestringTransport 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
movementStatusstringSAF-T status: N normal, T invoiced, A cancelled
One of: N, T, A
issueStatusstringDraft, issued (reported to the AT) or cancelled
One of: DRAFT, ISSUED, CANCELED
movementDatestring (date-time)
movementStartTimestring (date-time)Start of transport
movementEndTimestring (date-time) · can be null
vehicleIDstring · can be nullVehicle license plate
isValuedbooleanfalse on an unvalued transport document: the PDF shows no prices and the AT receives 0.00. The line prices stay stored.
unitIdstring · can be null
createdAtstring (date-time)
updatedAtstring (date-time) · can be nullDraft revision. Send it as expectedUpdatedAt when issuing.
canceledAtstring (date-time) · can be null
syncWithAtobject · can be nullReporting to the AT. Null on a draft.
syncWithAt.statusstring
syncWithAt.actionstring
syncWithAt.atCodestring · can be null
syncWithAt.atMessagestring · can be null
syncWithAt.systemErrorstring · can be null
syncWithAt.isRetriableboolean · can be null
syncWithAt.updatedAtstring (date-time)
issuerobject
issuer.refstring
issuer.dataobject
issuer.data.namestring
issuer.data.taxPayerNumberstring
issuer.data.addressstring
issuer.data.postalCodestring
issuer.data.citystring
issuer.data.countrystring
customerobject · can be null
customer.refstring · can be null
customer.dataobject
customer.data.namestring
customer.data.taxpayerNumberstring · can be null
customer.data.addressstring · can be null
customer.data.postalCodestring · can be null
customer.data.citystring · can be null
customer.data.countrystring · can be null
addressFromobject
addressFrom.refstring · can be nullSaved address this one was copied from
addressFrom.namestring
addressFrom.addressDetailstring
addressFrom.postalCodestring
addressFrom.citystring
addressFrom.countrystring
addressToobject · can be null
addressTo.refstring · can be nullSaved address this one was copied from
addressTo.namestring
addressTo.addressDetailstring
addressTo.postalCodestring
addressTo.citystring
addressTo.countrystring
itemsobject[] · can be null
items[].refstring · can be nullCatalogue item sent on the line
items[].metaobject · can be null
items[].meta.quantitynumber · can be null
items[].meta.amountWithoutTaxnumber · can be null
items[].meta.amountWithTaxnumber · can be null
items[].meta.taxAmountnumber · can be null
items[].dataobject · can be null
items[].data.namestring · can be null
items[].data.descriptionstring · can be null
items[].data.typestringOne of: PRODUCT, SERVICE
items[].data.unitPricenumber · can be null
items[].data.unitTypestring · can be null
items[].data.vatRatestring · can be nullOne of: NORMAL, INTERMEDIATE, REDUCED, EXEMPT
items[].data.vatExemptionReasonstring · can be null

Errors

  • 400 Invalid data
  • 401 Unauthorized - API key missing or invalid
  • 409 A request with this idempotency key is still being processed, or the outcome of the first attempt is unknown
  • 422 The idempotency key was already used with a different request body
  • 429 The 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).

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

Parameters

NameInTypeDescription
id requiredpathstringTransport 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

FieldTypeDescription
idstring
documentNumberstringDocument number. On a draft, a provisional number.
atcudstring · can be nullUnique document code (ATCUD). Null until issued.
atDocCodeIDstring · can be nullIdentification code the AT assigns when the document is reported. Null until issued.
atWarningstring · can be nullWarning the AT returned when the document was reported, if any.
movementTypestringTransport 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
movementStatusstringSAF-T status: N normal, T invoiced, A cancelled
One of: N, T, A
issueStatusstringDraft, issued (reported to the AT) or cancelled
One of: DRAFT, ISSUED, CANCELED
movementDatestring (date-time)
movementStartTimestring (date-time)Start of transport
movementEndTimestring (date-time) · can be null
vehicleIDstring · can be nullVehicle license plate
isValuedbooleanfalse on an unvalued transport document: the PDF shows no prices and the AT receives 0.00. The line prices stay stored.
unitIdstring · can be null
createdAtstring (date-time)
updatedAtstring (date-time) · can be nullDraft revision. Send it as expectedUpdatedAt when issuing.
canceledAtstring (date-time) · can be null
syncWithAtobject · can be nullReporting to the AT. Null on a draft.
syncWithAt.statusstring
syncWithAt.actionstring
syncWithAt.atCodestring · can be null
syncWithAt.atMessagestring · can be null
syncWithAt.systemErrorstring · can be null
syncWithAt.isRetriableboolean · can be null
syncWithAt.updatedAtstring (date-time)
issuerobject
issuer.refstring
issuer.dataobject
issuer.data.namestring
issuer.data.taxPayerNumberstring
issuer.data.addressstring
issuer.data.postalCodestring
issuer.data.citystring
issuer.data.countrystring
customerobject · can be null
customer.refstring · can be null
customer.dataobject
customer.data.namestring
customer.data.taxpayerNumberstring · can be null
customer.data.addressstring · can be null
customer.data.postalCodestring · can be null
customer.data.citystring · can be null
customer.data.countrystring · can be null
addressFromobject
addressFrom.refstring · can be nullSaved address this one was copied from
addressFrom.namestring
addressFrom.addressDetailstring
addressFrom.postalCodestring
addressFrom.citystring
addressFrom.countrystring
addressToobject · can be null
addressTo.refstring · can be nullSaved address this one was copied from
addressTo.namestring
addressTo.addressDetailstring
addressTo.postalCodestring
addressTo.citystring
addressTo.countrystring
itemsobject[] · can be null
items[].refstring · can be nullCatalogue item sent on the line
items[].metaobject · can be null
items[].meta.quantitynumber · can be null
items[].meta.amountWithoutTaxnumber · can be null
items[].meta.amountWithTaxnumber · can be null
items[].meta.taxAmountnumber · can be null
items[].dataobject · can be null
items[].data.namestring · can be null
items[].data.descriptionstring · can be null
items[].data.typestringOne of: PRODUCT, SERVICE
items[].data.unitPricenumber · can be null
items[].data.unitTypestring · can be null
items[].data.vatRatestring · can be nullOne of: NORMAL, INTERMEDIATE, REDUCED, EXEMPT
items[].data.vatExemptionReasonstring · can be null

Errors

  • 401 Unauthorized - API key missing or invalid
  • 404 Transport document not found
  • 429 The 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.

Authentication: an API key (x-api-key) or an OAuth access token. Send an Idempotency-Key to retry this call safely.

Parameters

NameInTypeDescription
id requiredpathstringTransport document identifier

Request body

Fields to update

FieldTypeDescription
movementTypestringMovement type
One of: GUIA_DE_ATIVOS_PROPRIOS, GUIA_DE_CONSIGNACAO, GUIA_DE_DEVOLUCAO, GUIA_DE_REMESSA, GUIA_DE_TRANSPORTE
movementDatestringMovement date (ISO 8601 with timezone). Cannot be earlier than today.
movementStartTimestringLoading 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.
movementEndTimestringExpected unloading date/time (ISO 8601 with timezone)
addressFromobjectLoading location
addressFrom.name requiredstringLocation name (e.g. warehouse, store, facility)
addressFrom.addressDetail requiredstringAddress (street, number, floor)
addressFrom.postalCode requiredstringPostal code
addressFrom.city requiredstringLocality
addressFrom.country requiredstringCountry (ISO 3166-1 alpha-2 code)
addressFrom.refstringIdentifier of a saved address (optional). Links this address to an address book record.
addressToobjectUnloading location
addressTo.name requiredstringLocation name (e.g. warehouse, store, facility)
addressTo.addressDetail requiredstringAddress (street, number, floor)
addressTo.postalCode requiredstringPostal code
addressTo.city requiredstringLocality
addressTo.country requiredstringCountry (ISO 3166-1 alpha-2 code)
addressTo.refstringIdentifier of a saved address (optional). Links this address to an address book record.
customerobjectRecipient of the goods
customer.data requiredobjectRecipient data
customer.data.name requiredstringRecipient name
customer.data.taxpayerNumberstringRecipient NIF (tax number)
customer.data.addressstringRecipient address
customer.data.postalCodestringRecipient postal code
customer.data.citystringRecipient locality
customer.data.countrystringRecipient country (ISO 3166-1 alpha-2)
customer.refstringIdentifier of an existing customer (optional). Use the "id" returned by GET /customers.
isValuedbooleanValued 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.
vehicleIDstringVehicle license plate
itemsobject[]Transported goods and their quantities
items[].id requiredstringItem identifier. Use the "id" returned by GET /items.
items[].quantity requirednumberTransported 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

FieldTypeDescription
idstring
documentNumberstringDocument number. On a draft, a provisional number.
atcudstring · can be nullUnique document code (ATCUD). Null until issued.
atDocCodeIDstring · can be nullIdentification code the AT assigns when the document is reported. Null until issued.
atWarningstring · can be nullWarning the AT returned when the document was reported, if any.
movementTypestringTransport 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
movementStatusstringSAF-T status: N normal, T invoiced, A cancelled
One of: N, T, A
issueStatusstringDraft, issued (reported to the AT) or cancelled
One of: DRAFT, ISSUED, CANCELED
movementDatestring (date-time)
movementStartTimestring (date-time)Start of transport
movementEndTimestring (date-time) · can be null
vehicleIDstring · can be nullVehicle license plate
isValuedbooleanfalse on an unvalued transport document: the PDF shows no prices and the AT receives 0.00. The line prices stay stored.
unitIdstring · can be null
createdAtstring (date-time)
updatedAtstring (date-time) · can be nullDraft revision. Send it as expectedUpdatedAt when issuing.
canceledAtstring (date-time) · can be null
syncWithAtobject · can be nullReporting to the AT. Null on a draft.
syncWithAt.statusstring
syncWithAt.actionstring
syncWithAt.atCodestring · can be null
syncWithAt.atMessagestring · can be null
syncWithAt.systemErrorstring · can be null
syncWithAt.isRetriableboolean · can be null
syncWithAt.updatedAtstring (date-time)
issuerobject
issuer.refstring
issuer.dataobject
issuer.data.namestring
issuer.data.taxPayerNumberstring
issuer.data.addressstring
issuer.data.postalCodestring
issuer.data.citystring
issuer.data.countrystring
customerobject · can be null
customer.refstring · can be null
customer.dataobject
customer.data.namestring
customer.data.taxpayerNumberstring · can be null
customer.data.addressstring · can be null
customer.data.postalCodestring · can be null
customer.data.citystring · can be null
customer.data.countrystring · can be null
addressFromobject
addressFrom.refstring · can be nullSaved address this one was copied from
addressFrom.namestring
addressFrom.addressDetailstring
addressFrom.postalCodestring
addressFrom.citystring
addressFrom.countrystring
addressToobject · can be null
addressTo.refstring · can be nullSaved address this one was copied from
addressTo.namestring
addressTo.addressDetailstring
addressTo.postalCodestring
addressTo.citystring
addressTo.countrystring
itemsobject[] · can be null
items[].refstring · can be nullCatalogue item sent on the line
items[].metaobject · can be null
items[].meta.quantitynumber · can be null
items[].meta.amountWithoutTaxnumber · can be null
items[].meta.amountWithTaxnumber · can be null
items[].meta.taxAmountnumber · can be null
items[].dataobject · can be null
items[].data.namestring · can be null
items[].data.descriptionstring · can be null
items[].data.typestringOne of: PRODUCT, SERVICE
items[].data.unitPricenumber · can be null
items[].data.unitTypestring · can be null
items[].data.vatRatestring · can be nullOne of: NORMAL, INTERMEDIATE, REDUCED, EXEMPT
items[].data.vatExemptionReasonstring · can be null

Errors

  • 400 Invalid data or transport document already issued
  • 401 Unauthorized - API key missing or invalid
  • 404 Transport document not found
  • 409 A request with this idempotency key is still being processed, or the outcome of the first attempt is unknown
  • 422 The idempotency key was already used with a different request body
  • 429 The 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.

Authentication: an API key (x-api-key) or an OAuth access token. Send an Idempotency-Key to retry this call safely.

Parameters

NameInTypeDescription
id requiredpathstringTransport 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

FieldTypeDescription
idstring
documentNumberstringDocument number. On a draft, a provisional number.
atcudstring · can be nullUnique document code (ATCUD). Null until issued.
atDocCodeIDstring · can be nullIdentification code the AT assigns when the document is reported. Null until issued.
atWarningstring · can be nullWarning the AT returned when the document was reported, if any.
movementTypestringTransport 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
movementStatusstringSAF-T status: N normal, T invoiced, A cancelled
One of: N, T, A
issueStatusstringDraft, issued (reported to the AT) or cancelled
One of: DRAFT, ISSUED, CANCELED
movementDatestring (date-time)
movementStartTimestring (date-time)Start of transport
movementEndTimestring (date-time) · can be null
vehicleIDstring · can be nullVehicle license plate
isValuedbooleanfalse on an unvalued transport document: the PDF shows no prices and the AT receives 0.00. The line prices stay stored.
unitIdstring · can be null
createdAtstring (date-time)
updatedAtstring (date-time) · can be nullDraft revision. Send it as expectedUpdatedAt when issuing.
canceledAtstring (date-time) · can be null
syncWithAtobject · can be nullReporting to the AT. Null on a draft.
syncWithAt.statusstring
syncWithAt.actionstring
syncWithAt.atCodestring · can be null
syncWithAt.atMessagestring · can be null
syncWithAt.systemErrorstring · can be null
syncWithAt.isRetriableboolean · can be null
syncWithAt.updatedAtstring (date-time)
issuerobject
issuer.refstring
issuer.dataobject
issuer.data.namestring
issuer.data.taxPayerNumberstring
issuer.data.addressstring
issuer.data.postalCodestring
issuer.data.citystring
issuer.data.countrystring
customerobject · can be null
customer.refstring · can be null
customer.dataobject
customer.data.namestring
customer.data.taxpayerNumberstring · can be null
customer.data.addressstring · can be null
customer.data.postalCodestring · can be null
customer.data.citystring · can be null
customer.data.countrystring · can be null
addressFromobject
addressFrom.refstring · can be nullSaved address this one was copied from
addressFrom.namestring
addressFrom.addressDetailstring
addressFrom.postalCodestring
addressFrom.citystring
addressFrom.countrystring
addressToobject · can be null
addressTo.refstring · can be nullSaved address this one was copied from
addressTo.namestring
addressTo.addressDetailstring
addressTo.postalCodestring
addressTo.citystring
addressTo.countrystring
itemsobject[] · can be null
items[].refstring · can be nullCatalogue item sent on the line
items[].metaobject · can be null
items[].meta.quantitynumber · can be null
items[].meta.amountWithoutTaxnumber · can be null
items[].meta.amountWithTaxnumber · can be null
items[].meta.taxAmountnumber · can be null
items[].dataobject · can be null
items[].data.namestring · can be null
items[].data.descriptionstring · can be null
items[].data.typestringOne of: PRODUCT, SERVICE
items[].data.unitPricenumber · can be null
items[].data.unitTypestring · can be null
items[].data.vatRatestring · can be nullOne of: NORMAL, INTERMEDIATE, REDUCED, EXEMPT
items[].data.vatExemptionReasonstring · can be null

Errors

  • 400 Transport document already issued — cannot be deleted
  • 401 Unauthorized - API key missing or invalid
  • 404 Transport document not found
  • 409 A request with this idempotency key is still being processed, or the outcome of the first attempt is unknown
  • 422 The idempotency key was already used with a different request body
  • 429 The 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.

Authentication: an API key (x-api-key) or an OAuth access token. Send an Idempotency-Key to retry this call safely.

Parameters

NameInTypeDescription
id requiredpathstringTransport document identifier

Request body

FieldTypeDescription
expectedUpdatedAtstring (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

FieldTypeDescription
idstring
documentNumberstringDocument number. On a draft, a provisional number.
atcudstring · can be nullUnique document code (ATCUD). Null until issued.
atDocCodeIDstring · can be nullIdentification code the AT assigns when the document is reported. Null until issued.
atWarningstring · can be nullWarning the AT returned when the document was reported, if any.
movementTypestringTransport 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
movementStatusstringSAF-T status: N normal, T invoiced, A cancelled
One of: N, T, A
issueStatusstringDraft, issued (reported to the AT) or cancelled
One of: DRAFT, ISSUED, CANCELED
movementDatestring (date-time)
movementStartTimestring (date-time)Start of transport
movementEndTimestring (date-time) · can be null
vehicleIDstring · can be nullVehicle license plate
isValuedbooleanfalse on an unvalued transport document: the PDF shows no prices and the AT receives 0.00. The line prices stay stored.
unitIdstring · can be null
createdAtstring (date-time)
updatedAtstring (date-time) · can be nullDraft revision. Send it as expectedUpdatedAt when issuing.
canceledAtstring (date-time) · can be null
syncWithAtobject · can be nullReporting to the AT. Null on a draft.
syncWithAt.statusstring
syncWithAt.actionstring
syncWithAt.atCodestring · can be null
syncWithAt.atMessagestring · can be null
syncWithAt.systemErrorstring · can be null
syncWithAt.isRetriableboolean · can be null
syncWithAt.updatedAtstring (date-time)
issuerobject
issuer.refstring
issuer.dataobject
issuer.data.namestring
issuer.data.taxPayerNumberstring
issuer.data.addressstring
issuer.data.postalCodestring
issuer.data.citystring
issuer.data.countrystring
customerobject · can be null
customer.refstring · can be null
customer.dataobject
customer.data.namestring
customer.data.taxpayerNumberstring · can be null
customer.data.addressstring · can be null
customer.data.postalCodestring · can be null
customer.data.citystring · can be null
customer.data.countrystring · can be null
addressFromobject
addressFrom.refstring · can be nullSaved address this one was copied from
addressFrom.namestring
addressFrom.addressDetailstring
addressFrom.postalCodestring
addressFrom.citystring
addressFrom.countrystring
addressToobject · can be null
addressTo.refstring · can be nullSaved address this one was copied from
addressTo.namestring
addressTo.addressDetailstring
addressTo.postalCodestring
addressTo.citystring
addressTo.countrystring
itemsobject[] · can be null
items[].refstring · can be nullCatalogue item sent on the line
items[].metaobject · can be null
items[].meta.quantitynumber · can be null
items[].meta.amountWithoutTaxnumber · can be null
items[].meta.amountWithTaxnumber · can be null
items[].meta.taxAmountnumber · can be null
items[].dataobject · can be null
items[].data.namestring · can be null
items[].data.descriptionstring · can be null
items[].data.typestringOne of: PRODUCT, SERVICE
items[].data.unitPricenumber · can be null
items[].data.unitTypestring · can be null
items[].data.vatRatestring · can be nullOne of: NORMAL, INTERMEDIATE, REDUCED, EXEMPT
items[].data.vatExemptionReasonstring · can be null

Errors

  • 400 Transport document invalid, already issued, loading time already passed or postal code invalid
  • 401 Unauthorized - API key missing or invalid
  • 404 Transport document not found
  • 409 The transport document changed since the version given in expectedUpdatedAt; nothing was reported to the AT
  • 422 The idempotency key was already used with a different request body
  • 429 The 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.

Authentication: an API key (x-api-key) or an OAuth access token. Send an Idempotency-Key to retry this call safely.

Parameters

NameInTypeDescription
id requiredpathstringTransport 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

FieldTypeDescription
idstring
documentNumberstringDocument number. On a draft, a provisional number.
atcudstring · can be nullUnique document code (ATCUD). Null until issued.
atDocCodeIDstring · can be nullIdentification code the AT assigns when the document is reported. Null until issued.
atWarningstring · can be nullWarning the AT returned when the document was reported, if any.
movementTypestringTransport 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
movementStatusstringSAF-T status: N normal, T invoiced, A cancelled
One of: N, T, A
issueStatusstringDraft, issued (reported to the AT) or cancelled
One of: DRAFT, ISSUED, CANCELED
movementDatestring (date-time)
movementStartTimestring (date-time)Start of transport
movementEndTimestring (date-time) · can be null
vehicleIDstring · can be nullVehicle license plate
isValuedbooleanfalse on an unvalued transport document: the PDF shows no prices and the AT receives 0.00. The line prices stay stored.
unitIdstring · can be null
createdAtstring (date-time)
updatedAtstring (date-time) · can be nullDraft revision. Send it as expectedUpdatedAt when issuing.
canceledAtstring (date-time) · can be null
syncWithAtobject · can be nullReporting to the AT. Null on a draft.
syncWithAt.statusstring
syncWithAt.actionstring
syncWithAt.atCodestring · can be null
syncWithAt.atMessagestring · can be null
syncWithAt.systemErrorstring · can be null
syncWithAt.isRetriableboolean · can be null
syncWithAt.updatedAtstring (date-time)
issuerobject
issuer.refstring
issuer.dataobject
issuer.data.namestring
issuer.data.taxPayerNumberstring
issuer.data.addressstring
issuer.data.postalCodestring
issuer.data.citystring
issuer.data.countrystring
customerobject · can be null
customer.refstring · can be null
customer.dataobject
customer.data.namestring
customer.data.taxpayerNumberstring · can be null
customer.data.addressstring · can be null
customer.data.postalCodestring · can be null
customer.data.citystring · can be null
customer.data.countrystring · can be null
addressFromobject
addressFrom.refstring · can be nullSaved address this one was copied from
addressFrom.namestring
addressFrom.addressDetailstring
addressFrom.postalCodestring
addressFrom.citystring
addressFrom.countrystring
addressToobject · can be null
addressTo.refstring · can be nullSaved address this one was copied from
addressTo.namestring
addressTo.addressDetailstring
addressTo.postalCodestring
addressTo.citystring
addressTo.countrystring
itemsobject[] · can be null
items[].refstring · can be nullCatalogue item sent on the line
items[].metaobject · can be null
items[].meta.quantitynumber · can be null
items[].meta.amountWithoutTaxnumber · can be null
items[].meta.amountWithTaxnumber · can be null
items[].meta.taxAmountnumber · can be null
items[].dataobject · can be null
items[].data.namestring · can be null
items[].data.descriptionstring · can be null
items[].data.typestringOne of: PRODUCT, SERVICE
items[].data.unitPricenumber · can be null
items[].data.unitTypestring · can be null
items[].data.vatRatestring · can be nullOne of: NORMAL, INTERMEDIATE, REDUCED, EXEMPT
items[].data.vatExemptionReasonstring · can be null

Errors

  • 400 Transport document not issued or already cancelled
  • 401 Unauthorized - API key missing or invalid
  • 404 Transport document not found
  • 409 A request with this idempotency key is still being processed, or the outcome of the first attempt is unknown
  • 422 The idempotency key was already used with a different request body
  • 429 The 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.

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

Parameters

NameInTypeDescription
id requiredpathstringTransport document identifier
isDuplicatequerybooleanMark 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

FieldTypeDescription
idstringPDF file ID
namestring · can be nullPDF file name
urlstring · can be nullPDF download URL

Errors

  • 401 Unauthorized - API key missing or invalid
  • 404 Transport document not found
  • 429 The 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.

All resources