API documentation Menu
POST https://bo.magnifinance.com/MagniAPI/invoicing.asmx
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 |
---|---|---|
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 | |||||||||||||||||||||||
|
|||||||||||||||||||||||
ErrorValue | MagniEnum | ||||||||||||||||||||||
|
|||||||||||||||||||||||
ValidationErrors | List of ValidationError | ||||||||||||||||||||||
|
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>