Nova aplicação de telemóvel | Experimente grátis!
Faturar no iphone com MagniFinance. Aceda ao link da Apple store Faturar no Android com MagniFinance. Aceda ao link para Android Store
 
API documentation Menu

API 2.1

Communicate Partner Series


The "IPPN Communicate Partner Series" API method enables IPPN users to communicate to the Portugal Tax Authority (AT) all the series of a partner that will be used for invoicing on their behalf. This can be done either by the IPPN user configuring the AT credentials of the partners if they have this data, or by the partner doing so after the company has been registered by the IPPN user.

The series communication process is legally mandatory in Portugal. By using this endpoint, you do not need to wait for the partner to communicate their series manually. This can help streamline the invoicing process and ensure compliance with legal requirements.


POST https://bo.magnifinance.com/MagniAPI/TaxCommunication.asmx

Sample Body

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tax="http://MagniAPI/TaxCommunication/"> <soapenv:Header/> <soapenv:Body> <tax:IPPNCommunicatePartnerSeries> <tax:authentication> <tax:Email>XXX@example.com</tax:Email> <tax:Token>XXX</tax:Token> </tax:authentication> </tax:IPPNCommunicatePartnerSeries> </soapenv:Body> </soapenv:Envelope>


Request

Header

Parameter Required Value
Content-Type required text/xml

Body

Authentication

Parameter Required Description
Email required string(50) The API user with specific IPPN permission to communicate series in behalf of your partner. Example: api@example.com
Token required string(50) The token of a partner that you want to communicate their IPPN series.


Response

Type Description
Type string Description to inform if the request was a success or error. Example value: "Success"
Object
IPPNCommunicateSeriesOut
SeriesName stringThe name of the serie that the method tried to communicate to AT. Example value: "FT2023"
FiscalDocumentSubTypeId string(1) Its a letter that indicates the type of the document. Example: “T” for Invoice/Receipt, “I” for Invoice, “S” for Simplified Invoice,“C” for Credit Note, “D” for Debit Note, "B" for budget,"Z" for purchase order, "W" for Transport Guide, "Y" for Delivery Note, "P" for Pro-forma Example value:"T"
Status string It is the status of the communication to AT. Shold indicate if the series was well communicated or not. Example value: "Communicated"
ErrorValue MagniEnum
Value string Identifies the error with a number. To identify the types of errors in more detail, click here. Example value: "38"
Name string Identifies the error with a token. Example value: "PartnershipNotFound"


Request Sample

Below you can check some examples of the SOAP request in some technologies.


cURL

curl --location --request POST 'https://bo.magnifinance.com/MagniAPI/TaxCommunication.asmx' \ --header 'Content-Type: application/soap+xml; charset=utf-8' \ --data-raw '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tax="http://MagniAPI/TaxCommunication/"> <soapenv:Header/> <soapenv:Body> <tax:IPPNCommunicatePartnerSeries> <tax:authentication> <tax:Email>XXX@example.com</tax:Email> <tax:Token>XXX</tax:Token> </tax:authentication> </tax:IPPNCommunicatePartnerSeries> </soapenv:Body> </soapenv:Envelope>'


Javascript (fetch)

var myHeaders = new Headers(); myHeaders.append("Content-Type", "application/soap+xml; charset=utf-8"); var raw = "<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tax="http://MagniAPI/TaxCommunication/"> <soapenv:Header/> <soapenv:Body> <tax:IPPNCommunicatePartnerSeries> <tax:authentication> <tax:Email>XXX@example.com</tax:Email> <tax:Token>XXX</tax:Token> </tax:authentication> </tax:IPPNCommunicatePartnerSeries> </soapenv:Body> </soapenv:Envelope>"; var requestOptions = { method: 'POST', headers: myHeaders, body: raw, redirect: 'follow' }; fetch("https://bo.magnifinance.com/MagniAPI/TaxCommunication.asmx", requestOptions) .then(response => response.text()) .then(result => console.log(result)) .catch(error => console.log('error', error));


NodeJs (axios)

var axios = require('axios'); var data = '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tax="http://MagniAPI/TaxCommunication/"> <soapenv:Header/> <soapenv:Body> <tax:IPPNCommunicatePartnerSeries> <tax:authentication> <tax:Email>XXX@example.com</tax:Email> <tax:Token>XXX</tax:Token> </tax:authentication> </tax:IPPNCommunicatePartnerSeries> </soapenv:Body> </soapenv:Envelope>'; var config = { method: 'post', url: 'https://bo.magnifinance.com/MagniAPI/TaxCommunication.asmx', headers: { 'Content-Type': 'application/soap+xml; charset=utf-8' }, data : data }; axios(config) .then(function (response) { console.log(JSON.stringify(response.data)); }) .catch(function (error) { console.log(error); });


Example Response

Success

<?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">     <soap:Body>         <IPPNCommunicatePartnerSeriesResponse xmlns="http://MagniAPI/TaxCommunication/">             <ResponseIPPNCommunicatePartnerSeries>                 <Type>Success</Type>                 <Object>                     <IPPNCommunicateSeriesOut>                         <SeriesName>MAGNITESTING</SeriesName>                         <FiscalDocumentSubTypeId>T</FiscalDocumentSubTypeId>                         <Status>Communicated</Status>                     </IPPNCommunicateSeriesOut>                     <IPPNCommunicateSeriesOut>                         <SeriesName>MAGNITESTINGNC</SeriesName>                         <FiscalDocumentSubTypeId>C</FiscalDocumentSubTypeId>                         <Status>Communicated</Status>                     </IPPNCommunicateSeriesOut>                     <IPPNCommunicateSeriesOut>                         <SeriesName>MAGNITESTINGM</SeriesName>                         <FiscalDocumentSubTypeId>T</FiscalDocumentSubTypeId>                         <Status>Communicated</Status>                     </IPPNCommunicateSeriesOut>                     <IPPNCommunicateSeriesOut>                         <SeriesName>MAGNITESTINGNCM</SeriesName>                         <FiscalDocumentSubTypeId>C</FiscalDocumentSubTypeId>                         <Status>Communicated</Status>                     </IPPNCommunicateSeriesOut>                 </Object>             </ResponseIPPNCommunicatePartnerSeries>         </IPPNCommunicatePartnerSeriesResponse>     </soap:Body></soap:Envelope>


Error

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap:Body> <IPPNCommunicatePartnerSeriesResponse xmlns="http://MagniAPI/TaxCommunication/"> <ResponseIPPNCommunicatePartnerSeries> <Type>Error</Type> <ErrorValue> <Value>29</Value> <Name>ATInvalidCredencials</Name> </ErrorValue> </ResponseIPPNCommunicatePartnerSeries> </IPPNCommunicatePartnerSeriesResponse> </soap:Body> </soap:Envelope>

Este site usa cookies para melhorar o desempenho e experiência. Ao continuar, declara aceitar todos os cookies. Fechar