PT SAF-T
PT SAF-T
Generate Portugal SAF-T audit export files for PT entities.
Generate PT SAF-T report
GET
/fiscalization/pt/saft/reportGenerate a Portugal SAF-T XML export for the selected PT entity. The response is encoded as windows-1252 for AT/audit compatibility.
Request
Header parameters
entity_idstringoptional
Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.
Query parameters
modestringoptionalnullable
monthly (default) exports a calendar month. audit exports from the start of the selected year through its end, or today for the current year. Supply from/to to select the year; audit never selects individual documents or series.
Possible values: "monthly", "audit", "null"
fromstring<date>optional
Report start date (inclusive) in YYYY-MM-DD format.
tostring<date>optional
Report end date (inclusive) in YYYY-MM-DD format.
import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
const response = await sdk.ptSafT.generateReport(undefined, {
entity_id: "YOUR_ENTITY_ID"
});
console.log(response);