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

# Cancelar caso MED

> Cancela un caso MED antes de que alcance el estado COMPLETED.



## OpenAPI

````yaml es/openapi/v3-current/spi-core.yaml post /api/v1/core/med/{caseID}/cancel
openapi: 3.1.0
info:
  contact:
    email: contact@lerian.studio
    name: Lerian Studio
    url: https://lerian.studio
  description: >-
    Servicio central de Lerian SPI: casos de disputa MED (Mecanismo Especial de
    Devolução), ciclo de vida de participantes PIX por ISPB, resolución de
    enrutamiento de pagos y orquestación de operaciones Core entre contextos
    sobre el Sistema de Pagos Instantáneos brasileño (SPI/Pix).
  license:
    name: Lerian Studio General License
  title: Lerian SPI — Core API
  version: 1.0.0
servers:
  - url: https://spi.sandbox.lerian.net
security: []
tags:
  - description: >-
      Casos de disputa MED (Mecanismo Especial de Devolução): abrir, listar,
      consultar, analizar, resolver, cerrar, cancelar y adjuntar evidencia.
    name: MED
  - description: >-
      Ciclo de vida de participantes PIX: registrar, listar, consultar,
      suspender, activar y dar de baja por ISPB.
    name: Participants
  - description: Resolución de enrutamiento de pagos entre participantes.
    name: Routing
  - description: Orquestación de operaciones Core entre los contextos delimitados del rail.
    name: Operations
paths:
  /api/v1/core/med/{caseID}/cancel:
    post:
      tags:
        - MED
      summary: Cancelar caso MED
      description: Cancela un caso MED antes de que alcance el estado COMPLETED.
      operationId: cancelMEDCase
      parameters:
        - description: Idempotency key, max 255 characters
          in: header
          name: Idempotency-Key
          schema:
            description: Idempotency key, max 255 characters
            type: string
        - description: MED case ID
          in: path
          name: caseID
          required: true
          schema:
            description: MED case ID
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MEDCaseResponse'
          description: OK
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Error
      security:
        - BearerAuth: []
components:
  schemas:
    MEDCaseResponse:
      additionalProperties: false
      properties:
        analysisDeadlineAt:
          description: >-
            UTC deadline for the initial analysis window (7 days), RFC 3339
            format.
          examples:
            - '2025-03-17T14:30:00Z'
          type: string
        caseId:
          description: Caller-assigned business identifier for the MED dispute case.
          examples:
            - MED-2025-001
          type: string
        completionDeadlineAt:
          description: UTC deadline for full case completion (10 days), RFC 3339 format.
          examples:
            - '2025-04-06T14:30:00Z'
          type: string
        createdAt:
          description: UTC timestamp when the case was created, RFC 3339 format.
          examples:
            - '2025-03-07T14:30:00Z'
          type: string
        evidenceReferences:
          description: Evidence attachments supporting the dispute.
          items:
            $ref: '#/components/schemas/EvidenceReferenceResponse'
          type:
            - array
            - 'null'
        id:
          description: Server-assigned UUID of the MED case.
          examples:
            - 550e8400-e29b-41d4-a716-446655440000
          type: string
        originalEndToEndId:
          description: >-
            PIX EndToEndID of the original disputed transaction, format
            E{ISPB}{YYYYMMDD}{uniqueID}.
          examples:
            - E1234567820250307ABCDEFGHIJKLMNO
          type: string
        reason:
          description: 'Motivation for the dispute: FRAUD, OPERATIONAL_FLAW, or CANCELLED.'
          examples:
            - FRAUD
          type: string
        refundAmount:
          description: >-
            Refund amount in centavos (BRL minor units); zero unless the case
            was resolved with a refund.
          examples:
            - 0
          format: int64
          type: integer
        resolution:
          description: >-
            Outcome once resolved: APPROVED, REJECTED, CANCELLED_BY_OPENER,
            DEADLINE_EXPIRED, or AUTO_APPROVED; empty while unresolved.
          examples:
            - ''
          type: string
        resolvedAt:
          description: >-
            UTC timestamp when the case was resolved, RFC 3339 format; empty
            while unresolved.
          examples:
            - ''
          type: string
        status:
          description: >-
            Lifecycle state: INITIATED, UNDER_ANALYSIS, AWAITING_RESPONSE,
            APPROVED, REJECTED, EXPIRED, or COMPLETED.
          examples:
            - INITIATED
          type: string
        updatedAt:
          description: UTC timestamp of the last update to the case, RFC 3339 format.
          examples:
            - '2025-03-07T14:30:00Z'
          type: string
      required:
        - id
        - caseId
        - originalEndToEndId
        - reason
        - status
        - analysisDeadlineAt
        - completionDeadlineAt
        - evidenceReferences
        - createdAt
        - updatedAt
      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
      type: object
    EvidenceReferenceResponse:
      additionalProperties: false
      properties:
        addedAt:
          description: UTC timestamp when the evidence was attached, RFC 3339 format.
          examples:
            - '2025-03-07T14:30:00Z'
          type: string
        addedBy:
          description: Authenticated actor that attached the evidence.
          examples:
            - client
          type: string
        description:
          description: Human-readable description of what the evidence shows.
          examples:
            - Screenshot of fraudulent transaction notification
          type: string
        reference:
          description: >-
            Locator for the evidence, interpreted according to Type (e.g. the
            document URL).
          examples:
            - https://example.com/evidence/doc-123
          type: string
        type:
          description: >-
            Kind of evidence attached (e.g. URL pointing to a supporting
            document).
          examples:
            - URL
          type: string
      required:
        - type
        - reference
        - description
        - addedAt
        - addedBy
      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
  securitySchemes:
    BearerAuth:
      bearerFormat: JWT
      description: JWT bearer token issued by the identity provider.
      scheme: bearer
      type: http

````