API documentation Menu
POST https://bo.magnifinance.com/MagniAPI/Invoicing.asmx
API 2.1
Cancel Document
Changes the document state to canceled and updates the PDF.
POST https://bo.magnifinance.com/MagniAPI/Invoicing.asmx
Sample Body
< soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope" >
< soap12:Body >
< DocumentCancel xmlns="http://MagniAPI/Invoicing/" >
< Authentication >
< Email >< /Email >
< Token >< /Token >
< /Authentication >
< DocumentId >68058< /DocumentId >
< /DocumentCancel >
< /soap12:Body >
< /soap12:Envelope >
Request
Header
Parameter | Required | Value |
---|---|---|
Content-Type | required | text/xml |
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 | The token of the subscription in which the document will be generated. |
Parameter | Required | Description |
---|---|---|
DocumentId | required | int Id of the document that you want to retrieve. Example value: "67053" |
Response
Parameter | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Type | string Description to inform if the request was a success or error. Example value: "Success" | ||||||||||
Object | DocumentGetOut | ||||||||||
|
|||||||||||
ErrorValue | MagniEnum | ||||||||||
|
|||||||||||
ErrorHumanReadable | string Text that explains the error found. Example value: "ValidationError" | ||||||||||
ValidationErrors | List of ValidationError | ||||||||||
|
Request Sample
Below you can see a few 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' \
--header 'Cookie: ARRAffinity=; ARRAffinitySameSite=' \
--data-raw '<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:inv="http://MagniAPI/Invoicing/">
<soap:Header/>
<soap:Body>
<inv:DocumentCancel>
<!--Optional:-->
<inv:Authentication>
<!--Optional:-->
<inv:Email></inv:Email>
<!--Optional:-->
<inv:Token></inv:Token>
</inv:Authentication>
<inv:DocumentId>67267</inv:DocumentId>
</inv:DocumentCancel>
</soap:Body>
</soap:Envelope>'
Javascript (fetch)
var myHeaders = new Headers();
myHeaders.append("Content-Type", "text/xml");
myHeaders.append("Cookie", "ARRAffinity=; ARRAffinitySameSite=");
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:DocumentCancel>\r\n <!--Optional:-->\r\n <inv:Authentication>\r\n <!--Optional:-->\r\n <inv:Email></inv:Email>\r\n <!--Optional:-->\r\n <inv:Token></inv:Token>\r\n </inv:Authentication>\r\n <inv:DocumentId>67267</inv:DocumentId>\r\n </inv:DocumentGet>\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:DocumentCancel>\r\n <!--Optional:-->\r\n <inv:Authentication>\r\n <!--Optional:-->\r\n <inv:Email></inv:Email>\r\n <!--Optional:-->\r\n <inv:Token></inv:Token>\r\n </inv:Authentication>\r\n <inv:DocumentId>67267</inv:DocumentId>\r\n </inv:DocumentCancel>\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',
'Cookie': 'ARRAffinity=; ARRAffinitySameSite='
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
Example Response
Success
< ?xml version="1.0" encoding="utf-8"?>
< soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
< soap:Body>
< DocumentCancelResponse xmlns="http://MagniAPI/Invoicing/">
< Response>
< RequestId>1a02c786-54e2-4315-b36f-6996bb5d7634< /RequestId>
< Type>Success< /Type>
< /Response>
< /DocumentCancelResponse>
< /soap:Body>
< /soap:Envelope>
Error
< ?xml version="1.0" encoding="utf-8"?>
< soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
< soap:Body>
< DocumentCancelResponse xmlns="http://MagniAPI/Invoicing/">
< Response>
< RequestId>15874aa7-d647-4e75-9834-b308f6a8a1f1< /RequestId>
< Type>Error< /Type>
< ErrorValue>
< Value>6< /Value>
< Name>ElementDoesNotExist< /Name>
< /ErrorValue>
< /Response>
< /DocumentCancelResponse>
< /soap:Body>
< /soap:Envelope>