# Validate accounts and lookup codes

## Validate an account

Before you pay, check who the recipient is:

```bash
curl -X POST https://api.intasend.com/api/v1/send-money/validate-accounts/ \
  -H "Authorization: Bearer $INTASEND_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{"provider": "MPESA-B2C", "account": "254712345678"}'
```

```json
{"account": "254712345678", "name": "JANE DOE", "status": "…"}
```

| Field | Required | Notes |
|---|---|---|
| `provider` | Yes | The provider you'll pay with |
| `account` | Yes | Account to validate |
| `account_type` | For `MPESA-B2B` | `PayBill` or `TillNumber` |
| `bank_code` | For `PESALINK` | Bank code |
| `country` | For `INTASEND-XB` | ISO-2 country code |

Supported lookups:

| Provider | Country | What's returned |
|---|---|---|
| `MPESA-B2C` | KE | Registered M-Pesa name |
| `MPESA-B2B` | KE | Till or paybill organisation name |
| `PESALINK` | KE | Bank account holder name |
| `INTASEND` | Any | IntaSend account name |
| `INTASEND-XB` | UG, RW | Mobile money account name |
| `INTASEND-XB-BANK` | UG | Bank account name |

## Bank codes

`GET /api/v1/send-money/bank-codes/{country}/` does not need authentication.

```bash
curl https://api.intasend.com/api/v1/send-money/bank-codes/ke/
```

```json
[{"bank_name": "Equity Bank", "bank_code": "68"}, {"bank_name": "KCB", "bank_code": "1"}]
```

| Country | Use with |
|---|---|
| `ke` | `PESALINK`, `RTGS`, `EFT` |
| `ng` | `INTASEND-XB` with `country: "NG"` |
| `ug` | `INTASEND-XB-BANK` |

## Operator codes

`GET /api/v1/send-money/operator-codes/{country}/?channel_type=MOBILE_MONEY|BANK`

```bash
curl https://api.intasend.com/api/v1/send-money/operator-codes/tz/?channel_type=MOBILE_MONEY
```

Each item contains `country`, `channel_type`, `operator_name`, `operator_code`, `default_provider` and `is_channel_default`.
Pass `operator_code` on transactions when the network can't be detected from the phone number. It is required in Tanzania.
