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

# Create a MED value recovery

> Opens a value recovery as the creator PSP (JDPI recuperacao-valores/incluir, contract 2.20). The creator ISPB is derived from configuration. grafoRastreamento.vlrMinTransacao is a graph-traversal FILTER threshold, never a posting amount.



## OpenAPI

````yaml /en/openapi/v3-current/pix.yaml post /v1/med/recoveries
openapi: 3.1.0
info:
  description: Brazilian PIX Direct (DICT + SPI) plugin API.
  title: plugin-br-pix-jd
  version: 1.0.0
servers: []
security:
  - BearerAuth: []
paths:
  /v1/med/recoveries:
    post:
      tags:
        - MED Recoveries
      summary: Create a MED value recovery
      description: >-
        Opens a value recovery as the creator PSP (JDPI
        recuperacao-valores/incluir, contract 2.20). The creator ISPB is derived
        from configuration. grafoRastreamento.vlrMinTransacao is a
        graph-traversal FILTER threshold, never a posting amount.
      operationId: createMedRecovery
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateRecoveryRequestBody'
        required: true
      responses:
        '202':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RecoveryView'
          description: Accepted
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Unprocessable Entity
        '500':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Internal Server Error
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Error
components:
  schemas:
    CreateRecoveryRequestBody:
      additionalProperties: false
      properties:
        contatoEmail:
          description: Creator-contact email (required).
          examples:
            - ops@example.com
          type: string
        contatoTelefone:
          description: Creator-contact phone (required).
          examples:
            - '+5511999999999'
          type: string
        detalhes:
          description: Free-text detail; required when tpSituacao=4 (Outros).
          examples:
            - Suspected scam.
          type: string
        grafoRastreamento:
          $ref: '#/components/schemas/GrafoRastreamentoBody'
          description: >-
            Optional graph-traversal FILTER parameters; omit to use JDPI
            defaults.
        idTransacaoRaiz:
          description: EndToEndId of the root transaction being recovered.
          examples:
            - E1234567820240101000000000000001
          type: string
        idempotencyKey:
          description: >-
            Client-supplied idempotency key: any stable business string. The
            plugin projects it deterministically into the GUID form JDPI
            requires (contract 6), so the same value always dedups against the
            same JDPI request and the raw value is never sent verbatim.
          examples:
            - med-recovery-2024-0001
          type: string
        tpSituacao:
          description: >-
            Situation code (0=Golpe, 1=Nao autorizada, 2=Coercao, 3=Acesso
            fraudulento, 4=Outros, 5=Desconhecida).
          examples:
            - 0
          format: int64
          type: integer
      required:
        - idTransacaoRaiz
        - tpSituacao
        - contatoEmail
        - contatoTelefone
        - idempotencyKey
      type: object
    RecoveryView:
      additionalProperties: false
      properties:
        breached:
          description: >-
            True when the devolver deadline has been reached or passed (computed
            at read time); false when no deadline is set.
          examples:
            - false
          type: boolean
        contatoEmail:
          description: Creator-contact email.
          examples:
            - ops@example.com
          type: string
        contatoTelefone:
          description: Creator-contact phone.
          examples:
            - '+5511999999999'
          type: string
        detalhes:
          description: Free-text detail (required when tpSituacao=4 Outros).
          examples:
            - Suspected scam.
          type: string
        devolverDeadline:
          description: >-
            Creator-side 72h devolver deadline (RFC 3339 UTC; contract
            §2.22/§5), from the Analise stage close; null unless this
            institution is the pspCriador on an Analisada recovery.
          examples:
            - '2024-01-04T12:00:00.000Z'
          type: string
        dictCorrelationId:
          description: >-
            idCorrelacao — the DICT support identifier for this consultar call;
            quote it to JD when disputing whether the read happened.
          examples:
            - a9f13566e19f5ca51329479a5bae60c5
          type: string
        dictReturnedAt:
          description: dtHrRetornoDict — when DICT answered this consultar (contract 2.21).
          examples:
            - '2025-08-27T10:30:05.025Z'
          type: string
        dtHrCriacao:
          description: JDPI creation timestamp (RFC 3339 UTC).
          examples:
            - '2024-01-01T12:00:00.000Z'
          type: string
        dtHrUltModificacao:
          description: JDPI last-modification timestamp (RFC 3339 UTC) — the watermark.
          examples:
            - '2024-01-01T12:05:00.000Z'
          type: string
        idRecValores:
          description: Value-recovery GUID (the natural key).
          examples:
            - b2c3d4e5-f6a7-8901-bcde-f23456789012
          type: string
        idTransacaoRaiz:
          description: EndToEndId of the root transaction being recovered.
          examples:
            - E1234567820240101000000000000001
          type: string
        pspCriador:
          description: ISPB of the recovery creator.
          examples:
            - '12345678'
          type: string
        status:
          description: stRecValores lifecycle code (0=Criada .. 6=Cancelada).
          examples:
            - 0
          format: int64
          type: integer
        statusDescription:
          description: Human-readable stRecValores label.
          examples:
            - Criada
          type: string
        tpSituacao:
          description: Situation code (0..5).
          examples:
            - 0
          format: int64
          type: integer
        tpSituacaoDescription:
          description: Human-readable tpSituacao label.
          examples:
            - Golpe/Estelionato
          type: string
      required:
        - idRecValores
        - idTransacaoRaiz
        - tpSituacao
        - tpSituacaoDescription
        - contatoEmail
        - contatoTelefone
        - pspCriador
        - status
        - statusDescription
        - dtHrCriacao
        - dtHrUltModificacao
        - breached
      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
    GrafoRastreamentoBody:
      additionalProperties: false
      properties:
        janelaTempo:
          description: Traversal time-window (ISO-8601 duration, max PT2H).
          examples:
            - PT2H
          type: string
        maxProfundidade:
          description: Traversal max depth (max 10).
          examples:
            - 2
          format: int64
          type: integer
        maxTransacoes:
          description: Max transactions to trace (max 5).
          examples:
            - 5
          format: int64
          type: integer
        vlrMinTransacao:
          description: >-
            Traversal floor (trace only downstream txns >= this), in centavos. A
            FILTER threshold, never a posting amount.
          examples:
            - 20000
          format: int64
          type: integer
      required:
        - vlrMinTransacao
        - maxTransacoes
        - janelaTempo
        - maxProfundidade
      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
  securitySchemes:
    BearerAuth:
      bearerFormat: JWT
      description: JWT bearer token issued by the identity provider.
      scheme: bearer
      type: http

````