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

# Flujo: clientes y créditos

> Alta de cliente, verificación ARCA/BCRA y creación de un crédito con sus cuotas.

# Flujo: clientes y créditos

Ejemplo completo: dar de alta un cliente, verificarlo y otorgarle un crédito.
Requiere una clave de **acceso total** para las escrituras.

## 1. Crear el cliente

```bash theme={null}
curl --request POST \
  --url "https://api.finup.ar/api/clients" \
  --header "Authorization: Bearer $FINUP_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
    "dni": "30123456",
    "first_name": "María",
    "last_name": "González",
    "sex": "f",
    "phone": "+54 11 5555 5555"
  }'
```

Guardá el `id` del cliente (`CLIENT_ID`). El `dni` es único por negocio: si ya
existe, la API responde `409`.

## 2. Verificar en ARCA y BCRA

Consulta en vivo, sin guardar:

```bash theme={null}
curl "https://api.finup.ar/api/integrations/persona?dni=30123456&sex=f" \
  -H "Authorization: Bearer $FINUP_API_KEY"
```

Para **guardar** el snapshot en la ficha del cliente:

```bash theme={null}
curl --request POST \
  --url "https://api.finup.ar/api/clients/$CLIENT_ID/verification" \
  --header "Authorization: Bearer $FINUP_API_KEY"
```

Después podés leer la última verificación:

```bash theme={null}
curl "https://api.finup.ar/api/clients/$CLIENT_ID/verification" \
  -H "Authorization: Bearer $FINUP_API_KEY"
```

## 3. Elegir un plan

Listá los planes activos para obtener el `credit_config_id`:

```bash theme={null}
curl "https://api.finup.ar/api/credit-configs" -H "Authorization: Bearer $FINUP_API_KEY"
```

## 4. Crear el crédito

```bash theme={null}
curl --request POST \
  --url "https://api.finup.ar/api/clients/$CLIENT_ID/credits" \
  --header "Authorization: Bearer $FINUP_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{ "amount": 300000, "credit_config_id": "CONFIG_UUID" }'
```

Respuesta (crédito + cuotas):

```json theme={null}
{
  "credit": {
    "id": "…", "client_id": "…", "amount": 300000,
    "status": "active", "sequential_id": 1042
  },
  "installments": [
    { "number": 1, "amount": 58500, "due_date": "2026-02-10", "status": "pending" },
    { "number": 2, "amount": 58500, "due_date": "2026-03-10", "status": "pending" }
  ]
}
```

## 5. Consultar el crédito

```bash theme={null}
# Cuotas
curl "https://api.finup.ar/api/credits/$CREDIT_ID/installments" -H "Authorization: Bearer $FINUP_API_KEY"

# Ficha completa del cliente (créditos, cuotas, movimientos y archivos)
curl "https://api.finup.ar/api/clients/$CLIENT_ID" -H "Authorization: Bearer $FINUP_API_KEY"
```

<Tip>
  Para repetir una venta parecida, replicá el `POST` con otro `amount` o
  `credit_config_id`: cada llamada crea un crédito nuevo.
</Tip>
