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.
GET https://bo.magnifinance.com/api/v1.1/client?countryCode=PT&taxId={partnerTaxId}
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. |
note
*These parameters must be 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 |
| 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. Example: "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" |
string The email of the company. Example value: "email@example.com" | |
| - IBAN | string Company international bank account number. Example value: "PT50002700000001234567833" |
| 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: "0" |
| 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" |
| ErrorHumanReadable | string Text that explains the error found. Example value: "ValidationError" |
| ValidationErrors | List of ValidationError |
| - Type | string Identifies the error with a token. Example value: "DocumentIsADuplicate" |
| - Field | string Name of the field in which validation failed. Example value: "DocumentDetailExternalId" |
| - Value | string Value which failed validation. Example value: "6" |
| - ElementNumber | string Identifies index of the field in which validation failed. Example value: "67204" |
| - Detail | string Detailed error explanation. Example value: "Duplicate Document" |
| 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/client?countryCode=PT&taxId={partnerTaxId}' \
--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 requestOptions = {
method: 'GET',
headers: myHeaders,
redirect: 'follow'
};
fetch("https://bo.magnifinance.com/api/v1.1/client?countryCode=PT&taxId={partnerTaxId}", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
NodeJs (axios)
var axios = require('axios');
var config = {
method: 'get',
url: 'https://bo.magnifinance.com/api/v1.1/client?countryCode=PT&taxId={partnerTaxId}',
headers: {
'email': 'XXX@example.com',
'token': 'XXX'
}
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
Python (requests)
import requests
url = "https://bo.magnifinance.com/api/v1.1/client"
headers = {
"email": "XXX@example.com",
"token": "XXX"
}
params = {
"countryCode": "PT",
"taxId": "{partnerTaxId}"
}
response = requests.get(url, headers=headers, params=params)
print(response.json())
PHP (cURL)
<?php
$countryCode = "PT";
$taxId = "{partnerTaxId}";
$ch = curl_init("https://bo.magnifinance.com/api/v1.1/client?countryCode=" . $countryCode . "&taxId=" . $taxId);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"email: XXX@example.com",
"token: XXX"
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
C# (HttpClient)
using System.Net.Http;
var client = new HttpClient();
client.DefaultRequestHeaders.Add("email", "XXX@example.com");
client.DefaultRequestHeaders.Add("token", "XXX");
var response = await client.GetAsync("https://bo.magnifinance.com/api/v1.1/client?countryCode=PT&taxId={partnerTaxId}");
Console.WriteLine(await response.Content.ReadAsStringAsync());
Java (HttpClient)
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://bo.magnifinance.com/api/v1.1/client?countryCode=PT&taxId={partnerTaxId}"))
.header("email", "XXX@example.com")
.header("token", "XXX")
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
Example Response
Success
{
"RequestId": "85f75487-4fc6-41a0-8e2e-3cef7e986560",
"Object": {
"NIF": "123456789",
"Name": "Empresa exemplar",
"Address": "Rua das Barreiras",
"City": "Lisboa",
"PostCode": "1234-567",
"CountryCode": "PT",
"PhoneNumber": "999999999",
"CountryName": "Portugal",
"LegalName": "Empresa exemplar s.a",
"Email": "email@exemplo.com",
"IBAN": "PT50002700000001234567833"
},
"Type": 0,
"ErrorValue": null,
"ErrorHumanReadable": null,
"ValidationErrors": null,
"IsSuccess": true,
"IsError": false
}
Error
{
"RequestId": "b4422f0e-0a98-489d-b058-f505a8666f2c",
"Object": null,
"Type": 1,
"ErrorValue": {
"Value": 2,
"Name": "ValidationError"
},
"ErrorHumanReadable": null,
"ValidationErrors": [
{
"Type": "InvalidTaxId",
"ElementNumber": 0,
"Field": "TaxId",
"Detail": "Invalid Tax Id"
}
],
"IsSuccess": false,
"IsError": true
}