Core Concepts

Authentication

X-API-Key Header

All API requests must include your API credentials in the X-API-Key header.

LakiPay uses a PUBLICKEY:SECRETKEY combination as the value of X-API-Key, for example: pk_live_xxx:sk_live_xxx.

curl -X POST https://api.lakipay.co/api/v2/payment/direct \
  -H "X-API-Key: your-publickey:your-secretkey" \
  -H "Content-Type: application/json"

Important

  • • API keys are case-sensitive
  • • Never share your API key publicly
  • • Rotate keys regularly for security
  • • Use different keys for test and production

Request Format

HTTP Methods

LakiPay API uses standard HTTP methods:

POSTCreate new resources (payments, withdrawals)
GETRetrieve transaction status and information

Content Type

All requests must use application/json content type:

Content-Type: application/json

Request Body Structure

Request bodies are JSON objects. Example direct payment request:

{
  "amount": 100.00,
  "currency": "ETB",
  "phone_number": "251911234567",
  "medium": "MPESA",
  "description": "Payment description",
  "reference": "unique-reference-id",
  "callback_url": "https://yourwebsite.com/webhook"
}

Response Format

Success Response

A successful response (HTTP 200) contains:

{
  "status": "SUCCESS",
  "message": "Payment initiated successfully",
  "data": {
    "transaction_id": "TXN-123456789",
    "reference": "unique-reference-id",
    "amount": 100.00,
    "currency": "ETB",
    "status": "PENDING",
    "created_at": "2024-01-15T10:30:00Z"
  }
}

Response Fields

FieldTypeDescription
statusstringSUCCESS or ERROR
messagestringHuman-readable message
dataobjectTransaction details
transaction_idstringUnique transaction identifier
referencestringYour reference ID

Error Handling

Error Response Format

Error responses follow this structure:

{
  "status": "ERROR",
  "message": "Invalid API key",
  "error_code": "INVALID_API_KEY",
  "errors": {
    "api_key": ["API key is required"]
  }
}

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

Common Error Codes

Error CodeDescriptionSolution
INVALID_API_KEYAPI key is invalid or missingCheck your API key in headers
INVALID_AMOUNTAmount format is incorrectUse decimal format (e.g., 100.00)
INVALID_PHONEPhone number format is invalidUse E.164 format (+251...)
INSUFFICIENT_BALANCEInsufficient account balanceTop up your account
PROVIDER_ERRORPayment provider errorRetry or contact support

Currency and Amount Formatting

Supported Currencies

ETB (Ethiopian Birr)

Local currency for Ethiopian payment providers

Format: 100.00

USD (US Dollar)

International currency via CYBERSOURCE

Format: 100.00

Amount Format

Amounts must be provided as decimal numbers with up to 2 decimal places:

100.00✓ Valid
100✗ Invalid (missing decimals)
100.123✗ Invalid (too many decimals)