Supported authentication
Bearer sessionX-API-Key
LipaTally developers
Guides, examples and API references to help you build and launch a secure integration.
Integration guide
Follow the request lifecycle from application setup to a verified payment result. Keep credentials server-side and use the API contract for complete schemas.
Get started
Use provider-recognized sandbox credentials and a test MSISDN. This guide describes the flow; it does not initiate a payment.
Issue a sandbox API key scoped to the permissions your service needs.
An authorized operator configures approved sandbox references and enables STK_PUSH.
Call the API from your server with a unique idempotency key for the purchase.
Read the payment status; an accepted request is not proof that payment succeeded.
Access control
Use a server-side API key with the minimum permissions required for each integration.
Bearer sessionX-API-Key
An API key is scoped to its organization, application and environment. Do not send
X-Organization-Id with an API key.
Session-authenticated requests select the organization with
X-Organization-Id. Never expose API keys in browser code,
mobile apps, public repositories or customer-facing pages.
Environment safety
SANDBOX and PRODUCTION applications, API keys, provider accounts, and approved credential references are isolated.
Payments
Your service calls the versioned LipaTally API; LipaTally connects to the provider server-side.
| Channel | What it does |
|---|---|
STK_PUSH |
Prompts a customer on their phone and lets your service track the resulting payment state. |
PAYBILL |
Collection channel available when enabled for the application. |
TILL |
Collection channel available when enabled for the application. |
amount; KES M-Pesa amounts must represent whole shillings.Provider endpoint selection is handled server-side from the application's environment. Obtain the approved public API origin from your operator; never use an internal service hostname.
Request example
Use an API key scoped with payments:write. Set API_ORIGIN to the
operator-approved public origin, without the /api/v1 path.
curl --request POST "$API_ORIGIN/api/v1/payments" \
--header "X-API-Key: $API_KEY" \
--header "Idempotency-Key: $IDEMPOTENCY_KEY" \
--header "Content-Type: application/json" \
--data '{
"merchant_reference": "ORDER-12345",
"amount": "1500",
"currency": "KES",
"msisdn": "2547XXXXXXXX",
"channel": "STK_PUSH",
"description": "Order 12345"
}'
The response is wrapped in data and meta. This excerpt omits payment,
attempt and event fields; the OpenAPI contract contains the full response schema.
{
"data": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"merchant_reference": "ORDER-12345",
"status": "PENDING"
},
"meta": {
"request_id": "request-id"
}
}
Reliability
A timeout or accepted request can leave the outcome unresolved. Check the payment before retrying.
PENDING or UNKNOWN result is not success. Do not fulfill an order based only
on an HTTP success code.
curl --request GET "$API_ORIGIN/api/v1/payments/$PAYMENT_ID" \
--header "X-API-Key: $API_KEY"
meta.request_id when asking your operator to investigate.Use the HTTP status and error.code for handling. Details and messages can vary by error.
{
"error": {
"code": "VALIDATION_ERROR",
"message": "A human-readable explanation",
"details": []
},
"meta": {
"request_id": "request-id"
}
}
Reference
Use the OpenAPI contract for complete request, response and validation schemas.
| Method | Endpoint | Required scope | Purpose |
|---|---|---|---|
| POST | /api/v1/payments |
payments:write |
Create a payment request for the application's enabled channel. |
| GET | /api/v1/payments/{payment_id} |
payments:read |
Read the current payment state, attempts, events and receipt evidence. |
| GET | /api/v1/payments |
payments:read |
Search payments using filters such as application, status and merchant reference. |