API documentation Menu
POST https://bo.magnifinance.com/MagniAPI/Invoicing.asmx
API 2.1
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. Sidónio 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
Header
Parameter | Required | Value |
---|---|---|
Content-Type | required | text/xml |
Body
Authentication
Parameter | Required | Description |
---|---|---|
required | string Platform automation user email. | |
Token | required | string(50) The token of the subscription in which the document will be generated. |
PartnerInformation
Parameter | Required | Description |
---|---|---|
UserName | optional | string(75) Name of the contact person in the partner organization. Example value: "João Cardoso" |
UserEmail | optional | string(75) Name of the contact person in the partner organization. Example value: "tech-success@magnifinance.com" |
UserPhone | optional | string(50) Phone number of the contact person in the partner organization. Example value: "999555111" |
CompanyTaxId | optional | string(20) Partner organization’s tax id. Example value: "513495886" |
CompanyLegalName | optional | string(50) Partner organization’s legal name. Example value: "Magni EShop Partner" |
CompanyAddress | optional | string(200) Partner organization’s address. Example value: "Av. Sidónio Pais" |
CompanyCity | optional | string(50) Partner organization’s city. Example value: "Lisboa" |
CompanyPostCode | optional | string(50) Partner organization’s post code. Example value: "1050-214" |
CompanyCountry | optional | string(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
Type | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|
Type | string Description to inform if the request was success or error. Example value: "Success" | ||||||||
ErrorValue | MagniEnum | ||||||||
|
|||||||||
ErrorHumanReadable | string Text that explains the error found. Example value: "ValidationError" | ||||||||
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/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. Sidónio 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/\">\r\n <soap:Header/>\r\n <soap:Body>\r\n <inv:AddPartner>\r\n <inv:Authentication>\r\n <inv:Email>{EMAIL_IPPN}</inv:Email>\r\n <inv:Token>{TOKEN_IPPN}</inv:Token>\r\n </inv:Authentication>\r\n <inv:PartnerInformation>\r\n <inv:CompanyLegalName>Magni Restaurant Partner</inv:CompanyLegalName>\r\n <inv:UserEmail>tech-success@magnifinance.com</inv:UserEmail>\r\n <inv:UserName>tech-success@magnifinance.com</inv:UserName>\r\n <inv:CompanyTaxId>999918290</inv:CompanyTaxId>\r\n <inv:UserPhone>999555111</inv:UserPhone>\r\n <inv:CompanyAddress>Av. Sidónio Pais</inv:CompanyAddress>\r\n <inv:CompanyCity>Lisboa</inv:CompanyCity>\r\n <inv:CompanyPostCode>1050-214</inv:CompanyPostCode>\r\n <inv:CompanyCountry>PT</inv:CompanyCountry>\r\n </inv:PartnerInformation>\r\n </inv:AddPartner>\r\n </soap:Body>\r\n</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/">\r\n <soap:Header/>\r\n <soap:Body>\r\n <inv:AddPartner>\r\n <inv:Authentication>\r\n <inv:Email>{EMAIL_IPPN}</inv:Email>\r\n <inv:Token>{TOKEN_IPPN}</inv:Token>\r\n </inv:Authentication>\r\n <inv:PartnerInformation>\r\n <inv:CompanyLegalName>Magni Restaurant Partner</inv:CompanyLegalName>\r\n <inv:UserEmail>tech-success@magnifinance.com</inv:UserEmail>\r\n <inv:UserName>tech-success@magnifinance.com</inv:UserName>\r\n <inv:CompanyTaxId>999918290</inv:CompanyTaxId>\r\n <inv:UserPhone>999555111</inv:UserPhone>\r\n <inv:CompanyAddress>Av. Sidónio Pais</inv:CompanyAddress>\r\n <inv:CompanyCity>Lisboa</inv:CompanyCity>\r\n <inv:CompanyPostCode>1050-214</inv:CompanyPostCode>\r\n <inv:CompanyCountry>PT</inv:CompanyCountry>\r\n </inv:PartnerInformation>\r\n </inv:AddPartner>\r\n </soap:Body>\r\n</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 informations
-
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 Interface Web 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.