Skip to main content

Tax Communication

The Tax Communication API sends your fiscal documents to the tax authority automatically, right after they are created. You can switch it on, check whether it is on, and list the documents it has communicated and their status. Today it communicates with the Portuguese Tax Authority (Autoridade Tributária, AT).

It is available both as a REST API (JSON) and as a SOAP API. Both offer the same operations; REST is the recommended choice for new integrations.

info

This service is disabled by default when you subscribe to the API or IPPN service. Contact our team to enable this feature.

Portugal​

Tax communication in Portugal is mandatory for businesses that issue fiscal documents. This service helps eliminate the work of submitting the SAF-T file every month by automating the communication of invoices directly to the Portuguese Tax Authority (AT).

The MagniFinance API provides endpoints to:

  • Activate tax communication for your account
  • Check activation status to verify if tax communication is properly configured
  • List communicated documents to track which documents have been sent to tax authorities
  • Communicate partner series through IPPN (Invoicing Platform for Partners Network, documented in its own section of the developer portal)

Available Operations​

OperationRESTSOAPDescription
Activation SetPOST /api/v2.1/taxCommunication/activationSetActivationSetEnable or configure tax communication for your account
Activation GetGET /api/v2.1/taxCommunication/activationGetActivationGetRetrieve current tax communication activation status
List DocumentsPOST /api/v2.1/taxCommunication/communicationListCommunicationListGet a list of documents that have been communicated
Communicate Partner SeriesPOST /api/v2.1/taxCommunication/iPPNCommunicatePartnerSeriesIPPNCommunicatePartnerSeriesCommunicate document series through IPPN (documented in the IPPN section)

Postman Try it in Postman​

The three operations are in a ready-made Postman collection with the bodies already filled in. There is one for each API:

  • REST: download the collection, or paste this URL in Postman's Import:
    https://developer.magnifinance.com/finance/postman/tax-communication-rest.json
  • SOAP: download the collection, or paste this URL in Postman's Import:
    https://developer.magnifinance.com/finance/postman/tax-communication-soap.json
  1. Import the collection.
  2. Open its Variables tab and fill in email and token (see Authentication). To turn the service on, also fill in atUsername and atPassword with your Tax Authority user.
  3. Send Activation Get first: it only reads. Activation Set checks the AT credentials right away and warns you when the AT rejected them.

REST​

Base URL​

https://bo.magnifinance.com/api/v2.1/taxCommunication

Authentication​

Send your email and token as HTTP headers on every request:

HeaderDescription
emailYour API user email
tokenYour subscription token

A request without either header is answered with HTTP 401 Unauthorized. A wrong email or token is answered with HTTP 200 and an AuthenticationError (1) in the response body.

Responses use the standard JSON envelope (RequestId, Type, Object, ErrorValue, ErrorHumanReadable, ValidationErrors, IsSuccess, IsError) described in Responses.

SOAP​

SOAP Endpoint​

https://bo.magnifinance.com/MagniAPI/taxcommunication.asmx

WSDL​

https://bo.magnifinance.com/MagniAPI/taxcommunication.asmx?wsdl

Authentication​

All SOAP tax communication operations require authentication using your email and token in the SOAP body, with the namespace http://MagniAPI/TaxCommunication/:

<soapenv:Body>
<tax:YourOperation xmlns:tax="http://MagniAPI/TaxCommunication/">
<tax:Email>your_email</tax:Email>
<tax:Token>your_token</tax:Token>
<!-- other parameters -->
</tax:YourOperation>
</soapenv:Body>

Requirements​

Before using tax communication features, ensure that:

  1. Your account has been properly configured with the Portuguese Tax Authority (AT)
  2. You have valid credentials for the AT web services
  3. Your company's tax identification number (NIF) is correctly registered