Get Access Token

This service gives a merchant the access token corresponding to a grant token. This token can be used to fetch the User details in the getUserDetails API

Request Headers

Header NameHeader Value
Content-Typeapplication/json
AuthorizationO-Bearer <merchant-auth-token>
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
Sample payload for Base64
{
	"grantToken":"GRTe098bd540176757ybbnhu879125ebec723741c5189f6a4e303f2b9d28d3e4d1289bd61dd"
}
Sample Request
{
  "request": "ewoJImdyYW50VG9rZW4iOiJHUlRlMDk4YmQ1NDAxNzY3NTd5YmJuaHU4NzkxMjVlYmVjNzIzNzQxYzUxODlmNmE0ZTMwM2YyYjlkMjhkM2U0ZDEyODliZDYxZGQiCn0="
}

Request Parameters

Parameter NameTypeDescriptionMandatory
grantTokenSTRINGUnique grantToken generated by the call to fetchAuthToken as mentioned in the last section fetchAuthToken ]Yes

Response Parameters

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

Response Codes

CodeDescription
UNAUTHORIZEDThe grantToken provided is either invalid or not mapped to the merchant.
BAD_REQUESTInvalid request payload
AUTHORIZATION_FAILEDIncorrect Authorization header
INTERNAL_SERVER_ERRORSomething went wrong
API_RATE_LIMIT_REACHEDIf the API call limit is breached then HTTP status code 429 would be sent
Is this article helpful?