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

# Delete an Immediate Charge

> Use this endpoint to delete (cancel) an immediate collection.

**Notes:**
- This operation cancels the collection and changes its status
- Collections with status COMPLETED cannot be deleted
- The deletion reason is required



## OpenAPI

````yaml /pt/openapi/v3-current/indirect-pix.yaml delete /v1/collections/immediate/{collection_id}
openapi: 3.1.0
info:
  contact:
    email: contact@lerian.studio
    name: Lerian Studio
    url: https://lerian.studio
  description: >-
    API for Pix Indirect via BTG. It covers DICT keys and claims; MED infraction
    reports, fraud markers, refund requests, and funds recoveries; DICT
    statistics and reconciliation; Pix transfers, refunds, and schedules; static
    QR codes and QR code decoding; immediate and due-date collections; Pix
    Automático for the payer; transaction reports and TemposTransacoes
    statistics; and inbound and outbound webhook records.
  license:
    name: Lerian Studio General License
  title: Pix BTG API
  version: 1.14.0
servers:
  - url: https://api.example.com
    description: >-
      Replace the example host with the URL provided during environment
      onboarding.
security:
  - BearerAuth: []
paths:
  /v1/collections/immediate/{collection_id}:
    delete:
      tags:
        - Immediate Collections
      summary: Delete an Immediate Charge
      description: |-
        Use this endpoint to delete (cancel) an immediate collection.

        **Notes:**
        - This operation cancels the collection and changes its status
        - Collections with status COMPLETED cannot be deleted
        - The deletion reason is required
      operationId: collection-delete-immediate
      parameters:
        - description: Identifier of the immediate collection
          in: path
          name: collection_id
          required: true
          schema:
            description: Identifier of the immediate collection
            type: string
        - description: Account ID (UUID format)
          in: header
          name: X-Account-Id
          required: true
          schema:
            description: Account ID (UUID format)
            format: uuid
            type: string
        - description: 'Reason for deletion. Valid values: DELETED_BY_USER, DELETED_BY_PSP'
          in: header
          name: X-Reason
          required: true
          schema:
            description: 'Reason for deletion. Valid values: DELETED_BY_USER, DELETED_BY_PSP'
            enum:
              - DELETED_BY_USER
              - DELETED_BY_PSP
            type: string
      responses:
        '204':
          description: No Content
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LegacyErrorBody'
          description: Bad Request
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LegacyErrorBody'
          description: Internal Server Error
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LegacyErrorBody'
          description: Error
components:
  schemas:
    LegacyErrorBody:
      additionalProperties: false
      properties:
        code:
          type: string
        fields:
          additionalProperties:
            type: string
          type: object
        headers:
          additionalProperties:
            type: string
          type: object
        message:
          type: string
        paths:
          additionalProperties:
            type: string
          type: object
        queryParams:
          additionalProperties:
            type: string
          type: object
        raw:
          type: string
        title:
          type: string
      required:
        - code
        - title
        - message
      type: object
  securitySchemes:
    BearerAuth:
      bearerFormat: JWT
      description: JWT bearer token issued by the identity provider.
      scheme: bearer
      type: http

````

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