# Approval and OTP

## Maker-checker approval

By default (`requires_approval: "YES"`), a new batch waits in `PREVIEW-AND-APPROVE` until someone approves it.
This gives you a maker-checker flow:

- A **Level-2** key or user can **initiate** payouts.
- A **Level-3** or **Administrator** key or user can **approve** them.

For fully automated payouts, send `"requires_approval": "NO"` and the batch is approved immediately.

## OTP confirmation

Some bank routes need a one-time password for each transaction. When that applies, the transaction
moves to `OTP-CONFIRM-REQUIRED` (`TP111`) after approval. Submit the OTP you receive to complete the transfer.

### Confirm

```bash
curl -X POST https://api.intasend.com/api/v1/send-money/otp/confirm/ \
  -H "Authorization: Bearer $INTASEND_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{"transaction_id": "KQ9PLXR", "otp_code": "123456"}'
```

### Resend

```bash
curl -X POST https://api.intasend.com/api/v1/send-money/otp/resend/ \
  -H "Authorization: Bearer $INTASEND_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{"transaction_id": "KQ9PLXR"}'
```

| Error | Meaning |
|---|---|
| `No pending OTP request found for this transfer` | The OTP expired or was already used. Resend it. |
| `Transaction is not awaiting OTP confirmation (current status: …)` | The transaction isn't in `TP111`. |
| `Transaction not found` | Check the `transaction_id`. |
