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

Client Get


Get data about a partner that is already registered in MagniFinance. Example: Name, legal name, address, city, country name, country code, postal Code, phone number, email, IBAN.



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


Request

Header

Parameter Required value
Content-Type required text/xml


Body

ClientGet

Authentication

Parameter Required Description
Email required string(50) The API user with specific permission to create documents and get information about your own documents into a company Example: api@magnifinance.com
Token required string(50) The token of the subscription in which the document will be generated.


Parameter Required Description
TaxId required int Tax id of the partner organization that you want to get data. Example value: "599138645"
CountryCode required string(2) Client country (To consult the code list for each country, access the link: ISO 3166-1 alpha-2. Example value: "PT"



Response

Parameter Description
RequestId Unique Id for the request to have a way to identify the request
Type int 0 = Success; 1 = Error; “Success” or “Error”. Object will be returned on Success; ErrorValue, ErrorHumanReadable, ValidationErrors will be returned on Error. Example value: Example value: "0"
Object
NIF string Partner Tax ID. Example: "166737755"
Name string The commercial name of the company. Example: "MagniFinance"
Address string The address of the company. Example: "Rua das Barreiras"
City string The city of the company. Example: "Lisboa"
PostCode string The postal code of the company. Example: "1000-000"
CountryCode string Company country code in ISO 3166-1 alpha-2 "PT"
PhoneNumber string Company phone number. Example: "912345678"
CountryName string Name of the country. Example value: "Portugal"
CompanyLegalName string Partner organization legal name. Example value: "Magni EShop Partner"
Email stringThe email of the company. Example value: "email@example.com"
IBAN string Company international bank account number. Example value: "PT50002700000001234567833"
ErrorValue MagniEnum
Value int Identifies the error with a number. To identify the types of errors in more detail, click here Example value: "14"
Name string Identifies the error with a token. Example value: "SaveFailed"
ValidationErrors List of ValidationError
Type string Identifies the error with a token. Example value: "DocumentIsADuplicate"
ElementNumber string Identifies index of the field in which validation failed. Example value: "67204"
Field string Name of the field in which validation failed. Example value: "DocumentDetailExternalId"
Detail string detailed error explanation. Example value: "Duplicate Document"


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/v1.1/Invoicing.asmx' \ --header 'Content-Type: application/soap+xml; charset=utf-8' \ --data-raw '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:inv="http://MagniAPI/Invoicing/"> <soapenv:Header/> <soapenv:Body> <inv:ClientGet> <!--Optional:--> <inv:Authentication> <!--Optional:--> <inv:Email>XXX@example.com</inv:Email> <!--Optional:--> <inv:Token>XXX</inv:Token> </inv:Authentication> <!--Optional:--> <inv:TaxId>XXX</inv:TaxId> <!--Optional:--> <inv:CountryCode>XX</inv:CountryCode> </inv:ClientGet> </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:inv="http://MagniAPI/1.1/Invoicing/"> <soapenv:Header/> <soapenv:Body> <inv:ClientGet> <!--Optional:--> <inv:Authentication> <!--Optional:--> <inv:Email>XXX@example.com</inv:Email> <!--Optional:--> <inv:Token>XXX</inv:Token> </inv:Authentication> <!--Optional:--> <inv:TaxId>XXX</inv:TaxId> <!--Optional:--> <inv:CountryCode>XX</inv:CountryCode> </inv:ClientGet> </soapenv:Body> </soapenv:Envelope>"; var requestOptions = { method: 'POST', headers: myHeaders, body: raw, redirect: 'follow' }; fetch("https://bo.magnifinance.com/MagniAPI/v1.1/Invoicing.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:inv="http://MagniAPI/Invoicing/"> <soapenv:Header/> <soapenv:Body> <inv:ClientGet> <!--Optional:--> <inv:Authentication> <!--Optional:--> <inv:Email>XXX@example.com</inv:Email> <!--Optional:--> <inv:Token>XXX</inv:Token> </inv:Authentication> <!--Optional:--> <inv:TaxId>XXX</inv:TaxId> <!--Optional:--> <inv:CountryCode>XX</inv:CountryCode> </inv:ClientGet> </soapenv:Body> </soapenv:Envelope>'; var config = { method: 'post', url: 'https://bo.magnifinance.com/MagniAPI/v1.1/Invoicing.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

<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> <ClientGetResponse xmlns="http://MagniAPI/Invoicing/"> <ResponseClientGet> <RequestId>14be39b8-5dea-4a82-bf8b-7a1e4a48a69b</RequestId> <Type>Success</Type> <Object> <NIF>123456789</NIF> <Name>Empresa exemplar</Name> <Address>Rua das Barreiras</Address> <City>Lisboa</City> <PostCode>1234-567</PostCode> <CountryCode>PT</CountryCode> <PhoneNumber>999999999</PhoneNumber> <CountryName>Portugal</CountryName> <LegalName>Empresa Exemplar lda</LegalName> <Email>email@exemplo.com</Email> <IBAN>PT50002700000001234567833</IBAN> </Object> </ResponseClientGet> </ClientGetResponse> </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> <ClientGetResponse xmlns="http://MagniAPI/Invoicing/"> <ResponseClientGet> <RequestId>7a3db77d-20d5-4eae-a6ef-58471c3f6e8a</RequestId> <Type>Error</Type> <ErrorValue> <Value>2</Value> <Name>ValidationError</Name> </ErrorValue> <ValidationErrors> <ValidationError> <Type>InvalidTaxId</Type> <ElementNumber>0</ElementNumber> <Field>TaxId</Field> <Detail>Invalid Tax Id</Detail> </ValidationError> </ValidationErrors> </ResponseClientGet> </ClientGetResponse> </soap:Body> </soap:Envelope>

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