Skip to main content

List Communicated Documents

Retrieve a list of documents that have been communicated to the Portuguese Tax Authority (AT).

Operation

TaxCommunicationList

Request

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:mag="http://magnifinance.com/api/v2.1"
xmlns:auth="http://magnifinance.com/auth">
<soapenv:Header>
<auth:Credentials>
<auth:ClientId>your_client_id</auth:ClientId>
<auth:ClientSecret>your_client_secret</auth:ClientSecret>
</auth:Credentials>
</soapenv:Header>
<soapenv:Body>
<mag:TaxCommunicationList>
<mag:Filter>
<mag:StartDate>2024-01-01</mag:StartDate>
<mag:EndDate>2024-01-31</mag:EndDate>
<mag:Status>Communicated</mag:Status>
<mag:DocumentType>FT</mag:DocumentType>
<mag:Page>1</mag:Page>
<mag:PageSize>50</mag:PageSize>
</mag:Filter>
</mag:TaxCommunicationList>
</soapenv:Body>
</soapenv:Envelope>

Parameters

ParameterTypeRequiredDescription
StartDatedateNoFilter documents from this date (inclusive)
EndDatedateNoFilter documents until this date (inclusive)
StatusstringNoFilter by communication status
DocumentTypestringNoFilter by document type (FT, FS, FR, NC, etc.)
PageintegerNoPage number for pagination (default: 1)
PageSizeintegerNoNumber of records per page (default: 50, max: 100)

Status Values

StatusDescription
PendingDocument awaiting communication
CommunicatedSuccessfully communicated to AT
FailedCommunication failed
CancelledDocument was cancelled before communication

Response

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<mag:TaxCommunicationListResponse xmlns:mag="http://magnifinance.com/api/v2.1">
<mag:Result>
<mag:Success>true</mag:Success>
<mag:Pagination>
<mag:Page>1</mag:Page>
<mag:PageSize>50</mag:PageSize>
<mag:TotalRecords>125</mag:TotalRecords>
<mag:TotalPages>3</mag:TotalPages>
</mag:Pagination>
<mag:Documents>
<mag:Document>
<mag:Id>doc_123456</mag:Id>
<mag:Type>FT</mag:Type>
<mag:Number>FT 2024/1</mag:Number>
<mag:Date>2024-01-15</mag:Date>
<mag:Total>123.00</mag:Total>
<mag:Status>Communicated</mag:Status>
<mag:CommunicatedAt>2024-01-15T10:35:00Z</mag:CommunicatedAt>
<mag:ATCode>FTAB-12345</mag:ATCode>
</mag:Document>
<mag:Document>
<mag:Id>doc_123457</mag:Id>
<mag:Type>FT</mag:Type>
<mag:Number>FT 2024/2</mag:Number>
<mag:Date>2024-01-16</mag:Date>
<mag:Total>250.00</mag:Total>
<mag:Status>Communicated</mag:Status>
<mag:CommunicatedAt>2024-01-16T09:20:00Z</mag:CommunicatedAt>
<mag:ATCode>FTAB-12346</mag:ATCode>
</mag:Document>
</mag:Documents>
</mag:Result>
</mag:TaxCommunicationListResponse>
</soapenv:Body>
</soapenv:Envelope>

Response Fields

FieldTypeDescription
IdstringUnique document identifier
TypestringDocument type code
NumberstringDocument number
DatedateDocument date
TotaldecimalDocument total amount
StatusstringCommunication status
CommunicatedAtdatetimeWhen the document was communicated
ATCodestringUnique code assigned by AT
ErrorMessagestringError message if communication failed

Example (C#)

using System.ServiceModel;

var binding = new BasicHttpsBinding();
var endpoint = new EndpointAddress("https://api.magnifinance.com/soap/v2.1/TaxCommunication");
var client = new TaxCommunicationClient(binding, endpoint);

var filter = new TaxCommunicationFilter
{
StartDate = new DateTime(2024, 1, 1),
EndDate = new DateTime(2024, 1, 31),
Status = "Communicated",
Page = 1,
PageSize = 50
};

var result = await client.TaxCommunicationListAsync(credentials, filter);

if (result.Success)
{
Console.WriteLine($"Total records: {result.Pagination.TotalRecords}");

foreach (var doc in result.Documents)
{
Console.WriteLine($"{doc.Number} - {doc.Status} - AT Code: {doc.ATCode}");
}
}

Notes

  • The ATCode is the unique identifier assigned by the Portuguese Tax Authority
  • Documents with Failed status will include an ErrorMessage field with details
  • Use pagination for large date ranges to avoid timeout issues