Fetch Saved Instruments Token API
Your backend must call this API to fetch the SDK Token for User Accounts. This token should be passed to the PhonePe SDK to retrieve the customer’s saved payment instruments.
Environment
| Environment | Http Method | API |
|---|---|---|
Sandbox | POST | https://api-preprod.phonepe.com/apis/pg-sandbox/payments/v2/sdk/init |
Production | POST | https://api.phonepe.com/apis/pg/payments/v2/sdk/init |
Request
Request Headers
| Header Name | Header Value | Description |
|---|---|---|
Content-Type | application/json | |
Authorization | O-Bearer <access_token> | Pass access_token received in Authorization call |
Request Parameters
| Parameter Name | Type | Description |
|---|---|---|
amount | Long | Transaction amount in paise, minimum value Rs.1 (100 Paise) |
ℹ️ This behaviour is only applicable in UAT for testing purposes!
- If the amount passed in the Fetch User Instruments Token API is Rs.100 (10000 in Paise) or less, the response will include FlashPe along with UPI Accounts.
- If the amount passed is greater than Rs.100 (10000 in Paise), the response will include only UPI Accounts.
Sample Request
{
"amount": 100
}Response
Sample Response
{
"token": "hq5wOGdzX31IuPyyh7/7AYOLiipO42P8QtgmusudZHta7zUAMbV5uMV5f6kF1hmvherMrKRViCFFSkJeROPrbwBFuyTcAcvnhzQNvlAjmSUSDKisZaVOZjB05cBLh4dWE8JIg/xHk7i+8kBbH02itkwCv66GPKAh9ztkocuJhU4WIJEfkXgKYOKx4e1QOCpyu3+iRyrDG/JFnkkoM2vrdEhA+H5C2ANWu+zoRZ2O1OvUfSaGreca0Uc0MljHAeHUOE11XvEjrlohgL/S5hGwI3rCOh8F4Yu23OBfDyuPBUlyTvLzN50OHpq7oZRHZXGayUSKZACsSfm8qk/AlFV9fSuLZ2pTj55EMqWM4NJBsCTTP4ojn7AksD7EpmXTe+G6QqchVeKgAPZ1cq1No8bRdxwrQv9e0i5g/JNJllbAN9GibLP55iZr9Vzc7+7yi9I3I2RXat32moiXGo+g38+85KFvc7j/R8iK867cucl+zOrwn6pWGiUq9G8MIdoDXD9/eUfE90Awc6tFFsMJAfUg30aqWtd3lOW6zXM=",
"expireAt": 1721203754311
}Response Parameters
| Parameter Name | Type | Description |
|---|---|---|
token | String | Pass this SDK Token for User Accounts to the PhonePe SDK via the merchant app. |
expireAt | Long | Expiry date in epoch |
What’s next?
In the next section, you will learn how to Initialise the PhonePe User Account and get the user account.
Head over to next section to initialise and get the User Account