TeePayDocs
Getting started

Quickstart

Create an API key, check your access and take your first payment with a hosted checkout.

This guide takes about ten minutes. You need a verified TeePay business account and access to the Developers area of the dashboard.

Create an API key

In the dashboard, open Developers → API keys and create a key. Choose only the scopes you need. For this guide select checkout:create and checkout:read.

Creating a key asks you to confirm the action. The secret is shown once. Store it in your server's secret manager or environment, never in source control, a browser or a mobile app.

export TEEPAY_API_KEY="tp_live_xxxxxxxx.xxxxxxxxxxxxxxxx"

Check the key

curl https://api.teepay.me/v1/whoami \
  -H "Authorization: Bearer $TEEPAY_API_KEY"
{
  "application_reference": "8f0c2d4e-…",
  "environment": "live",
  "scopes": ["checkout:create", "checkout:read"],
  "credential_prefix": "tp_live_xxxxxxxx"
}

Then ask which features your account can use right now:

curl https://api.teepay.me/v1/capabilities \
  -H "Authorization: Bearer $TEEPAY_API_KEY"

Look for "checkout_sessions": true in features.

Create a checkout session

curl https://api.teepay.me/v1/checkout-sessions \
  -H "Authorization: Bearer $TEEPAY_API_KEY" \
  -H "Idempotency-Key: order-1001" \
  -H "Content-Type: application/json" \
  -d '{"title":"Order 1001","amount_minor":"500000","currency":"TZS","reference":"order-1001"}'

The response contains checkout_url. Redirect your customer there; they enter their mobile money number and approve the payment on their phone.

Confirm the payment

When the customer pays, the session status becomes paid and you receive a payment.completed webhook whose data.source is your session. You can also read the session:

curl https://api.teepay.me/v1/checkout-sessions/SESSION_ID \
  -H "Authorization: Bearer $TEEPAY_API_KEY"

Fulfil the order only when status is paid.

NextHow TeePay worksThe payment lifecycle and what "paid" really means.

On this page