API Reference
Complete reference documentation for all LakiPay API endpoints, parameters, and response formats.
Direct Payment API
POST
/api/v2/payment/directProcess payments through various payment providers. Supports both local (ETB) and international (USD) currencies.
Complete Parameter Reference
| Parameter | Type | Required | Description |
|---|---|---|---|
| amount | decimal | Required | Payment amount with 2 decimal places (e.g., 100.00) |
| currency | string | Required | "ETB" for local, "USD" for international |
| phone_number | string | Required | Phone number including country code, without + (e.g., 251911234567) |
| medium | string | Required | Payment provider: MPESA, TELEBIRR, CBE, ETHSWITCH, LAKIPAY, CYBERSOURCE |
| description | string | Optional | Human-readable payment description |
| reference | string | Required | Unique reference ID (max 100 characters) |
| callback_url | string | Optional | Webhook URL for payment status updates |
| redirects | object | Optional | Object with success_url and failure_url |
| merchant_pays_fee | boolean | Optional | For USD payments: whether merchant absorbs fees |
Withdrawal API
POST
/api/v2/payment/withdrawalInitiate withdrawals from your merchant account to customer accounts.
Hosted Checkout API
POST
/api/v2/payment/checkoutCreate a hosted checkout session that LakiPay renders for you, supporting multiple payment mediums with redirect URLs for success and failure.
Example Request Body
{
"amount": 1000.5,
"callback_url": "https://example.com/callback",
"currency": "ETB",
"description": "Payment for order #123",
"phone_number": "251911111111",
"redirects": {
"failed": "https://example.com/failed",
"success": "https://example.com/success"
},
"reference": "ORDER123456",
"supported_mediums": [
"MPESA",
"TELEBIRR",
"CBE"
]
}| Parameter | Type | Required | Description |
|---|---|---|---|
| amount | decimal | Required | Payment amount with 2 decimal places. |
| currency | string | Required | Currency code (e.g., "ETB"). |
| phone_number | string | Required | Phone number including country code, without leading +. |
| reference | string | Required | Unique reference for this checkout session. |
| callback_url | string | Optional | Webhook URL where LakiPay sends asynchronous status notifications. |
| redirects.success | string | Required | URL to redirect the customer to after success. |
| redirects.failed | string | Required | URL to redirect the customer to after failure. |
| supported_mediums | array[string] | Required | List of payment mediums to show on the hosted checkout (e.g., MPESA, TELEBIRR, CBE). |
Transaction Detail API
GET
/api/v2/payment/transaction/{id}Retrieve full details for a specific transaction by its unique identifier.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | Required | The transaction ID returned by the Direct Payment or Hosted Checkout APIs. |
Example Request
curl -X GET "https://api.lakipay.co/api/v2/payment/transaction/TXN-123456789" \ -H "X-API-Key: your-publickey:your-secretkey"
Status Codes
HTTP Status Codes
200 OK
Request successful
400 Bad Request
Invalid request parameters
401 Unauthorized
Invalid or missing API key
500 Internal Server Error
Server error, contact support
Transaction Status Values
SUCCESS
Transaction completed successfully
FAILED
Transaction failed
PENDING
Transaction is being processed
CANCELLED
Transaction was cancelled