Get User Details

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=”

Request Headers

“>

Header NameHeader Value
Content-Typeapplication/json
X-VERIFYSHA256(“/v3/service/userdetails” + salt key) + ### + salt index
X-CLIENT-IDUnique 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=”

Response Parameters

“>

Parameter NameTypeDescription
successBOOLEANSuccess status of the request
codeENUMSee list of response codes below
dataObjectThe data object that has to be passed to the sdk.

<html-block html=”

Response Codes

“>

CodeDescription
UNAUTHORIZEDThe grantToken provided is either invalid or not mapped to the merchant.
BAD_REQUESTInvalid request payload
AUTHORIZATION_FAILEDIncorrect X-VERIFY header
INTERNAL_SERVER_ERRORSomething went wrong
API_RATE_LIMIT_REACHEDIf 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\”: \”[email protected]\”,\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