> ## Documentation Index
> Fetch the complete documentation index at: https://docs.timbrix.mx/llms.txt
> Use this file to discover all available pages before exploring further.

# List Invoice Cancellations

> Returns every cancellation attempt ever requested for this invoice, newest first — not only the latest one.

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. `rechazada` followed by a new `pendiente` or `aceptada`).

This is a **flat** route, same pattern as [Cancel Invoice](/api-reference/invoices/cancel) — 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 the `read:invoices` scope — the key's own organization must match the invoice's organization, or the request is rejected with `403 Forbidden`.

## Path Parameters

| Parameter | Type          | Required | Description                      |
| --------- | ------------- | -------- | -------------------------------- |
| `uuid`    | string (UUID) | Yes      | Folio fiscal UUID of the invoice |

## Example Request

```bash cURL theme={null}
curl -X GET https://api.timbrix.mx/invoices/d3bfbc57-44af-4390-a064-f0afab85e5df/cancellations \
  -H "Authorization: Bearer <your_token>"
```

```typescript TypeScript theme={null}
// 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 by `createdAt`, newest first — matching [List Invoices](/api-reference/invoices/list)' ordering convention.

```json theme={null}
[
  {
    "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"
  }
]
```

The response is a plain array — not the `{ data, total, page, ... }` envelope used by [List Invoices](/api-reference/invoices/list), since this history is never paginated. See [Cancel Invoice](/api-reference/invoices/cancel#example-response) 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 the `read:invoices` scope / belongs to a different organization than the one that owns the invoice.

### 404 Not Found

`uuid` does not match any invoice.


## OpenAPI

````yaml GET /invoices/{uuid}/cancellations
openapi: 3.1.0
info:
  title: Timbrix API
  description: >-
    REST API with OAuth2 server for managing organizations, members, and
    webhooks
  version: '1.0'
  contact: {}
servers:
  - url: https://api.timbrix.mx
    description: Production
security: []
tags:
  - name: organizations
    description: Organization management endpoints
  - name: oauth
    description: OAuth2 authentication and authorization
  - name: webhooks
    description: Webhook configuration and delivery
  - name: users
    description: User information endpoints
  - name: api-keys
    description: API Keys management and validation
  - name: invoices
    description: CFDI 4.0 invoice creation, listing, and cancellation
paths:
  /invoices/{uuid}/cancellations:
    get:
      tags:
        - invoices
      summary: List the cancellation history for an invoice
      description: >-
        Returns every cancellation attempt ever requested for this invoice,
        newest first — not only the latest one.
      operationId: InvoicesController_cancellations
      parameters:
        - name: uuid
          required: true
          in: path
          description: Folio fiscal UUID of the invoice
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/InvoiceCancellationDto'
        '403':
          description: Caller does not belong to the invoice's organization
        '404':
          description: uuid does not match any invoice
      security:
        - apiKey: []
        - bearer: []
components:
  schemas:
    InvoiceCancellationDto:
      type: object
      properties:
        id:
          type: string
          example: 6a1b2c3d-4e5f-4890-9abc-def012345678
        invoiceId:
          type: string
          description: Timbrix invoice record ID
          example: 0f2a1c3e-1a2b-4c3d-9e8f-1234567890ab
        motivo:
          type: string
          enum:
            - '01'
            - '02'
            - '03'
            - '04'
          example: '02'
        folioSustitucion:
          type: string
          nullable: true
          example: null
        requiresApproval:
          type: boolean
          example: false
        respondBy:
          type: string
          format: date-time
          nullable: true
          example: null
        cancellationStatus:
          type: string
          enum:
            - pendiente
            - aceptada
            - rechazada
          example: aceptada
        requestedBy:
          type: string
          nullable: true
          example: 9f8e7d6c-5b4a-3210-fedc-ba9876543210
        resolvedBy:
          type: string
          nullable: true
          example: null
        resolvedAt:
          type: string
          format: date-time
          nullable: true
          example: null
        createdAt:
          type: string
          format: date-time
          example: '2026-08-09T15:50:03.412Z'
      required:
        - id
        - invoiceId
        - motivo
        - requiresApproval
        - cancellationStatus
        - createdAt
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-API-Key
      description: 'API Key for authentication (format: sk_...)'
    bearer:
      scheme: bearer
      bearerFormat: JWT
      type: http

````