Nova aplicação de telemóvel | Experimente grátis!
Faturar no iphone com MagniFinance. Aceda ao link da Apple store Faturar no Android com MagniFinance. Aceda ao link para Android Store
 
API documentation Menu

API 2.0 | Go to the latest documentation arrow_forward

Cancel a Document

Changes the document state to canceled and updates the PDF.



PATCH https://bo.magnifinance.com/api/v1/document?documentId={DocumentId}

Request

Header

Parameter Required Value
Email required 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
ErrorMessage string Unprocessed error message.
ErrorValue MagniEnum
Value intIdentifies the error with a number. To identify the types of errors in more detail, click hereExample 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 int 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 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 }

Este site usa cookies para melhorar o desempenho e experiência. Ao continuar, declara aceitar todos os cookies. Fechar