# Bank and agent deposits (Kenya)

## Customer reference numbers

Give each customer a permanent account number they can pay into by **bank transfer** or **M-Pesa paybill**:

```bash
curl -X POST https://api.intasend.com/api/v1/payment/create_customer_reference/ \
  -H "Authorization: Bearer $INTASEND_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{"reference": "customer-001"}'
```

```json
{"account": 654321, "reference": "customer-001", "bank_account": "01100…", "mpesa_paybill": "…"}
```

Calling it again with the same `reference` returns the same account number.

## Co-op Bank agent deposits

This lets a customer pay cash at a Co-op Bank agent:

```bash
curl -X POST https://api.intasend.com/api/v1/payment/coop-agent-deposit/ \
  -H "Authorization: Bearer $INTASEND_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{"amount": 1000, "api_ref": "agent-dep-1"}'
```

```json
{"invoice": {"invoice_id": "…", "state": "PENDING"}, "reference_no": 123456, "bank_account": "…", "status": "PENDING"}
```

Give the customer the `bank_account` and `reference_no`. The invoice completes when the agent confirms the deposit.
