> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cakto.com.br/llms.txt
> Use this file to discover all available pages before exploring further.

# Consultar Reembolso

> Estado de um reembolso: pedido pelo comprador, em efetivação ou devolvido.

#### Escopo

```bash theme={null}
    read orders
```

## Visão geral

Consulta um reembolso pelo **id do pedido**, o mesmo que chega em `data.id` no webhook
`refund_requested`.

Enquanto `status` for `refund_requested`, `autoApproveAt` é o prazo: até ele o comprador pode
desistir, e depois dele o reembolso é efetivado sem depender de ninguém. Os estados estão em
[Listar Reembolsos](/api-reference/refunds/list.md#estados).

> [!NOTE]
>
> Pedido de outra conta, ou pedido sem reembolso pedido nem feito, responde `404`.

***

## Exemplo

```python Python theme={null}
import requests

resposta = requests.get(
    "https://api.cakto.com.br/public_api/refunds/5f2a1c3e-8b7d-4e21-9f10-3c6d7a2b9e41/",
    headers={"Authorization": "Bearer eyJhbGciOiJIUzI1NiIsIn..."},
    timeout=30,
)
resposta.raise_for_status()
reembolso = resposta.json()

if reembolso["status"] == "refund_requested":
    print(f"Janela aberta até {reembolso['autoApproveAt']}")
```

```javascript Node.js theme={null}
const resposta = await fetch(
  "https://api.cakto.com.br/public_api/refunds/5f2a1c3e-8b7d-4e21-9f10-3c6d7a2b9e41/",
  { headers: { Authorization: "Bearer eyJhbGciOiJIUzI1NiIsIn..." } },
);

if (!resposta.ok) throw new Error(`Cakto API error ${resposta.status}`);

const reembolso = await resposta.json();
console.log(reembolso.status, reembolso.autoApproveAt);
```


## OpenAPI

````yaml GET /public_api/refunds/{id}/
openapi: 3.0.3
info:
  title: Cakto API
  version: 1.0.0
  description: Documentação da API pública do Cakto.
servers:
  - url: https://api.cakto.com.br
    description: Cakto API
security: []
paths:
  /public_api/refunds/{id}/:
    get:
      tags:
        - refunds
      description: Consulta um reembolso pelo id do pedido.
      operationId: refunds_retrieve
      parameters:
        - in: path
          name: id
          schema:
            type: string
          description: Id do pedido reembolsado ou com reembolso solicitado.
          required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Refund'
              examples:
                Solicitado:
                  value:
                    id: 5f2a1c3e-8b7d-4e21-9f10-3c6d7a2b9e41
                    refId: Q7W2k9P
                    status: refund_requested
                    amount: '197.00'
                    currency: BRL
                    paymentMethod: pix
                    offerType: main
                    parentOrderId: null
                    reason: Comprei por engano
                    refundedBy: customer
                    paidAt: '2026-09-26T10:14:03.201544-03:00'
                    requestedAt: '2026-09-28T09:41:22.873610-03:00'
                    autoApproveAt: '2026-09-29T09:41:22.873610-03:00'
                    settlementStartedAt: null
                    refundedAt: null
                    customer:
                      id: 183921
                      name: Maria Souza
                      email: maria.souza@example.com
                      birthDate: null
                      phone: '11999999999'
                      docType: cpf
                      docNumber: '12345678909'
                    product:
                      id: ff3fdf61-e88f-43b5-982a-32d50f112414
                      short_id: AckhQ75
                      name: Curso de Exemplo
                    offer:
                      id: B8BcHrY
                      name: Oferta principal
                Reembolsado:
                  value:
                    id: 0c9d4e7a-1b2f-4a6e-8d35-7f1e2a9c4b60
                    refId: L3mX8tR
                    status: refunded
                    amount: '197.00'
                    currency: BRL
                    paymentMethod: pix
                    offerType: main
                    parentOrderId: null
                    reason: Comprei por engano
                    refundedBy: producer
                    paidAt: '2026-09-26T10:14:03.201544-03:00'
                    requestedAt: '2026-09-28T09:41:22.873610-03:00'
                    autoApproveAt: '2026-09-29T09:41:22.873610-03:00'
                    settlementStartedAt: '2026-09-28T11:02:40.118302-03:00'
                    refundedAt: '2026-09-28T11:03:15.664021-03:00'
                    customer:
                      id: 183921
                      name: Maria Souza
                      email: maria.souza@example.com
                      birthDate: null
                      phone: '11999999999'
                      docType: cpf
                      docNumber: '12345678909'
                    product:
                      id: ff3fdf61-e88f-43b5-982a-32d50f112414
                      short_id: AckhQ75
                      name: Curso de Exemplo
                    offer:
                      id: B8BcHrY
                      name: Oferta principal
          description: >-
            Com `status: "refund_requested"`, `autoApproveAt` é o prazo: até ele
            o comprador pode desistir; depois dele o reembolso é efetivado sem
            depender de ninguém.
        '401':
          description: Request não autenticado devido à ausência ou invalidez do token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthenticatedError'
              examples:
                Token ausente ou inválido:
                  $ref: '#/components/examples/UnauthenticatedErrorExample'
        '404':
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
              examples:
                NaoEncontrado:
                  value:
                    detail: Não encontrado.
          description: >-
            Também é a resposta para pedido de outra conta: 403 confirmaria que
            o id existe.
      security:
        - OAuth Token: []
components:
  schemas:
    Refund:
      type: object
      properties:
        id:
          type: string
          readOnly: true
          description: >-
            Id do pedido. É também o id do reembolso: é por ele que se consulta
            e aprova.
        refId:
          type: string
          readOnly: true
          description: Id curto do pedido, o mesmo que aparece no painel.
        status:
          allOf:
            - $ref: '#/components/schemas/RefundStatusEnum'
          readOnly: true
          description: >-
            `refund_requested`: o comprador pediu e a janela está aberta; se
            ninguém agir, o reembolso é efetivado em `autoApproveAt`.
            `in_settlement`: aprovado, aguardando a adquirente confirmar a
            devolução. `acquirer_error`: a adquirente recusou o estorno.
            `refunded`: devolvido.


            * `refund_requested` - refund_requested

            * `in_settlement` - in_settlement

            * `acquirer_error` - acquirer_error

            * `refunded` - refunded
        amount:
          type: string
          format: decimal
          example: '2.49'
          readOnly: true
          description: Valor deste pedido, como string decimal.
        currency:
          type: string
          readOnly: true
          description: Moeda do pedido.
        paymentMethod:
          type: string
          readOnly: true
          description: Método de pagamento do pedido.
        offerType:
          type: string
          readOnly: true
          description: '`main`, `orderbump`, `upsell` ou `downsell`.'
        parentOrderId:
          type: string
          readOnly: true
          nullable: true
          description: >-
            Id do pedido principal da mesma compra, quando este é order bump ou
            upsell.
        reason:
          type: string
          readOnly: true
          nullable: true
          description: Motivo informado pelo comprador ao pedir o reembolso.
        refundedBy:
          type: string
          readOnly: true
          nullable: true
          description: >-
            Quem acionou o reembolso: `customer` (pedido pelo comprador),
            `producer` (aprovado ou feito pelo produtor) ou `admin` (suporte da
            Cakto).
        paidAt:
          type: string
          format: date-time
          readOnly: true
          nullable: true
          description: Quando o pedido foi pago.
        requestedAt:
          type: string
          format: date-time
          readOnly: true
          nullable: true
          description: >-
            Quando o comprador pediu o reembolso. `null` em reembolso feito sem
            solicitação.
        autoApproveAt:
          type: string
          format: date-time
          readOnly: true
          nullable: true
          description: >-
            Fim da janela da solicitação: se o comprador não cancelar e ninguém
            aprovar antes, o reembolso é efetivado automaticamente neste
            instante. `null` fora da janela.
        settlementStartedAt:
          type: string
          format: date-time
          readOnly: true
          nullable: true
          description: Quando o estorno foi enviado à adquirente.
        refundedAt:
          type: string
          format: date-time
          readOnly: true
          nullable: true
          description: >-
            Quando a adquirente confirmou a devolução. `null` enquanto não
            confirmou.
        customer:
          allOf:
            - $ref: '#/components/schemas/CustomerOrder'
          readOnly: true
          description: 'Comprador: nome e contato para falar com ele dentro da janela.'
        product:
          allOf:
            - $ref: '#/components/schemas/RefundProduct'
          readOnly: true
        offer:
          allOf:
            - $ref: '#/components/schemas/RefundOffer'
          readOnly: true
          nullable: true
      required:
        - amount
        - autoApproveAt
        - currency
        - customer
        - id
        - offer
        - offerType
        - paidAt
        - parentOrderId
        - paymentMethod
        - product
        - reason
        - refId
        - refundedAt
        - refundedBy
        - requestedAt
        - settlementStartedAt
        - status
    UnauthenticatedError:
      type: object
      properties:
        detail:
          type: string
    RefundStatusEnum:
      enum:
        - refund_requested
        - in_settlement
        - acquirer_error
        - refunded
      type: string
      description: |-
        * `refund_requested` - refund_requested
        * `in_settlement` - in_settlement
        * `acquirer_error` - acquirer_error
        * `refunded` - refunded
    CustomerOrder:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          title: Nome
          description: Nome completo do cliente
          maxLength: 255
        email:
          type: string
          format: email
          description: Endereço de email do cliente
          maxLength: 254
        birthDate:
          type: string
          format: date
          nullable: true
          title: Nascimento
          description: Data de nascimento do cliente
        phone:
          type: string
          title: Telefone
          description: Número de telefone do cliente
          maxLength: 255
        docType:
          nullable: true
          title: Tipo de Documento
          description: |-
            Tipo do documento (ex: cpf, cnpj)

            * `cpf` - CPF
            * `cnpj` - CNPJ
            * `dni` - DNI
            * `cuit` - CUIT
          oneOf:
            - $ref: '#/components/schemas/DocTypeEnum'
            - $ref: '#/components/schemas/BlankEnum'
            - $ref: '#/components/schemas/NullEnum'
        docNumber:
          type: string
          nullable: true
          title: Documento
          description: Número do documento do cliente
          maxLength: 255
      required:
        - email
        - id
        - name
        - phone
    RefundProduct:
      type: object
      properties:
        id:
          type: string
          description: Identificador único do produto
          maxLength: 255
        short_id:
          type: string
          title: ID Curto
          description: Identificador curto do produto
          maxLength: 40
        name:
          type: string
          title: Nome
          description: Nome do produto
          maxLength: 255
      required:
        - name
    RefundOffer:
      type: object
      properties:
        id:
          type: string
          title: Identificador
          description: Identificador único da oferta
          maxLength: 40
        name:
          type: string
          title: Nome
          description: Nome da oferta, exibido no checkout e em outros locais
          maxLength: 255
      required:
        - name
    DocTypeEnum:
      enum:
        - cpf
        - cnpj
        - dni
        - cuit
      type: string
      description: |-
        * `cpf` - CPF
        * `cnpj` - CNPJ
        * `dni` - DNI
        * `cuit` - CUIT
    BlankEnum:
      enum:
        - ''
    NullEnum:
      enum:
        - null
  examples:
    UnauthenticatedErrorExample:
      summary: Token ausente ou inválido
      description: Token ausente ou inválido
      value:
        detail: As credenciais de autenticação não foram fornecidas.
  securitySchemes:
    OAuth Token:
      type: http
      scheme: bearer
      in: header
      name: Authorization
      description: >-
        Token de autenticação do tipo `Bearer {access_token}`, onde
        `{access_token}` é o token obtido no fluxo de
        [autenticação](/authentication).

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.