API documentation Menu
GET https://bo.magnifinance.com/api/v1.1/taxIdValidation?countryCode={countryCode}&taxId={taxId}
API 2.1
TaxId Validation
Get the information if the TaxId is valid or not.
GET https://bo.magnifinance.com/api/v1.1/taxIdValidation?countryCode={countryCode}&taxId={taxId}
Request
Header
Parameter | Required | Value |
---|---|---|
required | string(50) The email address of the owner of the IPPN service with specific permissions to use IPPN services. Example: api@example.com | |
Token | required | The token for the IPPN account is specific to your IPPN service and is provided by our commercial team. |
*These parameters must be an HTTP headers within the request.
Query
Parameter | Required | Description |
---|---|---|
taxId | required | int Tax id of the partner organization that you want to get data. Example value: "599138645" In the REST API you should request as a query string parameter in the URL. Example: ?TaxId=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" | ||||||||||
ErrorValue | MagniEnum | ||||||||||
|
|||||||||||
ErrorHumanReadable | string Text that explains the error found. Example value: "ValidationError" | ||||||||||
ValidationErrors | List of ValidationError | ||||||||||
|
|||||||||||
IsError | boolean Whether the request failed or not. Example value: "false" | ||||||||||
IsSuccess | boolean Whether the request succeeded or not. Example value: "true" |
Request Sample
Below you can check some examples of the REST request in some technologies.
cURL
curl --location --request GET 'https://bo.magnifinance.com/api/v1.1/taxIdValidation?countryCode={countryCode}&taxId={taxId}' \
--header 'email: XXX@example.com' \
--header 'token: XXX' \
Javascript (fetch)
var myHeaders = new Headers();
myHeaders.append("email", "XXX@example.com");
myHeaders.append("token", "XXX");
var raw = "";
var requestOptions = {
method: 'GET',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://bo.magnifinance.com/api/v1.1/taxIdValidation?countryCode={countryCode}&taxId={taxId}", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
NodeJs (axios)
var axios = require('axios');
var data = '';
var config = {
method: 'get',
url: 'https://bo.magnifinance.com/api/v1.1/taxIdValidation?countryCode={countryCode}&taxId={taxId}',
headers: {
'email': 'XXX@example.com',
'token': 'XXX',
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
Example Response
Success
{
"RequestId": "65d21065-115c-4766-964e-d31412e37461",
"Type": 0,
"ErrorValue": null,
"ErrorHumanReadable": null,
"ValidationErrors": null,
"IsSuccess": true,
"IsError": false
}
Error
{
"RequestId": "7869d1d8-599c-451f-add5-f2f7d1c565a9",
"Type": 1,
"ErrorValue": {
"Value": 4,
"Name": "InvalidTaxId"
},
"ErrorHumanReadable": null,
"ValidationErrors": null,
"IsSuccess": false,
"IsError": true
}