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

# PURCHASE_REFUNDED

> Disparado quando um reembolso é processado para um pedido anteriormente aprovado.

Corresponde ao evento interno `order.refunded`. O pedido foi pago e depois reembolsado.

## Quando é disparado

* Reembolso solicitado pelo comprador e processado pela Velan
* Estorno manual realizado pelo produtor

## Payload

```json theme={null}
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "order_id": 123,
  "creation_date": 1736611200000,
  "event": "PURCHASE_REFUNDED",
  "version": "2.0.0",
  "data": {
    "purchase": {
      "transaction": "abc123-uuid-do-pedido",
      "status": "REFUNDED",
      "order_date": 1736524700000,
      "approved_date": 1736524800000,
      "refund_date": 1736611200000,
      "full_price": {
        "value": 297.00,
        "currency_value": "BRL"
      },
      "price": {
        "value": 197.00,
        "currency_value": "BRL"
      },
      "payment": {
        "type": "CREDIT_CARD",
        "installments_number": 3
      },
      "fees": {
        "value": 13.45,
        "currency_value": "BRL"
      },
      "net_amount": {
        "value": 183.55,
        "currency_value": "BRL"
      },
      "gateway_transaction_id": "172691451499",
      "offer": {
        "code": "abc12345",
        "name": "Oferta Principal"
      },
      "order_bump": {
        "is_order_bump": false,
        "parent_purchase_transaction": null
      },
      "tracking": {
        "source": "google",
        "utm_source": "google",
        "utm_medium": "cpc",
        "utm_campaign": "black-friday",
        "utm_content": null,
        "utm_term": null,
        "src": null,
        "sck": null
      }
    },
    "product": {
      "id": 1,
      "name": "Curso de Marketing Digital"
    },
    "buyer": {
      "name": "João Silva",
      "first_name": "João",
      "last_name": "Silva",
      "email": "joao@exemplo.com",
      "checkout_phone": "+5511999990000",
      "document": "123.456.789-00",
      "document_type": "CPF"
    },
    "order_bumps": []
  }
}
```

## Campos-chave

| Campo                    | Valor neste evento                           |
| ------------------------ | -------------------------------------------- |
| `purchase.status`        | `REFUNDED`                                   |
| `purchase.approved_date` | Timestamp original da aprovação do pagamento |
| `purchase.refund_date`   | Timestamp (ms) do reembolso                  |

<Warning>
  Ao receber este evento, revogue o acesso ao produto ou serviço. Use o mesmo `purchase.transaction` do `PURCHASE_APPROVED` para identificar o registro e atualizá-lo.
</Warning>
