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

# Test your integration

> Simulate a payment using alternative methods

Simulate every alternative payment method outcome without touching real banks. In test mode, Fintoc replaces the bank's checkout page with a sandbox simulator that emits the same webhooks as the live flow, so you can verify your integration before going live.

## Available providers

Use `institution_id` to filter banks on the checkout page and `payment_type` to route webhook logic per bank.

| Bank            | `institution_id`     | `payment_type`    | Account types         |
| :-------------- | :------------------- | :---------------- | :-------------------- |
| Banco Santander | `cl_banco_santander` | `banco_santander` | Personal and business |
| Banco de Chile  | `cl_banco_de_chile`  | `banco_de_chile`  | Personal and business |
| BancoEstado     | `cl_banco_estado`    | `banco_estado`    | Personal and business |
| Mach            | `cl_mach`            | `mach`            | Personal              |

Business-account providers include a multi-signer flow. Personal-only providers complete in one step.

## Create a Checkout Session in test mode

Send the request with your test API key. Set `payment_method_types` to `["bank_transfer"]` so the checkout page renders bank buttons.

```bash theme={null}
curl https://api.fintoc.com/v2/checkout_sessions \
  -u sk_test_a1b3h4j24i9j0: \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 1000000,
    "currency": "CLP",
    "payment_method_types": ["bank_transfer"],
    "success_url": "https://example.com/success",
    "cancel_url": "https://example.com/cancel"
  }'
```

The response includes `id` and `redirect_url`.

```json theme={null}
{
  "id": "cs_test_a1b2c3d4e5f6g7h8i9j0",
  "object": "checkout_session",
  "status": "in_progress",
  "redirect_url": "https://pay.fintoc.com/payment?checkout_session=cs_ca29miv93md9hwl9",
  "amount": 1000000,
  "currency": "CLP"
}
```

<br />

## Open the checkout and pick a bank

Open `redirect_url` in a browser and click the bank you want to test. Fintoc redirects you to `https://pay.fintoc.com/sandbox/{checkout_session_id}`.

## Trigger an outcome

The simulator renders a page styled after the selected bank.

For business-capable providers (Santander, Banco de Chile, BancoEstado), first pick the scenario:

* `Pago Persona`
* `Pago empresa con 1 apoderado`
* `Pago empresa con 2 o más apoderados`

Mach skips this step and shows the outcome screen directly. Then click the outcome you want to simulate:

**Personal payments** (Mach, or the `Pago Persona` flow on business-capable providers):

| Outcome button  | Status      |
| --------------- | ----------- |
| `Pago exitoso`  | `succeeded` |
| `Pago fallido`  | `failed`    |
| `Pago expirado` | `expired`   |

**Business payments** (1 or 2+ apoderados on Santander, Banco de Chile, BancoEstado):

| Outcome button                           | Status                                                                             |
| ---------------------------------------- | ---------------------------------------------------------------------------------- |
| `Pago aprobado por todos los apoderados` | Moves to `requires_action` and transitions to `succeeded` after 30 seconds.        |
| `Pago pendiente de aprobación`           | Stays in `requires_action` until the remaining signers act or the session expires. |
| `Pago fallido`                           | `failed`.                                                                          |

The 30-second delay reproduces the time it takes for every signer to sign the payment in production.

## Inspect the webhooks

Subscribe to these events in your webhook endpoint configuration; the sandbox emits the same payloads as production. The payloads below show only the fields relevant to this flow.

### Business approved by all signers

The customer clicks **Pago aprobado por todos los apoderados**. Fintoc sends `checkout_session.finished` immediately, then `payment_intent.succeeded` after 30 seconds.

```json theme={null}
{
  "type": "checkout_session.finished",
  "mode": "test",
  "data": {
    "object": "checkout_session",
    "id": "cs_test_a1b2c3d4e5f6g7h8i9j0",
    "status": "finished",
    "payment_resource": {
      "payment_intent": {
        "object": "payment_intent",
        "id": "pi_test_1a2b3c4d5e6f7g8h9i0j",
        "status": "requires_action",
        "amount": 1000000,
        "currency": "CLP",
        "payment_type": "banco_santander",
        "next_action": {
          "type": "bank_transfer_authorization",
          "expires_at": "2026-05-16T00:00:00-04:00"
        }
      }
    }
  }
}
```

```json theme={null}
{
  "type": "payment_intent.succeeded",
  "mode": "test",
  "data": {
    "object": "payment_intent",
    "id": "pi_test_1a2b3c4d5e6f7g8h9i0j",
    "status": "succeeded",
    "amount": 1000000,
    "currency": "CLP",
    "payment_type": "banco_santander",
    "next_action": null
  }
}
```

### Business pending approval

