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

# Tanda API

> Collect and send KES payments in Kenya through M-PESA, Airtel Money and bank transfer with one integration.

Tanda gives you one API for moving money in Kenya. Collect from customers by M-PESA, Airtel Money or bank transfer, and pay out to wallets, bank accounts, paybills and tills from the same KES wallet.

Tanda Agent Limited is a payment service provider authorised by the Central Bank of Kenya.

## What you can build

> **[Checkout](https://api.tandapay.io/guides/collections/checkout.md)**
>
> Send customers to a Tanda-hosted page where they pay by M-PESA, Airtel Money or bank transfer. No payment UI to build.

> **[Collections](https://api.tandapay.io/guides/collections/overview.md)**
>
> Trigger an M-PESA or Airtel Money prompt, or issue a virtual bank account.

> **[Payouts](https://api.tandapay.io/guides/payouts/overview.md)**
>
> Pay suppliers, staff and customers on M-PESA, Airtel Money, Kenyan banks, paybills and tills.

> **[Webhooks](https://api.tandapay.io/guides/webhooks/overview.md)**
>
> Get notified the moment a payment or payout succeeds or fails.

## How it works

**1. Authenticate**

Exchange your public key and API key for a bearer token. See [Authentication](https://api.tandapay.io/guides/authentication.md).

**2. Start a transaction**

Create a checkout session, a charge or a payout. Every request carries your own unique `externalReference`.

**3. Wait for the outcome**

Money moves asynchronously. A `200` response means Tanda accepted the request, not that funds have moved. The final status arrives by [webhook](https://api.tandapay.io/guides/webhooks/overview.md).

**4. Fulfil**

Release goods or credit your customer only when the status is `successful`.

## Key concepts

> **Transaction IDs and external references**
>
> Every checkout session, charge, payout and refund creates a transaction with a Tanda `transactionId`. You also send your own `externalReference`, which must be unique per attempt. You can look a transaction up by either.

> **Asynchronous settlement**
>
> Customers approve M-PESA and Airtel Money prompts on their phones, and banks settle on their own schedule. Treat `pending` as "not yet" and act only on `successful` or `failed`.

> **Amounts, currency and phone numbers**
>
> Amounts are in Kenyan shillings (KES), not cents: `1500` means KES 1,500. Phone numbers use the international format without the `+`, for example `254712345678`. See [Kenya payment methods](https://api.tandapay.io/guides/kenya-payment-methods.md).

> **Reference data**
>
> Bank codes and enabled networks can change. Fetch them from [Get banks](https://api.tandapay.io/api-reference/endpoint/get-banks.md) and [Get mobile money providers](https://api.tandapay.io/api-reference/endpoint/get-mobile-money-providers.md) instead of hard-coding them.

## Base URL

```bash theme={null}
https://api.tandapay.io
```

Sandbox and production share this URL. The keys you authenticate with decide which environment you reach. See [Environments](https://api.tandapay.io/guides/environments.md).

> **[Start with the quickstart](https://api.tandapay.io/quickstart.md)**
>
> Authenticate, collect your first payment and send your first payout in sandbox.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.