TSP Integration
TSP integration enables authorized partners to initiate and manage transactions on behalf of merchants using PhonePe’s APIs. As a TSP, you are required to generate an authentication token and include specific headers in all API requests to ensure secure and seamless communication between your backend and PhonePe.
This guide outlines the steps to fetch the authorization token, the required HTTP headers for various APIs (including initiate payment, refund, and order status), and sample configurations for Android, iOS, and Web platforms. It also includes details on managing webhook configurations to help TSPs complete end-to-end integration efficiently.
To ensure successful communication with PhonePe APIs, TSPs are required to include the following headers in each request.
Environments
Use the environment URLs below to integrate and test your API calls. The Sandbox environment is intended for testing and validation, while the Production environment should be used once your integration is live. Make sure to switch the base URL based on the environment you are working in.
| Environment | API |
Sandbox | https://api-preprod.phonepe.com/apis/pg-sandbox/<Endpoint> |
Production | Authorization API: https://api.phonepe.com/apis/identity-manager/<Endpoint> Other APIs: https://api.phonepe.com/apis/pg/<Endpoint> |
📘 Test Before Production!
To ensure a smooth integration, please integrate with the Test environment first and then move to production.
API Endpoints
| API | Method | Endpoint |
| Authorization | POST | /v1/oauth/token |
| Fetch Webhook Events | GET | /configs/v1/webhooks/events |
| Create Webhook | POST | /configs/v1/webhooks |
| Update Webhook | PUT | /configs/v1/webhooks/{webhookId} |
| List Webhook | GET | /configs/v1/webhooks?limit=10&offset=0 |
| Delete Webhook | DELETE | /configs/v1/webhooks/{webhookId} |