This API gives a merchant the PhonePe’s user details corresponding to an access token. This can be used to facilitate Single Sign-On in the merchant’s system as the user details have already been verified by PhonePe.
<html-block html=”
“>
Header Name | Header Value |
---|---|
Content-Type | application/json |
X-VERIFY | SHA256(“/v3/service/userdetails” + salt key) + ### + salt index |
X-CLIENT-ID | Unique MID(shared by Phonepe) needs to be sent as a parameter unless a different value is shared by PhonePe team.
In case of aggregator, please send AppuniqueID in the header |
<html-block html=”
“>
Parameter Name | Type | Description |
---|---|---|
success | BOOLEAN | Success status of the request |
code | ENUM | See list of response codes below |
data | Object | The data object that has to be passed to the sdk. |
<html-block html=”
“>
Code | Description |
---|---|
UNAUTHORIZED | The grantToken provided is either invalid or not mapped to the merchant. |
BAD_REQUEST | Invalid request payload |
AUTHORIZATION_FAILED | Incorrect X-VERIFY header |
INTERNAL_SERVER_ERROR | Something went wrong |
API_RATE_LIMIT_REACHED | If the API call limit is breached then HTTP status code 429 would be sent |
{“method”:”get”,”url”:”/v3/service/userdetails”,”auth”:”required”,”apiSetting”:”5da600be463ecf036287d7f3″,”examples”:{“codes”:[]},”results”:{“codes”:[{“name”:””,”code”:”{\n \”success\”: true,\n \”code\”: \”SUCCESS\”,\n \”data\”: {\n \”name\”: \”Anurag\”,\n \”phoneNumber\”: \”9888888888\”\n }\n}\n\nIncase of email is shared \n\n{\n \”success\”: true,\n \”code\”: \”SUCCESS\”,\n \”data\”: {\n \”name\”: \”Rohit Kumar\”,\n \”phoneNumber\”: \”9888888888\”,\n \”primaryEmail\”: \”test@gmail.com\”,\n \”isEmailVerified\”: true\n }\n}”,”language”:”json”,”status”:200},{“name”:””,”code”:”{}”,”language”:”json”,”status”:400}]},”params”:[{“name”:”X-VERIFY”,”type”:”string”,”enumValues”:””,”default”:””,”desc”:”SHA256(/v3/service/userdetails + salt key) + ### + salt index”,”required”:false,”in”:”header”,”ref”:””,”_id”:”5da61cec463ecf036287dbae”},{“name”:”Content-Type”,”type”:”string”,”enumValues”:””,”default”:”application/json”,”desc”:””,”required”:false,”in”:”header”,”ref”:””,”_id”:”5da61cec463ecf036287dbad”},{“name”:”X-CLIENT-ID”,”type”:”string”,”enumValues”:””,”default”:””,”desc”:”Unique MID(shared by Phonepe) needs to be send as a parameter”,”required”:false,”in”:”header”,”ref”:””,”_id”:”5da61cec463ecf036287dbac”},{“name”:”X-ACCESS-TOKEN”,”type”:”string”,”enumValues”:””,”default”:””,”desc”:”Token fetched from get auth token API”,”required”:false,”in”:”header”,”ref”:””,”_id”:”5da6b60711118800c3f22ec1″}]}
https://apps-uat.phonepe.com