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

# Start a MED value recovery refund stage

> Starts the refund stage of a value recovery. It MOVES NO MONEY — it transitions stRecValores->4 and makes DICT emit refund requests. An unknown id returns a coded 404.



## OpenAPI

````yaml en/openapi/v3-current/pix.yaml POST /v1/med/recoveries/{idRecValores}/devolver
openapi: 3.0.3
info:
  title: Plugin BR Pix Direct - Complete API
  description: |
    Complete API for Brazilian Pix instant payment system including
    Pix key dictionary operations, QR code generation/decoding, transactions and
    transaction limits.
  version: 1.0.0
servers:
  - url: https://plugin-pix-direct.api.lerian.net
  - url: https://plugin-pix-direct-qrcode.api.lerian.net
security:
  - bearerAuth: []
paths:
  /v1/med/recoveries/{idRecValores}/devolver:
    post:
      tags:
        - MED API
      summary: Start a MED value recovery refund stage
      description: >-
        Starts the refund stage of a value recovery. It MOVES NO MONEY — it
        transitions stRecValores->4 and makes DICT emit refund requests. An
        unknown id returns a coded 404.
      parameters:
        - description: The value-recovery GUID.
          in: path
          name: idRecValores
          required: true
          schema:
            description: The value-recovery GUID.
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DevolverRecoveryRequestBody'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RecoveryView'
          description: OK
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Error
components:
  schemas:
    DevolverRecoveryRequestBody:
      additionalProperties: false
      properties:
        idempotencyKey:
          description: Business-derived idempotency key (Chave-Idempotencia).
          type: string
      required:
        - 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.
          type: boolean
        contatoEmail:
          description: Creator-contact email.
          type: string
        contatoTelefone:
          description: Creator-contact phone.
          type: string
        detalhes:
          description: Free-text detail (required when tpSituacao=4 Outros).
          type: string
        devolverDeadline:
          description: >-
            Creator-side 72h devolver deadline, from the Analise stage close;
            null unless this institution is the pspCriador on an Analisada
            recovery.
          type: string
        dtHrCriacao:
          description: Upstream creation timestamp (RFC 3339 UTC).
          type: string
        dtHrUltModificacao:
          description: Upstream last-modification timestamp (RFC 3339 UTC) — the watermark.
          type: string
        idRecValores:
          description: Value-recovery GUID (the natural key).
          type: string
        idTransacaoRaiz:
          description: EndToEndId of the root transaction being recovered.
          type: string
        pspCriador:
          description: ISPB of the recovery creator.
          type: string
        status:
          description: stRecValores lifecycle code (0=Criada.. 6=Cancelada).
          format: int64
          type: integer
        statusDescription:
          description: Human-readable stRecValores label.
          type: string
        tpSituacao:
          description: Situation code (0..5).
          format: int64
          type: integer
        tpSituacaoDescription:
          description: Human-readable tpSituacao label.
          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).
          type: string
        detail:
          description: >-
            A human-readable explanation specific to this occurrence of the
            problem.
          type: string
        errors:
          description: Optional list of individual error details
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type: array
          nullable: true
        instance:
          description: >-
            A URI reference that identifies the specific occurrence of the
            problem.
          format: uri
          type: string
        status:
          description: HTTP status code
          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.
          type: string
        type:
          default: about:blank
          description: A URI reference to human-readable documentation for the error.
          format: uri
          type: string
      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:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >
        JWT Bearer token authentication. Obtain token from
        `/v1/login/oauth/access_token` endpoint

        using client credentials (clientId and clientSecret).


        Include token in Authorization header:

        `Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...`


        Token expires after 3600 seconds (1 hour).

````