The customer clicks **Pago pendiente de aprobación**. Fintoc sends `checkout_session.finished`. The intent stays in `requires_action` until the remaining signers act. If no one acts before the deadline shown in `next_action.expires_at`, Fintoc sends `payment_intent.expired`.

```json theme={null}
{
  "type": "checkout_session.finished",
  "mode": "test",
  "data": {
    "object": "checkout_session",
    "id": "cs_test_a1b2c3d4e5f6g7h8i9j0",
    "status": "finished",
    "payment_resource": {
      "payment_intent": {
        "object": "payment_intent",
        "id": "pi_test_1a2b3c4d5e6f7g8h9i0j",
        "status": "requires_action",
        "amount": 1000000,
        "currency": "CLP",
        "payment_type": "banco_santander",
        "next_action": {
          "type": "bank_transfer_authorization",
          "expires_at": "2026-05-16T00:00:00-04:00"
        }
      }
    }
  }
}
```

```json theme={null}
{
  "type": "payment_intent.expired",
  "mode": "test",
  "data": {
    "object": "payment_intent",
    "id": "pi_test_1a2b3c4d5e6f7g8h9i0j",
    "status": "expired",
    "amount": 1000000,
    "currency": "CLP",
    "payment_type": "banco_santander",
    "next_action": null
  }
}
```

### Business rejected

The customer clicks **Pago fallido**. Fintoc sends `checkout_session.finished` and then `payment_intent.failed`.

```json theme={null}
{
  "type": "checkout_session.finished",
  "mode": "test",
  "data": {
    "object": "checkout_session",
    "id": "cs_test_a1b2c3d4e5f6g7h8i9j0",
    "status": "finished",
    "payment_resource": {
      "payment_intent": {
        "object": "payment_intent",
        "id": "pi_test_1a2b3c4d5e6f7g8h9i0j",
        "status": "requires_action",
        "amount": 1000000,
        "currency": "CLP",
        "payment_type": "banco_santander",
        "next_action": {
          "type": "bank_transfer_authorization",
          "expires_at": "2026-05-16T00:00:00-04:00"
        }
      }
    }
  }
}
```

```json theme={null}
{
  "type": "payment_intent.failed",
  "mode": "test",
  "data": {
    "object": "payment_intent",
    "id": "pi_test_1a2b3c4d5e6f7g8h9i0j",
    "status": "failed",
    "amount": 1000000,
    "currency": "CLP",
    "payment_type": "banco_santander",
    "next_action": null
  }
}
```

### Personal succeeded

The customer clicks **Pago exitoso**. Fintoc sends `checkout_session.finished` and `payment_intent.succeeded` in the same transaction.

```json theme={null}
{
  "type": "checkout_session.finished",
  "mode": "test",
  "data": {
    "object": "checkout_session",
    "id": "cs_test_a1b2c3d4e5f6g7h8i9j0",
    "status": "finished",
    "payment_resource": {
      "payment_intent": {
        "object": "payment_intent",
        "id": "pi_test_1a2b3c4d5e6f7g8h9i0j",
        "status": "succeeded",
        "amount": 1000000,
        "currency": "CLP",
        "payment_type": "mach"
      }
    }
  }
}
```

```json theme={null}
{
  "type": "payment_intent.succeeded",
  "mode": "test",
  "data": {
    "object": "payment_intent",
    "id": "pi_test_1a2b3c4d5e6f7g8h9i0j",
    "status": "succeeded",
    "amount": 1000000,
    "currency": "CLP",
    "payment_type": "mach"
  }
}
```

### Personal failed

The customer clicks **Pago fallido**. Same structure as personal succeeded, with `status: "failed"`.

```json theme={null}
{
  "type": "payment_intent.failed",
  "mode": "test",
  "data": {
    "object": "payment_intent",
    "id": "pi_test_1a2b3c4d5e6f7g8h9i0j",
    "status": "failed",
    "amount": 1000000,
    "currency": "CLP",
    "payment_type": "mach"
  }
}
```

`checkout_session.finished` also fires alongside, with `payment_resource.payment_intent.status: "failed"`.

### Personal expired

The customer clicks **Pago expirado**. Fintoc sends `checkout_session.finished` and `payment_intent.expired`.

```json theme={null}
{
  "type": "payment_intent.expired",
  "mode": "test",
  "data": {
    "object": "payment_intent",
    "id": "pi_test_1a2b3c4d5e6f7g8h9i0j",
    "status": "expired",
    "amount": 1000000,
    "currency": "CLP",
    "payment_type": "mach"
  }
}
```

`checkout_session.finished` also fires alongside, with `payment_resource.payment_intent.status: "expired"`.

When the payment ends in `failed` or `expired`, the `payment_intent` object may also include an `error_reason` field describing the failure. The exact values depend on the bank and the reason translator.
