Skip to main content
Checkout, the unified payment SDK, is the quickest way to accept payments. Your server creates a session, you redirect the customer to the link Tanda returns, and the customer pays by M-PESA, Airtel Money or bank transfer on a Tanda-hosted page. Tanda handles the phone prompt and bank details for you.

1. Create a session

Call Create checkout session from your server.
Response

Options

string
Show only one method: momo (M-PESA and Airtel Money) or bank. Leave it out to let the customer choose from everything enabled on your account.
string
Your own ID for the customer. It comes back on the transaction, so you can match payments to customers.
object
firstName, lastName, email, accountName and phoneNumber (E.164, e.g. +254712345678) to fill in for the customer. Prefilled values can’t be edited on the payment page, so only send details you’re sure of.
string
Where Tanda sends the customer after a successful payment.
string
Where Tanda sends the customer after a failed payment.
string
Where Tanda sends the customer if they cancel. All three redirect URLs are optional but recommended.
Add your own reference to the redirect URLs, for example https://merchant.co.ke/checkout/success?ref=order_10045, so the page knows which order to look up.

2. Redirect the customer

Send the customer to paymentSdkLink exactly as returned. Don’t build or modify the URL yourself. On the page they pick M-PESA, Airtel Money or bank transfer and complete the payment.

3. Handle the return

When the customer finishes, Tanda redirects them to the matching URL. Use this page to show a message such as “We’re confirming your payment”.
A redirect to your success URL is not proof of payment. Customers can open that URL directly. Always confirm the status from your server before fulfilling.

4. Confirm and fulfil

You’ll receive transaction_updated webhooks as the payment progresses. Before you fulfil, confirm the outcome from your server with Get transaction, using the transactionId or your externalReference.
Response

Good practice

  • Create a new session, with a new externalReference, for every attempt.
  • Store transactionId against your order as soon as the session is created, so webhooks can find the order.
  • Make your fulfilment idempotent: the same webhook can arrive more than once.
  • Use Get checkout methods if you want to show method logos before the customer leaves your site.

Test it

In sandbox, the value the customer enters on the hosted page decides the outcome. See Testing.