Invoice / CFDI
Cancels a CFDI (Version 2018 - Updated for 2022 with Cancellation Reason) If authorization is required, submits the request
DELETE
/
cfdi
/
{id}
Cancels a CFDI (Version 2018 - Updated for 2022 with Cancellation Reason)
If authorization is required, submits the request
curl --request DELETE \
--url https://apisandbox.facturama.mx/cfdi/{id} \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://apisandbox.facturama.mx/cfdi/{id}"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://apisandbox.facturama.mx/cfdi/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://apisandbox.facturama.mx/cfdi/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://apisandbox.facturama.mx/cfdi/{id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://apisandbox.facturama.mx/cfdi/{id}")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("https://apisandbox.facturama.mx/cfdi/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body{
"Id": "J6MjEYRjnLnV6aMCK8dV-w2",
"Status": "canceled",
"CancelationStatus": "canceled"
}Authorizations
HTTP Basic authentication with Facturama username and password.
Path Parameters
CFDI ID in Facturama
Query Parameters
Voucher type for Web API: ( issued | payroll ) and for Multi-issuer API: ( issuedLite )
Cancellation reason ( 01 | 02 | 03 | 04 )
UUID of the voucher that replaces the cancelled voucher
Response
200 - application/json
On a successful response returns the issued CFDI, otherwise returns an error with the message
Response model for API cancellation calls
State del CFDI ( canceled, requested ,rejected )
UUID of the queried CFDI
Cancellation request date
Date the cancellation request is responded to
Validity of the cancellation request
Validity of the cancellation request
⌘I
Cancels a CFDI (Version 2018 - Updated for 2022 with Cancellation Reason)
If authorization is required, submits the request
curl --request DELETE \
--url https://apisandbox.facturama.mx/cfdi/{id} \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://apisandbox.facturama.mx/cfdi/{id}"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://apisandbox.facturama.mx/cfdi/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://apisandbox.facturama.mx/cfdi/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://apisandbox.facturama.mx/cfdi/{id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://apisandbox.facturama.mx/cfdi/{id}")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("https://apisandbox.facturama.mx/cfdi/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body{
"Id": "J6MjEYRjnLnV6aMCK8dV-w2",
"Status": "canceled",
"CancelationStatus": "canceled"
}