List the cancellation history for an invoice
curl --request GET \
--url https://api.example.com/invoices/{uuid}/cancellations \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.example.com/invoices/{uuid}/cancellations"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.example.com/invoices/{uuid}/cancellations', 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://api.example.com/invoices/{uuid}/cancellations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$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://api.example.com/invoices/{uuid}/cancellations"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/invoices/{uuid}/cancellations")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/invoices/{uuid}/cancellations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body[
{
"id": "<string>",
"invoiceId": "<string>",
"motivo": "01",
"requiresApproval": true,
"cancellationStatus": "pendiente",
"createdAt": "2023-11-07T05:31:56Z",
"folioSustitucion": {},
"respondBy": {},
"requestedBy": {},
"resolvedBy": {},
"resolvedAt": {}
}
]Invoices
List Invoice Cancellations
GET
/
invoices
/
{uuid}
/
cancellations
List the cancellation history for an invoice
curl --request GET \
--url https://api.example.com/invoices/{uuid}/cancellations \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.example.com/invoices/{uuid}/cancellations"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.example.com/invoices/{uuid}/cancellations', 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://api.example.com/invoices/{uuid}/cancellations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$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://api.example.com/invoices/{uuid}/cancellations"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/invoices/{uuid}/cancellations")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/invoices/{uuid}/cancellations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body[
{
"id": "<string>",
"invoiceId": "<string>",
"motivo": "01",
"requiresApproval": true,
"cancellationStatus": "pendiente",
"createdAt": "2023-11-07T05:31:56Z",
"folioSustitucion": {},
"respondBy": {},
"requestedBy": {},
"resolvedBy": {},
"resolvedAt": {}
}
]Returns the full cancellation history for an invoice — every cancellation attempt ever requested, not only the latest one. A rejected attempt doesn’t block retries, so an invoice can have multiple rows here (e.g.
The response is a plain array — not the
rechazada followed by a new pendiente or aceptada).
This is a flat route, same pattern as Cancel Invoice — no /organizations/{organizationId}/ prefix.
Authentication
Accepts either:- A Supabase Bearer session (
Authorization: Bearer <token>) — the authenticated user must be a member of the invoice’s organization. - An API key (
X-API-Key: sk_...) with theread:invoicesscope — the key’s own organization must match the invoice’s organization, or the request is rejected with403 Forbidden.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
uuid | string (UUID) | Yes | Folio fiscal UUID of the invoice |
Example Request
cURL
curl -X GET https://api.timbrix.mx/invoices/d3bfbc57-44af-4390-a064-f0afab85e5df/cancellations \
-H "Authorization: Bearer <your_token>"
TypeScript
// Not yet available in @timbrix/sdk — call the REST endpoint directly
// until SDK support for cancellations ships.
const response = await fetch(
"https://api.timbrix.mx/invoices/d3bfbc57-44af-4390-a064-f0afab85e5df/cancellations",
{ headers: { Authorization: "Bearer <your_token>" } }
)
const cancellations = await response.json()
console.log(cancellations)
Example Response
Ordered bycreatedAt, newest first — matching List Invoices’ ordering convention.
[
{
"id": "6a1b2c3d-4e5f-4890-9abc-def012345678",
"invoiceId": "0f2a1c3e-1a2b-4c3d-9e8f-1234567890ab",
"motivo": "02",
"folioSustitucion": null,
"requiresApproval": true,
"respondBy": "2026-08-12T15:50:03.412Z",
"cancellationStatus": "pendiente",
"requestedBy": "9f8e7d6c-5b4a-3210-fedc-ba9876543210",
"resolvedBy": null,
"resolvedAt": null,
"createdAt": "2026-08-09T15:50:03.412Z"
},
{
"id": "3c2b1a0f-9e8d-4567-8901-234567890abc",
"invoiceId": "0f2a1c3e-1a2b-4c3d-9e8f-1234567890ab",
"motivo": "02",
"folioSustitucion": null,
"requiresApproval": true,
"respondBy": "2026-08-05T15:50:03.412Z",
"cancellationStatus": "rechazada",
"requestedBy": "9f8e7d6c-5b4a-3210-fedc-ba9876543210",
"resolvedBy": "9f8e7d6c-5b4a-3210-fedc-ba9876543210",
"resolvedAt": "2026-08-07T09:00:00.000Z",
"createdAt": "2026-08-02T15:50:03.412Z"
}
]
{ data, total, page, ... } envelope used by List Invoices, since this history is never paginated. See Cancel Invoice for the field reference on each entry (InvoiceCancellationDto).
Common Errors
401 Unauthorized
Missing or invalid Bearer token / API key.403 Forbidden
The authenticated user is not a member of the invoice’s organization, or the API key does not have theread:invoices scope / belongs to a different organization than the one that owns the invoice.
404 Not Found
uuid does not match any invoice.Authorizations
apiKeybearer
API Key for authentication (format: sk_...)
Path Parameters
Response
Available options:
01, 02, 03, 04 Available options:
pendiente, aceptada, rechazada