# Uganda

| | |
|---|---|
| Currency | `UGX` |
| Country code | `UG` |
| Phone format | Country code `256` + number, digits only, no `+` (e.g. `256772123456`) |
| Collect with | [Mobile money push](https://developers.intasend.com/guides/collections/mobile-money-push/), [Checkout](https://developers.intasend.com/guides/collections/checkout/) |
| Send with | `provider: "INTASEND-XB"`
| Amount limits | Mobile money: UGX 500 to 5,000,000. Bank: UGX 5,000 to 5,000,000 | |

## Networks

| Network | Detected by prefix / `operator_code` |
|---|---|
| MTN Mobile Money | 25677, 25678, 25676, 25639 |
| Airtel Money | 25670, 25675, 25674 |

## Collect a payment

Send a mobile money prompt to the customer's phone:

```bash
curl -X POST https://api.intasend.com/api/v1/payment/intasend-xb-push/ \
  -H "Authorization: Bearer $INTASEND_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "amount": 5000,
  "currency": "UGX",
  "country": "UG",
  "phone_number": "256772123456",
  "api_ref": "order-123"
}'
```

On [Checkout](https://developers.intasend.com/guides/collections/checkout/) with `currency: "UGX"`, customers can choose MTN or Airtel. The amount must be between 500 and 5,000,000.

The response contains an `invoice` in `PENDING` or `PROCESSING` state. Wait for the
`collection_event` [webhook](https://developers.intasend.com/guides/webhooks/) or poll [payment status](https://developers.intasend.com/guides/collections/overview/#check-payment-status)
until `state` is `COMPLETE` or `FAILED`.

## Send money

### Validate the recipient first

```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": "INTASEND-XB",
  "country": "UG",
  "account": "256772123456"
}'
```

### Initiate the payout

```bash
curl -X POST https://api.intasend.com/api/v1/send-money/initiate/ \
  -H "Authorization: Bearer $INTASEND_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "currency": "UGX",
  "country": "UG",
  "provider": "INTASEND-XB",
  "requires_approval": "NO",
  "callback_url": "https://example.com/intasend/payouts",
  "transactions": [
    {
      "name": "John Doe",
      "account": "256772123456",
      "amount": "5000",
      "narrative": "Payout"
    }
  ]
}'
```

Track it with [`/send-money/status/`](https://developers.intasend.com/guides/send-money/overview/#3-check-status) using the returned `tracking_id`.

## Send to a bank account

Use `provider: "INTASEND-XB-BANK"`. Bank codes come from [`GET /send-money/bank-codes/ug/`](https://developers.intasend.com/guides/send-money/validate-accounts/#bank-codes).

```bash
curl -X POST https://api.intasend.com/api/v1/send-money/initiate/ \
  -H "Authorization: Bearer $INTASEND_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "currency": "UGX",
  "country": "UG",
  "provider": "INTASEND-XB-BANK",
  "transactions": [
    {
      "name": "Okello James",
      "account": "3100012345",
      "bank_code": "CENTENARY_RURAL_DEVELOPMENT_BANK_UGANDA_TRANSFER",
      "amount": "50000",
      "narrative": "Supplier"
    }
  ]
}'
```

`name` is the account holder's name. You can validate a bank account first with `{"provider": "INTASEND-XB-BANK", "country": "UG", "account": "…", "bank_code": "…"}`.
