Getting Started
The PhonePe Technology Service Provider (TSP) model allows partners to integrate a full payment gateway once and instantly extend it to all their downstream merchants. Instead of every individual merchant building their own secure server-to-server connection, the partner handles the technical integration, and merchants simply transact under that umbrella.
One Integration, Many Merchants.
Every payment routes through your authenticated connection. Stamp each API request with X-MERCHANT-ID to route funds perfectly. exactly which sub-merchant the funds belong to.

Essential logistics to set up your partner account and onboard sub-merchants.
Partner Account Setup
PhonePe provisions the partner with three credentials: a client_id, client_version, and a client_secret. Use these to generate a short-lived access token that authenticates all API calls.
https://api-preprod.phonepe.com/apis/pg-sandbox/<Endpoint>📘 To ensure a smooth integration, please integrate with the Test environment first and then move to production.
https://api.phonepe.com/apis/identity-manager/<Endpoint>https://api.phonepe.com/apis/pg/<Endpoint>⚠️ The Go-Live Gate!
Production credentials are never issued immediately. You must build against the sandbox and pass UAT. Once PhonePe verifies mandatory use cases, production access is granted.
Sub-Merchant Requirements
Once live, adding new merchants does not require repeating integration. The sub-merchant is issued a PhonePe MID and must meet one technical prerequisite:
| Channel | Technical Prerequisite |
|---|---|
| 🌐 Web | A unique domain name (e.g., abc.store.com) |
| 📱 App (iOS/Android) | A unique package name (Android) or bundle identifier (iOS) |
API Execution Mechanics
Processing transactions requires passing two critical headers on every API request:
Authorization: O-Bearer <token>
Validates the TSP’s access token, proving the request is coming from your trusted, authenticated partner platform.
X-MERCHANT-ID: <mid>
Passes the specific sub-merchant’s PhonePe MID, telling PhonePe exactly whose account the transaction and funds belong to.