search

POSTAccess Token Creation API

Use Case

This API is used to obtain the security token named as Access token which can be further used in subsequent API calls to retrieve the read-only data.

Request Attributes

Content Type : JSON

Head

AttributeDescription
requestTimestamp
string
optional

EPOCH timestamp of the time at which the request is being sent.

 

Example: 1588402269

token
string
mandatory

Authorization string corresponding to the tokenType used.
 

Example: 739816707d7444XXXXXXXX6cb4264d0a1590145379323

tokenType
enum(TokenType)
mandatory

Authorization method for this request.

 

Possible values: CHECKSUM

Body

AttributeDescription
mid
string
mandatory

Paytm provides MID as a unique identifier for each merchant.

referenceId
string
mandatory

This is the unique reference id.
 

Example: AOA1011AOA1012

userInfo
object
optional

User information

UserInfo
+
AttributeDescription
custId
string
mandatory

Unique reference ID for every customer which is generated by merchant. Special characters allowed in CustId are @, ! ,=,_ ,$, .
Example: CUST_001

mobile
string
conditional

10-digit mobile number of user.
Example: 9988000000

Mandatory, in case merchant wants to give Debit Card EMI as a payment option to its users.

email
string
optional

Valid email of the user.

Example: vaibhav41094@gmail.com

firstName
string
optional

First name of the user

lastName
string
optional

Last name of the user.

requestType
Enum(RequestType)
optional

Request type

 

Possible values: PAYMENT, SUBSCRIPTION

Response Attributes

Content Type : JSON

Head

AttributeDescription
responseTimestamp
string

EPOCH timestamp of the time at which response is being sent. 
 

Example: 1588402269

Body

AttributeDescription
resultInfo
object

Result Info of API call

resultInfo
+
AttributeDescription
resultStatus
string

This parameter is the result specific to the phase of the transaction mentioned in the txnType field

resultCode
string

This is the resultCode corresponding to a particular message and is returned to the merchant. It's maximum length is 64.

resultMsg
string

This parameter is the result message which contains information about the result.

accessToken
string

Access token for accessing the subsequent APIs

Response Codes & Messages

resultCoderesultStatusresultMsg
0000SSuccess
2222FInvalid request body
1001FRequest parameters are not valid Note: If the value is not valid in the request parameter then the result message should be in the format of "Invalid {field name}" For example:Invalid tokenType, etc
1007FMissing mandatory element
501FSystem Error
2005FChecksum provided is invalid
324FDuplicate reference Id
2006FReference Id is invalid
1011FParameter illegal
⇾
Staging
Production
https://stage-router.paytm.in/aoa-pay-option-service/v2/createAccessToken?mid={{mid}}&referenceId={{referenceId}}copy icon
REQUEST
RESPONSE
CURL
JAVA
NODE
PHP
PYTHON
DOTNET
curl--location--requestPOST'https://stage-router.paytm.in/aoa-pay-option-service/v2/createAccessToken?mid=YOUR_MID_HERE&referenceId=shub2721shub2720'\--header'Content-Type: application/json'\--data-raw'
{"head": {"requestTimestamp": "2023-01-09T10:43:20+05:30","token": "shubhamtest","tokenType": "CHECKSUM"},"body": {"mid": "YOUR_MID_HERE","requestType": "PAYMENT","referenceId": "shub2721shub2720","userInfo": {"custId": "cus123","mobile": "7000000003","email": "abc@gmail.com","firstName": "shubham","lastName": "gaur"}}}' 

 

copy icon