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

# Get the credit status of a MED refund order

> Returns the CREDIT-side situation of a refund order by its pacs.004 endToEndIdDevolucao, read live from JDPI (JDPI credito-devolucao/{endToEndId}, §8.5.4). stJdPiProc here is the CREDIT domain, DISTINCT from the debit poll's despite the shared field name (§4.5). Moves no money and persists nothing — the credit itself is settled by the inbound §9.3.3 webhook, never by this read.



## OpenAPI

````yaml /en/openapi/v3-current/pix.yaml get /v1/med/refunds/credits/{endToEndIdDevolucao}
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/refunds/credits/{endToEndIdDevolucao}:
    get:
      tags:
        - MED Refunds
      summary: Get the credit status of a MED refund order
      description: >-
        Returns the CREDIT-side situation of a refund order by its pacs.004
        endToEndIdDevolucao, read live from JDPI (JDPI
        credito-devolucao/{endToEndId}, §8.5.4). stJdPiProc here is the CREDIT
        domain, DISTINCT from the debit poll's despite the shared field name
        (§4.5). Moves no money and persists nothing — the credit itself is
        settled by the inbound §9.3.3 webhook, never by this read.
      operationId: getMedRefundCreditStatus
      parameters:
        - description: >-
            EndToEndId of the refund (pacs.004) whose credit status is being
            consulted.
          in: path
          name: endToEndIdDevolucao
          required: true
          schema:
            description: >-
              EndToEndId of the refund (pacs.004) whose credit status is being
              consulted.
            examples:
              - D1234567820240101000000000000099
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RefundCreditStatusView'
          description: OK
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Error
components:
  schemas:
    RefundCreditStatusView:
      additionalProperties: false
      properties:
        codigoDevolucao:
          description: >-
            Refund code (BE08=MED iniciada pelo participante do recebedor,
            FR01=fundada suspeita de fraude, MD06=solicitada pelo usuario
            recebedor, SL02=erro/desacordo no Pix Saque ou Troco).
          examples:
            - BE08
          type: string
        codigoErro:
          description: Error code, present when stJdPi is -1.
          examples:
            - AB03
          type: string
        descCodigoErro:
          description: Error-code description, present when stJdPi is -1.
          examples:
            - Liquidacao interrompida
          type: string
        dtHrSituacao:
          description: >-
            When the refund order reached this situation in JDPI (raw JDPI
            instant).
          examples:
            - '2020-01-24T10:30:00.000Z'
          type: string
        ehIntraPsp:
          description: >-
            True when the transaction is internal to this direct PSP (both legs
            on the same participant).
          examples:
            - false
          type: boolean
        endToEndIdDevolucao:
          description: EndToEndId of the refund (pacs.004) whose credit is being consulted.
          examples:
            - D1234567820240101000000000000099
          type: string
        stJdPi:
          description: >-
            Request situation: -1=erro no processamento, 0=requisicao recebida
            aguardando processamento, 9=credito efetivado com sucesso.
          examples:
            - 9
          format: int64
          type: integer
        stJdPiProc:
          description: >-
            CREDIT-side processing situation: 0=requisicao recebida aguardando
            processamento, 1=credito validado aguardando efetivacao pelo SGCT,
            2=validacao de credito enviada ao SPI, 5=sem retorno terminativo do
            SPI, 7=devolucao recusada pelo SPI, 8=devolucao recusada pelo JDPI,
            9=credito efetivado com sucesso. A DISTINCT domain from the debit
            poll's stJdPiProc despite the shared field name.
          examples:
            - 9
          format: int64
          type: integer
        valorDevolucao:
          description: >-
            Refunded amount, in centavos; omitted when JDPI did not return it
            (Obrg=Nao).
          examples:
            - 5010
          format: int64
          type: integer
      required:
        - endToEndIdDevolucao
        - dtHrSituacao
        - stJdPiProc
        - stJdPi
        - codigoDevolucao
        - ehIntraPsp
      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
    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

````