Skip to main content

Authentication Overview

Client ID - Remains accessible in your application settings and is also required for API authentication. API Key - It is required for API authentication, displayed only once during creation. Copy and store it securely JWT Token - API Key and Client ID are exchanged for a short-lived JWT Token, which is then used in all subsequent API calls. The JWT token is valid for 1hr (60 Minutes) from the time of issuance. After it expires, you must generate a new token using your API Key and Client ID.
Never share your API credentials or JWT token publicly. Always use HTTPS to protect your credentials during transmission.
API Rate Limits - The ClickPesa API enforces a rate limit of 120 requests per minute per IP address. This limit applies to all API endpoints. If you exceed this limit, your requests will be throttled. Generate-token rate limits - Generate token has extra limits on top of the per-minute cap. Successful calls: 1 token per Client ID per IP every 3 minutes. Other Client IDs on the same IP may still mint in that window. Failed calls (invalid or missing credentials) from the same IP are capped in the same 3-minute window. A 429 includes fields.retryAfterSeconds and Retry-After. Reuse each JWT until it expires (1 hour). KYC required for API access - If your merchant account has not completed KYC, third-party API requests are refused, including generate-token. You also cannot create an application or an API key until KYC is approved. You can still review the platform with Invoices, Payment Pages, and BillPay. After approval, the per-minute and generate-token limits still apply.
Implement appropriate retry logic with exponential backoff in your application to handle rate limit responses gracefully. If generate-token returns 429, wait fields.retryAfterSeconds before calling it again. API calls are refused until KYC is approved. Before then, review the platform with Invoices, Payment Pages, and BillPay.

Application Setup

Step 1: Log in to the ClickPesa Dashboard

Go to the ClickPesa Dashboard and log in with your credentials.

Step 2: Access Developer Settings

  1. In the dashboard, click Settings.
  2. Navigate to the Developers section.
See Developers settings for the full dashboard walkthrough.

Step 3: Create a New Application

Click Create Application to begin the setup process.

Step 4: Configure Application Details

When creating your application, provide the following details:
  • Application Name: A name to identify your app.
  • Integration Type: Select API.
  • Features: Choose the required features (e.g. Payment API, Payout API).

Step 5: Submit Your Application

Click Create to finalize the application setup.

Managing API Keys

Important: Keep your API credentials secure and do not share them publicly.

Access API Keys

  1. Navigate to Settings in the ClickPesa dashboard.
  2. Go to the Developers section.
  3. Select the application for which you want to manage API keys.
  4. Click Manage API Keys in the application settings.
  5. A panel will appear, showing the list of existing API keys, including:
    • Name: Assigned name of the API key.
    • Last Activity: Date of last use.
    • Revoke Button: Option to deactivate the key.

Adding a New API Key

  1. Navigate to Settings in the ClickPesa dashboard.
  2. Go to the Developers section.
  3. Select the application for which you want to create an API key.
  4. Click Manage API Keys in the application settings.
  5. Click Add API Key.
  6. A modal will appear where you can enter the required details:
    • Name: A label for the API key.
    • Expiry Date: Define when the key will expire.
  7. Click Submit to proceed.
  8. The modal will prompt you to enter your password for confirmation.
  9. After successfully confirming your password, the API key will be created.
  10. The modal will then display:
    • The Client ID and newly generated API Key.
    • The Expiry Date.