Validate OTP API

Use Case


This API is used to get the access token by validating the OTP of the user


Request Attributes

API Content format: JSON

Header:

ParameterDescriptionRequiredExample Value
AuthorizationThis is a base64 encoded string of “clientId:clientSecret”NoBasic dGVzdGNsaWVudDplODY3MDlkOS1iMjM4LTQ4MjMtODVkYi05zZhMTY5YjMyNTg=

Body:

ParameterDescriptionRequiredExample Value
Otpotp sent to userYes123456
StateState guid returned in the “send otp” needs to be passed hereYes65cb6680-29f6-11e4-aad2-3c970ea8b87f

Response Attributes

API Content format: JSON

Success:

ParameterDescriptionExample Value
access_tokenaccess token for the user to be used in all further calls003d34901c47-3217-4e92-a291-5ef84a00de1e
ExpiresUNIX expiry time of token1429175369162
ScopeName of the resource for which token is requiredWallet
resourceOwnerIdcustomer id of Paytm123456

Error:

ParameterDescriptionExample Value
StatusResponse statusFAILURE
responseCodeResponse code434
MessageError reason"Bad Request"

Error Codes

430Invalid Authorization
434Bad Request
403Invalid OTP
513Invalid Code
432Login Failed

Endpoints

Testing: https://accounts-uat.paytm.com/signin/validate/otp

Production: https://accounts.paytm.com/signin/validate/otp

Request CodeResponse JSON
curl -X POST 'https://accounts-uat.paytm.com/signin/validate/otp' -H 'Content-Type: application/json' -H 'Authorization: Basic xxxxxxxxxxxxxxxxxxxxxx' -d '{"state":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx","otp":"xxxxxx"}'