> ## 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.

# Cancel a due-date collection

> Cancels a due-date collection synchronously and changes its status to `CANCELLED`. The operation is idempotent: cancelling a collection that is already `CANCELLED` returns the same `200` response.



## OpenAPI

````yaml en/openapi/v3-current/pix-lerian-cob.yaml DELETE /collections/duedate/{id}
openapi: 3.1.0
info:
  contact:
    name: Lerian Studio
    url: https://lerian.studio
  description: Public API for Pix BR Codes and immediate and due-date collections.
  license:
    name: Elastic License 2.0
    url: https://www.elastic.co/licensing/elastic-license
  title: Pix Lerian — Collections
  version: release-candidate
servers:
  - url: https://api.example.com/cob-hub/v1
    description: >-
      Replace the example host with the URL provided during environment
      onboarding.
security:
  - BearerAuth: []
tags:
  - description: Create, retrieve, list, and decode static Pix BR Codes.
    name: BR Codes
  - description: Create, retrieve, list, and cancel immediate Pix collections.
    name: Immediate Collections
  - description: Create, retrieve, list, and cancel due-date Pix collections.
    name: Due-Date Collections
paths:
  /collections/duedate/{id}:
    delete:
      tags:
        - Due-Date Collections
      summary: Cancel a due-date collection
      description: >-
        Cancels a due-date collection synchronously and changes its status to
        `CANCELLED`. The operation is idempotent: cancelling a collection that
        is already `CANCELLED` returns the same `200` response.
      operationId: cancelDueDateCollection
      parameters:
        - description: UUID of the account associated with the operation.
          in: header
          name: X-Account-Id
          required: true
          schema:
            description: UUID of the account associated with the operation.
            examples:
              - 019606a1-3b4c-7d8e-9f01-234567890abc
            type: string
          example: 019606a1-3b4c-7d8e-9f01-234567890abc
        - description: Collection UUID
          in: path
          name: id
          required: true
          schema:
            description: Collection UUID
            examples:
              - 019e22f9-aabe-7ec9-ba6b-41608b9accf9
            type: string
          example: 01960718-a213-2435-6078-901234567123
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CancelDueDateCollectionBody'
            examples:
              fictitiousExample:
                summary: Fictitious example
                value:
                  reason: Customer requested cancellation
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DueDateCollectionOutput'
              examples:
                fictitiousExample:
                  summary: Fictitious example
                  value:
                    abatement:
                      modality: PERCENTAGE
                      value: '5.00'
                    accountId: 019606a1-3b4c-7d8e-9f01-234567890abc
                    additionalInfo:
                      - key: orderId
                        value: '12345'
                    amount: '100.50'
                    calendar:
                      dueDate: '2030-09-01'
                      validityAfterDue: 30
                    createdAt: '2030-08-20T10:30:00Z'
                    currency: BRL
                    debtor:
                      document: '39053344705'
                      name: João da Silva
                    description: Fatura de servicos
                    discount:
                      modality: VALUE_PER_CALENDAR_DAY_ADVANCE
                      value: '3.00'
                    emvPayload: >-
                      00020126360014br.gov.bcb.pix2562https://pix.example.com/qr/v2/cobv-abc1235204000053039865802BR5910Loja
                      Teste6007Goiania62070503***63041D3F
                    expiresAt: '2030-10-01T23:59:59Z'
                    externalId: 0196a7b2-4f60-7172-bd23-4567890abcde
                    fine:
                      modality: FIXED_VALUE
                      value: '10.00'
                    id: 0196a7b2-1c3d-7e4f-8a90-1234567890ab
                    interest:
                      modality: VALUE_CALENDAR_DAYS
                      value: '1.50'
                    isExpired: false
                    keyType: EVP
                    keyValue: 123e4567-e12b-12d1-a456-426655440000
                    locationUrl: https://pix.example.com/qr/v2/cobv-abc123
                    merchantCity: Goiania
                    merchantDocument: '39053344705'
                    merchantName: Loja Teste
                    organizationId: 0196a7b2-2d4e-7f50-9b01-234567890abc
                    status: CANCELLED
                    txId: TX1234567890123456789012345
                    type: DUE_DATE
                    updatedAt: '2030-08-20T10:30:00Z'
                    cancelledAt: '2030-08-21T10:40:00Z'
                    cancelledReason: Customer requested cancellation
          description: OK
        '400':
          content:
            application/problem+json:
              example:
                type: https://errors.lerian.studio/v1/PIX-0200
                title: Bad Request
                status: 400
                detail: Missing or malformed required fields.
                code: PIX-0200
              schema:
                $ref: '#/components/schemas/Detail'
          description: >-
            Malformed id/X-Account-Id, or the cancellation reason exceeds 255
            bytes (PIX-0200).
        '404':
          content:
            application/problem+json:
              example:
                type: https://errors.lerian.studio/v1/PIX-0240
                title: Not Found
                status: 404
                detail: No collection found for the given identifiers.
                code: PIX-0240
              schema:
                $ref: '#/components/schemas/Detail'
          description: >-
            No collection found for the given id, including the cross-type
            isolation guard (PIX-0240).
        '409':
          content:
            application/problem+json:
              example:
                type: https://errors.lerian.studio/v1/PIX-0226
                title: Conflict
                status: 409
                detail: The collection is in a conflicting state at the provider.
                code: PIX-0226
              schema:
                $ref: '#/components/schemas/Detail'
          description: >-
            The provider reports the collection in a conflicting state
            (PIX-0226).
        '422':
          content:
            application/problem+json:
              example:
                type: https://errors.lerian.studio/v1/PIX-0241
                title: Unprocessable Entity
                status: 422
                detail: >-
                  Collection is in a terminal state (already COMPLETED) and
                  cannot transition.
                code: PIX-0241
              schema:
                $ref: '#/components/schemas/Detail'
          description: >-
            The collection is in a terminal state incompatible with cancellation
            -- already COMPLETED -- or a concurrent-modification reconciliation
            could not converge locally (PIX-0241).
        '500':
          content:
            application/problem+json:
              example:
                type: https://errors.lerian.studio/v1/PIX-0000
                title: Internal Server Error
                status: 500
                detail: >-
                  The server encountered an unexpected error. Please try again
                  later.
                code: PIX-0000
              schema:
                $ref: '#/components/schemas/Detail'
          description: >-
            The local persistence retry (and its own reconciliation retry) both
            failed after the provider already cancelled remotely.
        '502':
          content:
            application/problem+json:
              example:
                type: https://errors.lerian.studio/v1/PIX-0223
                title: Bad Gateway
                status: 502
                detail: Provider adapter is unreachable.
                code: PIX-0223
              schema:
                $ref: '#/components/schemas/Detail'
          description: The provider adapter is unreachable (PIX-0223).
        '504':
          content:
            application/problem+json:
              example:
                type: https://errors.lerian.studio/v1/PIX-0054
                title: Gateway Timeout
                status: 504
                detail: The request timed out. Please try again later.
                code: PIX-0054
              schema:
                $ref: '#/components/schemas/Detail'
          description: The provider timed out handling the cancel request (PIX-0054).
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Error
      x-codeSamples:
        - lang: bash
          label: cURL with fictitious data
          source: |-
            curl --request DELETE \
              --url https://api.example.com/cob-hub/v1/collections/duedate/01960718-a213-2435-6078-901234567123 \
              --header 'Authorization: Bearer demo-access-token' \
              --header 'Content-Type: application/json' \
              --header 'X-Account-Id: 019606a1-3b4c-7d8e-9f01-234567890abc' \
              --data '{
              "reason": "Customer requested cancellation"
            }'
