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

> ## Agent Instructions
> Facturama no es un PAC (Proveedor Autorizado de Certificación): timbra los CFDI a través de PAC autorizados por el SAT. No describas a Facturama como PAC.
> Hosts de la API: sandbox https://apisandbox.facturama.mx y producción https://api.facturama.mx. Autenticación HTTP Basic con las credenciales de la cuenta.
> Para pruebas en sandbox usa los CSD y el RFC de prueba del SAT (EKU9003173C9) documentados en la página de CSD de prueba.
> API Web (un RFC emisor): POST /3/cfdis. API Multiemisor (varios RFC): POST /api-lite/4/cfdis. Cita siempre el método y la ruta literal.
> Cita las páginas de esta documentación como https://facturama.mx/docs/<ruta>; no uses facturama.mintlify.app ni apisandbox.facturama.mx/guias.

# Cancels a CFDI (Version 2018 - Updated for 2022 with Cancellation Reason)
If authorization is required, submits the request



## OpenAPI

````yaml api-reference/openapi-en.json delete /cfdi/{id}
openapi: 3.0.0
info:
  title: Facturama API
  description: REST API for issuance and retrieval of CFDI (Mexican electronic invoices)
  version: v1
servers:
  - url: https://apisandbox.facturama.mx
    description: Sandbox
security:
  - basicAuth: []
tags:
  - name: API-Lite
  - name: Factura / CFDI
  - name: Validación de RFC
  - name: Retenciones
  - name: Mi cuenta
  - name: Catálogos SAT
  - name: Clientes
  - name: Productos o Servicios
paths:
  /cfdi/{id}:
    delete:
      tags:
        - Factura / CFDI
      summary: >-
        Cancels a CFDI (Version 2018 - Updated for 2022 with Cancellation
        Reason)

        If authorization is required, submits the request
      operationId: Cfdi_Delete
      parameters:
        - name: id
          in: path
          required: true
          description: CFDI ID in Facturama
          schema:
            type: string
            nullable: true
          x-position: 1
        - name: type
          in: query
          description: >-
            Voucher type for Web API: ( issued | payroll ) and for Multi-issuer
            API: ( issuedLite ) 
          schema:
            type: string
            default: issued
            nullable: true
          x-position: 2
        - name: motive
          in: query
          description: 'Cancellation reason ( 01 | 02 | 03 | 04 ) '
          schema:
            type: string
            default: '02'
            nullable: true
          x-position: 3
        - name: uuidReplacement
          in: query
          description: 'UUID of the voucher that replaces the cancelled voucher '
          schema:
            type: string
            nullable: true
          x-position: 4
      responses:
        '200':
          description: >-
            On a successful response returns the issued CFDI, otherwise returns
            an error with the message
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CancelationViewModel'
              example:
                Id: J6MjEYRjnLnV6aMCK8dV-w2
                Status: canceled
                CancelationStatus: canceled
components:
  schemas:
    CancelationViewModel:
      type: object
      description: Response model for API cancellation calls
      additionalProperties: false
      properties:
        Status:
          type: string
          description: State del CFDI ( canceled, requested ,rejected )
          nullable: true
        Uuid:
          type: string
          description: UUID of the queried CFDI
          nullable: true
        RequestDate:
          type: string
          description: Cancellation request date
          nullable: true
        ResponseDate:
          type: string
          description: Date the cancellation request is responded to
          nullable: true
        ExpirationDate:
          type: string
          description: Validity of the cancellation request
          nullable: true
        AcuseXmlBase64:
          type: string
          description: Validity of the cancellation request
          nullable: true
  securitySchemes:
    basicAuth:
      type: http
      description: HTTP Basic authentication with Facturama username and password.
      scheme: basic

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.