Skip to main content

PayLink SDK Quickstart

🚀
Get started with the PayLink SDK in minutes. This guide will walk you through setup, configuration, and your first payment processing.

Before You Begin

You’ll Need:

  • ✅ Python 3.8 or higher
  • ✅ A PayLink account with API access
  • ✅ Payment provider credentials (e.g., M-Pesa)

Visit https://paylink-platform-izl1.vercel.app/ and create your account.

PayLink Sign Up Page

Fill in your details to create your PayLink account

2. Generate Your API Key

After signing in, navigate to Settings and generate your API key.

Generate API Key

3. Copy Your API Key

Copy your API key from the dashboard. You’ll need it for your integration.

Copy API Key

Step 2: Configure Environment Variables

Create a .env file in your project root with your PayLink credentials:

You can create a project on the PayLink platform and use the same name or just specify your preferred name under PAYLINK_PROJECT and PayLink will create the project automatically.

Step 3: Install the SDK

Run this command in your terminal to install the PayLink SDK and its dependencies:

Note: This will install the latest version of the SDK. For a specific version, use pip install paylink-sdk==X.Y.Z

Step 4: Set Up a Basic Client

Create a new file named client_example.py with the following code:

Test Your Connection

Run this script to verify your connection to the PayLink server:

If successful, you should see a list of available payment tools printed to your console.

Step 5: Process a Payment

Process Your First Payment

Create a new file named process_payment.py with this code:

Run the Payment Example

python process_payment.py
ℹ️

In production, replace the example phone number with your customer’s actual phone number. M-Pesa will send a push notification to this number requesting payment confirmation.

Step 6: Check Payment Status

Verify Payment Completion

Create a file named check_status.py to verify the payment status:

Run the Status Check

python check_status.py

🎉 Next Steps

Now lets move on to how to view your tools in the PayLink dashboard:

  • View your tools in the PayLink dashboard