API documentation Menu
PATCH https://bo.magnifinance.com/api/v1.1/document?documentId={DocumentId}
API 2.1
Cancel a Document
Changes the document state to canceled and updates the PDF.
PATCH https://bo.magnifinance.com/api/v1.1/document?documentId={DocumentId}
Request
Header
Parameter | Required | Value |
---|---|---|
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. |
*These parameters must be an HTTP headers within the request.
Query
Parameter | Required | Description |
---|---|---|
DocumentId | required | int Id of the document that you want to delete. Example value: "67053" In the REST API you should request as a query string parameter in the URL. Example: ?documentId=67053 |
Response
Parameter | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
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" | ||||||||||
Object | null | ||||||||||
|
|||||||||||
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 PATCH'https://bo.magnifinance.com/api/v1/document?documentId={DOCUMENTID}' \
--header 'email: ' \
--header 'token: ' \
--header 'Cookie: ARRAffinity=; ARRAffinitySameSite=' \
--data-raw ''
Javascript (fetch)
var myHeaders = new Headers();
myHeaders.append("email", "");
myHeaders.append("token", "");
myHeaders.append("Cookie", "ARRAffinity=; ARRAffinitySameSite=");
var raw = "";
var requestOptions = {
method: 'PATCH',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://bo.magnifinance.com/api/v1/document?documentId={DOCUMENTID}", 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: 'PATCH',
url: 'https://bo.magnifinance.com/api/v1/document?documentId={DOCUMENTID}',
headers: {
'email': '',
'token': '',
'Cookie': 'ARRAffinity=; ARRAffinitySameSite='
},
data: data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
NodeJs (axios)
var axios = require('axios');
var data = '';
var config = {
method: 'PATCH',
url: 'https://bo.magnifinance.com/api/v1/document?documentId={DOCUMENTID}',
headers: {
'email': '',
'token': '',
'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
{
"RequestId": "88202672-2e68-4f90-8055-e6e2120f401f",
"Object": null,
"Type": 0,
"ErrorValue": null,
"ErrorHumanReadable": null,
"ValidationErrors": null,
"IsSuccess": true,
"IsError": false
}
Error
{
"RequestId": "bd3f677a-f7c5-4c30-9c01-6aefaab2b7be",
"Object": null,
"Type": 1,
"ErrorValue": {
"Value": 6,
"Name": "ElementDoesNotExist"
},
"ErrorHumanReadable": null,
"ValidationErrors": null,
"IsSuccess": false,
"IsError": true
}