components:
  schemas:
    CancelDueDateCollectionBody:
      additionalProperties: false
      properties:
        reason:
          description: Optional cancellation reason
          examples:
            - Customer requested cancellation
          type: string
      type: object
    DueDateCollectionOutput:
      additionalProperties: false
      properties:
        abatement:
          $ref: '#/components/schemas/AbatementTermsDTO'
        accountId:
          examples:
            - 0196a7b2-3e5f-7061-ac12-34567890abcd
          type: string
        additionalInfo:
          items:
            $ref: '#/components/schemas/KVDTO'
          type:
            - array
            - 'null'
        amount:
          examples:
            - '100.50'
          type: string
        calendar:
          $ref: '#/components/schemas/DueDateCalendarDTO'
        cancelledAt:
          examples:
            - '2026-05-06T10:40:00Z'
          format: date-time
          type: string
        cancelledReason:
          examples:
            - Customer requested cancellation
          type: string
        createdAt:
          examples:
            - '2026-05-06T10:30:00Z'
          format: date-time
          type: string
        currency:
          enum:
            - BRL
          examples:
            - BRL
          type: string
        debtor:
          $ref: '#/components/schemas/DebtorDTO'
        description:
          examples:
            - Fatura de servicos
          type: string
        discount:
          $ref: '#/components/schemas/DiscountTermsDTO'
        emvPayload:
          examples:
            - >-
              00020126360014br.gov.bcb.pix2562https://pix.example.com/qr/v2/cobv-abc1235204000053039865802BR5910Loja
              Teste6007Goiania62070503***63041D3F
          type: string
        expiresAt:
          examples:
            - '2026-05-06T11:30:00Z'
          format: date-time
          type: string
        externalId:
          examples:
            - 0196a7b2-4f60-7172-bd23-4567890abcde
          type: string
        fine:
          $ref: '#/components/schemas/FineTermsDTO'
        id:
          examples:
            - 0196a7b2-1c3d-7e4f-8a90-1234567890ab
          type: string
        interest:
          $ref: '#/components/schemas/InterestTermsDTO'
        isExpired:
          examples:
            - false
          type: boolean
        keyType:
          enum:
            - CPF
            - CNPJ
            - PHONE
            - EMAIL
            - EVP
          examples:
            - EVP
          type: string
        keyValue:
          examples:
            - 123e4567-e12b-12d1-a456-426655440000
          type: string
        locationUrl:
          examples:
            - https://pix.example.com/qr/v2/cobv-abc123
          type: string
        merchantCity:
          examples:
            - Goiania
          type: string
        merchantDocument:
          examples:
            - '39053344705'
          type: string
        merchantName:
          examples:
            - Loja Teste
          type: string
        organizationId:
          examples:
            - 0196a7b2-2d4e-7f50-9b01-234567890abc
          type: string
        payment:
          $ref: '#/components/schemas/PaymentDTO'
        status:
          enum:
            - ACTIVE
            - COMPLETED
            - CANCELLED
          examples:
            - ACTIVE
          type: string
        txId:
          examples:
            - TX1234567890123456789012345
          type: string
        type:
          enum:
            - IMMEDIATE
            - DUE_DATE
          examples:
            - DUE_DATE
          type: string
        updatedAt:
          examples:
            - '2026-05-06T10:30:00Z'
          format: date-time
          type: string
      required:
        - id
        - organizationId
        - accountId
        - merchantDocument
        - type
        - status
        - txId
        - keyType
        - keyValue
        - merchantName
        - merchantCity
        - amount
        - currency
        - calendar
        - externalId
        - locationUrl
        - emvPayload
        - expiresAt
        - createdAt
        - updatedAt
        - isExpired
      type: object
    Detail:
      additionalProperties: false
      properties:
        code:
          description: >-
            Stable, machine-readable domain error code scoped to the emitting
            service (format: <SERVICE>-NNNN).
          examples:
            - ERR-0001
          type: string
        detail:
          description: >-
            A human-readable explanation specific to this occurrence of the
            problem.
          examples:
            - Property foo is required but is missing.
          type: string
        errors:
          description: Optional list of individual error details
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type:
            - array
            - 'null'
        instance:
          description: >-
            A URI reference that identifies the specific occurrence of the
            problem.
          examples:
            - https://example.com/error-log/abc123
          format: uri
          type: string
        status:
          description: HTTP status code
          examples:
            - 400
          format: int64
          type: integer
        title:
          description: >-
            A short, human-readable summary of the problem type. This value
            should not change between occurrences of the error.
          examples:
            - Bad Request
          type: string
        type:
          default: about:blank
          description: A URI reference to human-readable documentation for the error.
          examples:
            - https://example.com/errors/example
          format: uri
          type: string
        upstream:
          $ref: '#/components/schemas/Upstream'
          description: >-
            RFC 9457 extension member: the error a proxied third-party provider
            reported. Absent unless the emitting service explicitly surfaced
            one.
      type: object
    AbatementTermsDTO:
      additionalProperties: false
      properties:
        modality:
          examples:
            - PERCENTAGE
          type: string
        value:
          examples:
            - '5.00'
          type: string
      required:
        - modality
        - value
      type: object
    KVDTO:
      additionalProperties: false
      properties:
        key:
          examples:
            - orderId
          type: string
        value:
          examples:
            - '12345'
          type: string
      required:
        - key
        - value
      type: object
    DueDateCalendarDTO:
      additionalProperties: false
      properties:
        dueDate:
          examples:
            - '2026-09-01'
          format: date
          type: string
        validityAfterDue:
          examples:
            - 30
          format: int64
          type: integer
      required:
        - dueDate
        - validityAfterDue
      type: object
    DebtorDTO:
      additionalProperties: false
      properties:
        document:
          examples:
            - '39053344705'
          type: string
        name:
          examples:
            - João da Silva
          type: string
      type: object
    DiscountTermsDTO:
      additionalProperties: false
      properties:
        fixedDates:
          items:
            $ref: '#/components/schemas/DiscountFixedDateDTO'
          type:
            - array
            - 'null'
        modality:
          examples:
            - FIXED_VALUE_UNTIL_DATES
          type: string
        value:
          type: string
      required:
        - modality
        - value
      type: object
    FineTermsDTO:
      additionalProperties: false
      properties:
        modality:
          examples:
            - FIXED_VALUE
          type: string
        value:
          examples:
            - '10.00'
          type: string
      required:
        - modality
        - value
      type: object
    InterestTermsDTO:
      additionalProperties: false
      properties:
        modality:
          examples:
            - VALUE_CALENDAR_DAYS
          type: string
        value:
          examples:
            - '1.50'
          type: string
      required:
        - modality
        - value
      type: object
    PaymentDTO:
      additionalProperties: false
      properties:
        amount:
          examples:
            - '100.50'
          type: string
        endToEndId:
          examples:
            - E12345678202605061030abcdef12345
          type: string
        paidAt:
          examples:
            - '2026-05-06T10:35:00Z'
          format: date-time
          type: string
        payer:
          $ref: '#/components/schemas/PayerDTO'
      required:
        - endToEndId
        - amount
        - paidAt
      type: object
    ErrorDetail:
      additionalProperties: false
      properties:
        location:
          description: >-
            Where the error occurred, e.g. 'body.items[3].tags' or
            'path.thing-id'
          type: string
        message:
          description: Error message text
          type: string
        value:
          description: The value at the given location
      type: object
    Upstream:
      additionalProperties: false
      properties:
        code:
          description: The upstream provider's own error code, verbatim.
          examples:
            - E4001
          type: string
        message:
          description: >-
            The upstream provider's own error message, verbatim (bounded, never
            its raw response body).
          examples:
            - account not found at provider
          type: string
      type: object
    DiscountFixedDateDTO:
      additionalProperties: false
      properties:
        date:
          examples:
            - '2026-08-25'
          format: date
          type: string
        value:
          examples:
            - '3.00'
          type: string
      required:
        - date
        - value
      type: object
    PayerDTO:
      additionalProperties: false
      properties:
        ispb:
          examples:
            - '12345678'
          type: string
        name:
          examples:
            - João da Silva
          type: string
        taxId:
          examples:
            - '39053344705'
          type: string
      type: object
  securitySchemes:
    BearerAuth:
      bearerFormat: JWT
      description: JWT bearer token issued by the identity provider.
      scheme: bearer
      type: http

````