Integration Steps
To process a payment using PhonePe Custom Checkout, follow a clear set of steps that ensure reliability, and a smooth user journey. The flow begins with generating a payment request, creating an authentication token, and redirecting the customer to complete the payment. After the payment is done, the response is verified and the status is confirmed, which helps in accurate order processing and tracking.
1. Generate Authorization Token
Start by generating an authorization token. This token securely confirms your system’s identity and is needed for all API requests such as initiating payments, checking status, or processing refunds.
Refer to the Generate Token section for more details.
2. Initiate Payment
Custom Checkout allows merchants to accept payments through various instruments. You can integrate UPI Intent, UPI Collect, UPI QR, Cards, Tokenized Cards, and NetBanking into your checkout flow. This ensures a secure and user-friendly payment experience.
Refer to the Initiate Payment section for more details.
3. Verifying Payment Response
Once the payment is initiated, it is important to check if it was successful, failed, or still pending. This helps your system decide the next action, such as confirming an order or retrying the payment.
How to verify the response?
There are two ways to check the payment status:
- Webhook (Server to Server Callback) – Recommended
PhonePe sends an automatic update to your server when there is a change in the payment status, such as success or failure. This ensures instant updates. - Check Status API
If you do not receive the webhook for any reason, you can use the status API to manually check the payment outcome.
Note: Always use the webhook callback as the primary method. Use the status API only as a backup.
What’s Next ?
In the next section, you will learn about the first step in the Custom Checkout flow which is Authorization. This step is important as it helps you generate the authentication token required to access and use other APIs throughout the integration.