Skip to main content

AddPartner

The AddPartner method allows you to register a new company/partner into your IPPN account. Using this method, it is possible to get access for invoicing on behalf of them.

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

Sample Body

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:inv="http://MagniAPI/Invoicing/">
<soap:Header/>
<soap:Body>
<inv:AddPartner>
<inv:Authentication>
<inv:Email>_ippn automation username_</inv:Email>
<inv:Token>_ippn automation main token_</inv:Token>
</inv:Authentication>
<inv:PartnerInformation>
<inv:CompanyLegalName>Magni EShop Partner</inv:CompanyLegalName>
<inv:UserEmail>tech-success@magnifinance.com</inv:UserEmail>
<inv:UserName>tech-success@magnifinance.com</inv:UserName>
<inv:CompanyTaxId>992281008</inv:CompanyTaxId>
<inv:UserPhone>999555111</inv:UserPhone>
<inv:CompanyAddress>Av. Sidonio Pais</inv:CompanyAddress>
<inv:CompanyCity>Lisboa</inv:CompanyCity>
<inv:CompanyPostCode>1050-214</inv:CompanyPostCode>
<inv:CompanyCountry>PT</inv:CompanyCountry>
</inv:PartnerInformation>
</inv:AddPartner>
</soap:Body>
</soap:Envelope>

Request

ParameterRequiredValue
Content-Typerequiredtext/xml

Body

Authentication

ParameterRequiredDescription
Emailrequiredstring Platform automation user email.
Tokenrequiredstring(50) The token of the subscription in which the document will be generated.

PartnerInformation

ParameterRequiredDescription
UserNameoptionalstring(75) Name of the contact person in the partner organization. Example value: "Joao Cardoso"
UserEmailoptionalstring(75) Email of the contact person in the partner organization. Example value: "tech-success@magnifinance.com"
UserPhoneoptionalstring(50) Phone number of the contact person in the partner organization. Example value: "999555111"
CompanyTaxIdoptionalstring(20) Partner organization's tax id. Example value: "513495886"
CompanyLegalNameoptionalstring(50) Partner organization's legal name. Example value: "Magni EShop Partner"
CompanyAddressoptionalstring(200) Partner organization's address. Example value: "Av. Sidonio Pais"
CompanyCityoptionalstring(50) Partner organization's city. Example value: "Lisboa"
CompanyPostCodeoptionalstring(50) Partner organization's post code. Example value: "1050-214"
CompanyCountryoptionalstring(2) Partner organization's country code. (To consult the code list for each country, access the link: ISO 3166-1 alpha-2). Example value: "PT"

Response

ParameterDescription
Typestring Description to inform if the request was success or error. Example value: "Success"
ErrorValueMagniEnum
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"
ErrorHumanReadablestring Text that explains the error found. Example value: "ValidationError"
ValidationErrorsList 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"
ElementNumber - int Identifies index of the field in which validation failed. Example value: "67204"
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/Invoicing.asmx' \
--header 'Content-Type: text/xml' \
--data-raw '<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:inv="http://MagniAPI/Invoicing/">
<soap:Header/>
<soap:Body>
<inv:AddPartner>
<inv:Authentication>
<inv:Email>{EMAIL_IPPN}</inv:Email>
<inv:Token>{TOKEN_IPPN}</inv:Token>
</inv:Authentication>
<inv:PartnerInformation>
<inv:CompanyLegalName>Magni Restaurant Partner</inv:CompanyLegalName>
<inv:UserEmail>tech-success@magnifinance.com</inv:UserEmail>
<inv:UserName>tech-success@magnifinance.com</inv:UserName>
<inv:CompanyTaxId>999918290</inv:CompanyTaxId>
<inv:UserPhone>999555111</inv:UserPhone>
<inv:CompanyAddress>Av. Sidonio Pais</inv:CompanyAddress>
<inv:CompanyCity>Lisboa</inv:CompanyCity>
<inv:CompanyPostCode>1050-214</inv:CompanyPostCode>
<inv:CompanyCountry>PT</inv:CompanyCountry>
</inv:PartnerInformation>
</inv:AddPartner>
</soap:Body>
</soap:Envelope>'

JavaScript (fetch)

var myHeaders = new Headers();
myHeaders.append("Content-Type", "text/xml");

var raw = `<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:inv="http://MagniAPI/Invoicing/">
<soap:Header/>
<soap:Body>
<inv:AddPartner>
<inv:Authentication>
<inv:Email>{EMAIL_IPPN}</inv:Email>
<inv:Token>{TOKEN_IPPN}</inv:Token>
</inv:Authentication>
<inv:PartnerInformation>
<inv:CompanyLegalName>Magni Restaurant Partner</inv:CompanyLegalName>
<inv:UserEmail>tech-success@magnifinance.com</inv:UserEmail>
<inv:UserName>tech-success@magnifinance.com</inv:UserName>
<inv:CompanyTaxId>999918290</inv:CompanyTaxId>
<inv:UserPhone>999555111</inv:UserPhone>
<inv:CompanyAddress>Av. Sidonio Pais</inv:CompanyAddress>
<inv:CompanyCity>Lisboa</inv:CompanyCity>
<inv:CompanyPostCode>1050-214</inv:CompanyPostCode>
<inv:CompanyCountry>PT</inv:CompanyCountry>
</inv:PartnerInformation>
</inv:AddPartner>
</soap:Body>
</soap:Envelope>`;

var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};

fetch("https://bo.magnifinance.com/MagniAPI/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 = `<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:inv="http://MagniAPI/Invoicing/">
<soap:Header/>
<soap:Body>
<inv:AddPartner>
<inv:Authentication>
<inv:Email>{EMAIL_IPPN}</inv:Email>
<inv:Token>{TOKEN_IPPN}</inv:Token>
</inv:Authentication>
<inv:PartnerInformation>
<inv:CompanyLegalName>Magni Restaurant Partner</inv:CompanyLegalName>
<inv:UserEmail>tech-success@magnifinance.com</inv:UserEmail>
<inv:UserName>tech-success@magnifinance.com</inv:UserName>
<inv:CompanyTaxId>999918290</inv:CompanyTaxId>
<inv:UserPhone>999555111</inv:UserPhone>
<inv:CompanyAddress>Av. Sidonio Pais</inv:CompanyAddress>
<inv:CompanyCity>Lisboa</inv:CompanyCity>
<inv:CompanyPostCode>1050-214</inv:CompanyPostCode>
<inv:CompanyCountry>PT</inv:CompanyCountry>
</inv:PartnerInformation>
</inv:AddPartner>
</soap:Body>
</soap:Envelope>`;

var config = {
method: 'post',
url: 'https://bo.magnifinance.com/MagniAPI/Invoicing.asmx',
headers: {
'Content-Type': 'text/xml'
},
data : data
};

axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});

Important Information

When adding a partner, there are two possible scenarios:

Adding a company as a partner that has no registration in our platform

If the company is not registered on our platform, when submitting an AddPartner request our process will automatically register and associate this company with your IPPN account.

Adding a company already registered as MagniFinance client in our platform

If a company is registered on the MagniFinance platform they will receive an email and only after their approval, the partnership will be completed, and the tokens become available. You can consult the request status whenever you want in the Web Interface (Config -> IPPN -> PARTNERSHIP MANAGEMENT).

  • The first state of this request is: access requested
  • After approval by the company, the status will change to: access granted
  • When the access is granted, you can query the partner's token to be able to create documents on behalf of them. To get the tokens, you can use the GetPartnerAccessTokens endpoint.