Android Native SDK


The PhonePe Android Native SDK (v5.3.0) enables you to integrate PhonePe’s saved payment instruments directly into your Android app’s checkout.

With the Android Native SDK, you can give your customers instant access to their saved UPI, Cards, UPI Lite, Wallet, from the PhonePe app. This makes the checkout journey fast, reliable, and convenient, helping you increase payment success rate (SR) and reduce drop-offs.

  • Step 1: Fetch and Display Payment Options: This is the initial setup when a user enters your checkout page.
    • When the user lands on the checkout page, your app must call your backend to request an SDK Token.
    • Your backend will then call two PhonePe APIs in sequence: first the Fetch Auth Token API for authorization, followed by the Init API to get the final SDK Token for User Accounts.
    • Your backend returns this token to your app.
    • Your app passes this token to the PhonePe SDK. Based on the SDK’s response, your app will render one of two options:
      • A “Link” button for new users.
      • A list of saved payment methods for returning users.
  • Step 2: Create an Order and Initiate Payment: This process begins after the user selects a payment method and decides to pay.
    • When the user clicks ‘Pay’, your app calls your backend to create a transaction order.
    • Your backend calls PhonePe’s Create Order API to create the order and receive an order token.
    • This order token is sent back to your app.
    • Your app triggers the PhonePe SDK to perform the final payment, passing the order token and the selected instrument details.
  • Step 3: Verify Payment Status: After the user completes the payment attempt, you must confirm the outcome.
    • Your backend needs to verify the final transaction status. You can do this in two ways:
      • Listen for the webhook: Receive an automated server-to-server update from PhonePe.
      • Use the Check Status API: To check the transaction status.
    • Based on the confirmed status, inform the user of the outcome (e.g., “Payment Successful”) within your app.

By integrating the PhonePe Android Native SDK, you can deliver a seamless checkout, provide faster payments, and improve overall customer experience.

The next section will guide you through the initial setup of the Android Native SDK. This is the first required step to begin the integration process.

Head over to the next section to learn how to securely setup the Android SDK.

Is this article helpful?