Introduction to Autopay Python SDK
The PhonePe Python SDK(v 2.1.5) for Autopay simplifies server-side integration with the PhonePe Payment Gateway for recurring payments. It offers a simple, secure, and efficient way to manage autopay transactions, allowing you to focus on delivering seamless and engaging user experiences.
User Journey
The following user journey illustrates the complete payment lifecycle to help you understand the integration flow clearly.

Prerequisites
Before you start the integration process, ensure you have:
- Access to PhonePe PG’s UAT (User Acceptance Testing) and production environments.
- A testing environment to simulate the payment flow.
- Python 3.9 or higher installed on your system.
Install Python SDK
pip install --index-url https://phonepe.mycloudrepo.io/public/repositories/phonepe-pg-sdk-python --extra-index-url https://pypi.org/simple phonepe_sdkTest Credentials
To get started with the integration, you’ll need three essential details: the API key, merchant ID, and secret key. Reach out to the Integration team to obtain these credentials for testing.
String clientId = "<clientId>";
String clientSecret = "<clientSecret>";
Integer clientVersion = "<clientVersion>"; What’s Next ?
The introduction has provided you with a broad overview of setting up the Python SDK. Now, let’s move forward with Class Initialisation to begin integrating the SDK into your application.
Head over to Class Initialisation, the first step to begin the integration process.