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

# Cash-in

> Páginas de pagamento hospedadas para contas CLP no Chile

## Visão geral

O cash-in no Chile usa **checkout hospedado**: listar métodos, criar transação de entrada e redirecionar o pagador para `checkoutUrl`.

A conta deve usar moeda **CLP** e país **CL**.

## Pré-requisitos

* Token Bearer com acesso à conta CLP
* Conta CLP no Chile habilitada para cash-in (entre em contato com a HG.Cash se os métodos de pagamento ainda não aparecerem)

## Fluxo

1. `GET /api/v1/cl/payment-methods`
2. `POST /api/v1/cl/transactions/inbound` com `paymentMethodId`, `amount` e `customer` (inclui `personalId` chileno)
3. Redirecionar para `checkoutUrl`
4. Opcional: `GET /api/v1/cl/transactions/{id}/status` ou `webhookUrl` — veja [Recebimento de webhooks](/pt-BR/developers/receiving-webhooks)

## Exemplo

```bash theme={null}
curl -X POST https://hg.cash/api/v1/cl/transactions/inbound \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "accountId": "YOUR_ACCOUNT_UUID",
    "paymentMethodId": "PAYMENT_METHOD_UUID",
    "amount": 10000,
    "customer": {
      "firstName": "Jane",
      "lastName": "Doe",
      "email": "jane@example.com",
      "personalId": "123456789",
      "ip": "203.0.113.10"
    }
  }'
```

A transação começa em `pending` e vai para `done` quando o pagamento é confirmado.
