Skip to content

Portugal (ATCUD and SAF-T)

Portugal entities use stricter issuance data than the baseline document API. Configure the entity with valid Portuguese issuer details, create the ATCUD series used for numbering, then issue documents with Portugal-specific operator data.

Entity Setup

Portugal entities require complete issuer details before live issuance.

Create Portugal entitytypescript
const _entity = await sdk.entities.create({
  name: "Lisboa Orbital Services",
  country: "Portugal",
  country_code: "PT",
  tax_number: "501964843",
  address: "Avenida da Liberdade 10",
  city: "Lisboa",
  post_code: "1000-001",
  phone: "+351210000000",
  email: "billing@example.pt",
});

ATCUD Series

Create an active ATCUD series for each Portugal document type you issue.

Create ATCUD seriestypescript
const _series = await sdk.ptAtcudSeries.create({
  document_type: "invoice",
  series_code: "FT 2026/A",
  validation_code: "AB12CD34EF",
  first_number: "FT FT2026A/00001",
  start_date: "2026-01-01",
  is_manual: false,
  initial_sequence: 1,
});

Issuing Documents

Portugal invoices must be issued with exportable customer, line, tax, series, and operator data.

Create issued invoicetypescript
const _invoice = await sdk.invoices.create({
  customer: {
    name: "Porto Payloads Lda",
    country: "Portugal",
    country_code: "PT",
    tax_number: "516403125",
  },
  items: [
    {
      name: "Ground operations service",
      quantity: 1,
      price: 100,
      classification: "service",
      taxes: [{ rate: 23 }],
    },
  ],
  pt: {
    series_id: "pt_series_000000000000000000000001",
    operator_first_name: "Antonio",
    operator_last_name: "Silva",
    operator_tax_number: "123456789",
  },
});

SAF-T Export

Generate monthly SAF-T PT XML for Portugal entities.

Export SAF-Ttypescript
const _xml = await sdk.ptSafT.generateReport({
  from: "2026-01-01",
  to: "2026-01-31",
});

See the PT ATCUD Series API Reference, PT SAF-T API Reference, and Invoices API Reference.