This will depend on the type of error:

401 – Unauthorized error

This error occurs when authorization fails due to one of the following reasons:

  • An incorrect client secret is passed in the Auth API
  • An incorrect or expired token is included in the API header
  • There is a mismatch between the environment and the credentials (e.g., using UAT host with Production credentials or vice versa)

To fix this, please ensure that,

  • You are using the correct credentials shared by PhonePe Payment Gateway on your registered email ID
  • You are testing against the correct API host and endpoints that match your credentials (UAT or Production)
  • You are accurately entering the exact client secret in the Auth API or the token in the API headers. Any typos or mismatch will result in this error.

400 – Bad Request error

This error occurs for the following reasons:

  • An incorrect grant_type is passed in the Auth API request
  • A mandatory parameter is missing from the request
  • A blank order ID is passed in the request body of the Pay API
  • The API Host URL is incorrect

To fix this, please ensure that,

  • You have included all mandatory parameters as outlined in the developer documentation, and none of the values are left blank
  • The grant_type header is passed correctly
  • The API Host URL is accurate, as specified in the documentation

404 – Not Found

  • This error occurs when an incorrect client ID or client version is passed in the Auth API request.
  • To fix this, please ensure that you have correctly passed the Client ID and Client version in the request. Please verify these values and ensure they match the correct details in your system.

500-Internal Server Error

This error occurs for the following reasons,

  • Extra or incorrect values are sent in the API request
  • Blank data is passed in the request body

To fix this, please ensure that you have passed the correct payment instrument parameters with the correct paymentFlow type in the request body, as mentioned in the developer documentation and try again after some time.

If you’ve followed the above steps and continue to see any errors, please click Contact Us and share the following details with us,

  • API host used for triggering the API
  • Request payload used
  • Response payload received
  • Integration platform (Web/Android/iOS)
  • Screenshot or screen recording of the error

This error usually occurs due to issues with the payment source or request handling.

This means the error happens when there’s a problem with how the payment is being sent or where it’s coming from. It could be because the payment request isn’t from a trusted source or it’s not being processed correctly.

To avoid this error, please ensure the following:

  • Referrer Policy: Verify that the referrer policy for your webpage is set to “strict-origin-when-cross-origin”. This ensures secure and authenticated requests.
  • Initiate Payments from Whitelisted Domains Only: – Payments should be initiated from the whitelisted domain on our end – Avoid initiating payment requests from third-party platforms such as Postman or ThunderClient, then manually pasting the redirectUrl into a browser. This can lead to errors such as Internal Security Block or Transaction URL Mismatch, as our servers will not authenticate the payment source – Ensure the PAY API is called directly from your domain’s checkout page. Specifically, when the customer clicks the “PAY NOW” button, the request must originate from the registered and verified domain to ensure secure processing
  • Checkout Bundle Integration (Frontend SDK – iFrame): If the issue persists, we recommend integrating the PhonePe Checkout Bundle (Frontend SDK – iFrame) to avoid this error. For more details, please refer to the documentation for the PhonePe Checkout Bundle.
  • Mobile App Integration (if applicable): If you’ve integrated the PhonePe Payment Gateway via API in your mobile app, please note: – APIs are not supported for mobile app integration – To avoid payments from being blocked in Production, you must register your package name and Play Store/App Store URLs with PhonePe – It is mandatory to use the PhonePe Mobile SDK as PhonePe no longer supports the use of WebView within mobile apps

If you still need any assistance with this, please click Contact Us, and we’ll help you.

If you’re not receiving webhooks, it could be due to one of the following reasons:

  • Your webhook/callback URL is using http instead of https. We only support secure https URLs for posting responses
  • The webhook/callback URL you’re using might not be able to receive and capture the responses properly
  • The configured username and password may not be correctly set in the code to validate the Authorization header
  • The webhook URL should not include any port number or IP address. Make sure it uses a standard domain name

If you continue to see this error, please click Contact Us, and we’ll help you.