Introduction

iOS Native SDK is a powerful SDK designed to facilitate the seamless integration of payment instruments saved on users’ PhonePe app.

  • With iOS Native SDK, businesses can effortlessly access and utilise the user’s saved payment methods like UPI accounts and Cards through their own checkout, making the checkout process smooth and convenient for users.
  • This will help in enhancing overall user experience and will also help in improving SR.

Sequence Diagram

Summary

  • User lands on the checkout page on the merchant app.
  • Merchant app will call the merchant backend to get the `SDK Token for User Accounts`.
    • Merchant backend will call PhonePe’s Fetch Auth Token API (Authorization) to get an auth token.
    • Merchant backend will call PhonePe’s Init API (Saved Instruments Token API) to get the `SDK Token for User Accounts`.
    • Merchant backend will return this response to the merchant app.
  • Merchant app will pass this SDK Token to the PhonePe SDK and get the User Instruments or consent intent to render on the checkout screen. Based on response from the SDK.
    • Merchant app will render a “Link” button in case of fresh user OR
    • Merchant app will render list of saved instruments
  • Once the user selects a payment option and clicks ‘Pay’, the merchant app will call the merchant backend to create an order.
    • Merchant backend will call PhonePe’s Create Order API to create an order and get an order token.
    • Merchant backend will return this response to the merchant app.
  • Merchant app will trigger the SDK to perform the final payment (details below) – if the user selected a saved instrument, merchant app must pass this information to the SDK.
    • Merchant backend can check for webhook response and/or use PhonePe’s Check Status API (integration details below) to inform the transaction status to the user on the merchant app.