PhonePe Payment Gateway: How to Apply and Integrate PhonePe PG on Your Website or App
Onboard as a PhonePe Payment Gateway merchant, complete KYC, then integrate Standard Checkout: authorisation, creating a payment, redirecting the customer, checking order status and handling callbacks.

Table of contents
PhonePe PG vs PhonePe for Business QR
PhonePe offers two different things. The PhonePe for Business QR and soundbox serve in-store payments. The PhonePe Payment Gateway (PG) is for websites and apps: it accepts UPI (including the PhonePe app), cards, net banking and wallets through an online checkout. This guide covers the payment gateway.

Onboarding steps

- 1
Sign up: register on the PhonePe Business portal as an online merchant.
- 2
Business details: business type, category, website or app URL and expected volume.
- 3
KYC documents: PAN, business proof (GST or other registration), bank account details and signatory KYC.
- 4
Website review: as with other gateways, your site needs product details with prices and the standard policy pages.
- 5
Get credentials: once approved, the dashboard provides test (UAT) and production credentials for API integration.
Tip: Start integration in the UAT/sandbox environment while your KYC is under review, so you are ready to go live the day you are approved.
How the Standard Checkout flow works
PhonePe’s current Standard Checkout API uses OAuth-style authorisation. Your server exchanges its client credentials for an access token, creates a payment for an order, and redirects the customer to PhonePe’s hosted checkout. Older integrations used a salt key and an X-VERIFY checksum header; if you maintain one of those, follow the documentation version your credentials were issued for.
- 1
Get an access token: call the authorisation endpoint with your client ID, client secret and client version; cache the token until it expires.
- 2
Create a payment: send a unique merchantOrderId, the amount in paise and a redirect URL.
- 3
Redirect the customer: send them to the checkout URL returned by PhonePe.
- 4
Check order status: when the customer returns, call the order status API from your server — do not rely on the redirect alone.
- 5
Handle callbacks: configure a webhook so your server is notified of completed or failed payments, and verify it as the documentation describes.
- 6
Refunds: initiate refunds via the refund API with a unique refund ID and track their status.
const token = await getPhonePeToken() // cached until expiry
const payment = await phonepe.createPayment(token, {
merchantOrderId: "ORD-" + order.id, // unique per attempt
amount: order.totalRupees * 100, // paise
redirectUrl: "https://example.com/pay/return?order=" + order.id,
})
res.redirect(payment.redirectUrl)
// on return or webhook:
const status = await phonepe.getOrderStatus(token, "ORD-" + order.id)
if (status.state === "COMPLETED") markOrderPaid(order.id)Mobile apps: SDK integration
For Android, iOS, React Native and Flutter apps, PhonePe provides SDKs that open the payment flow inside your app and can hand off to UPI apps installed on the phone. The server-side steps stay the same: create the payment on your backend, pass the token or order details to the SDK, then confirm status from your server.
Best practices
- Pending states: UPI payments can be pending for a short while; poll status with back-off rather than failing immediately.
- Unique IDs: never reuse a merchantOrderId for a retry; create a new attempt ID linked to the same order.
- Secrets on the server: client secret and tokens must never be shipped inside the app or website code.
- Logging: store request and response IDs for every attempt to make reconciliation and support easy.
Topics
Umer Hasan
Co-Founder & CTO at Zapprex
Leads engineering, cloud infrastructure and AI automation at Zapprex Technologies, with 7+ years of full-stack and mobile experience.
Keep reading
All articlesHow to Apply for Razorpay Payment Gateway: Documents, KYC Approval and Integration Tutorial
Step-by-step: create a Razorpay account, prepare KYC documents and website policies, get activated, then integrate Orders API, Checkout and signature verification with webhooks — with working code.
How to Get CCAvenue Payment Gateway: Application, Documents and Integration Steps
A complete walkthrough of CCAvenue onboarding — documents, website requirements and approval — followed by how the encrypted request/response integration works with Merchant ID, Access Code and Working Key.
LSP Partnership Explained: How to Become a Lending Service Provider With a Bank or NBFC in India
What a Lending Service Provider (LSP) is under RBI’s digital lending rules, how LSP–NBFC partnerships work, the compliance you must build into your app, and the technology stack for a compliant lending platform.
Questions readers ask
Yes. Besides UPI, PhonePe PG supports cards, net banking and wallets, subject to the payment modes enabled on your merchant account.
No. Customers can pay with any UPI app or other supported methods; the PhonePe app is one of the options.
Yes. PhonePe provides SDKs for major mobile platforms, with your backend creating the payment and verifying the final status.
Have a project in mind?
Let's build something that moves your business forward.
Share your idea, process or problem — we will come back with a clear plan, timeline and cost range. No technical spec needed.
- Founder reply within 1 business day
- NDA on request · 100% code ownership
- Talk directly to the engineers
