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
| Parameter | Type | Required | Description |
|---|---|---|---|
StartDate | date | No | Filter documents from this date (inclusive) |
EndDate | date | No | Filter documents until this date (inclusive) |
Status | string | No | Filter by communication status |
DocumentType | string | No | Filter by document type (FT, FS, FR, NC, etc.) |
Page | integer | No | Page number for pagination (default: 1) |
PageSize | integer | No | Number of records per page (default: 50, max: 100) |
Status Values
| Status | Description |
|---|---|
Pending | Document awaiting communication |
Communicated | Successfully communicated to AT |
Failed | Communication failed |
Cancelled | Document 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
| Field | Type | Description |
|---|---|---|
Id | string | Unique document identifier |
Type | string | Document type code |
Number | string | Document number |
Date | date | Document date |
Total | decimal | Document total amount |
Status | string | Communication status |
CommunicatedAt | datetime | When the document was communicated |
ATCode | string | Unique code assigned by AT |
ErrorMessage | string | Error 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
ATCodeis the unique identifier assigned by the Portuguese Tax Authority - Documents with
Failedstatus will include anErrorMessagefield with details - Use pagination for large date ranges to avoid timeout issues