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
Head
Attribute | Description |
---|---|
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
Attribute | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
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 +
| |||||||||||||
requestType Enum(RequestType) optional | Request type Possible values: PAYMENT, SUBSCRIPTION |
Response Attributes
Head
Attribute | Description |
---|---|
responseTimestamp string | EPOCH timestamp of the time at which response is being sent. Example: 1588402269 |
Body
Attribute | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|
resultInfo object | Result Info of API call | ||||||||
resultInfo +
| |||||||||
accessToken string | Access token for accessing the subsequent APIs |
Response Codes & Messages
resultCode | resultStatus | resultMsg |
---|---|---|
0000 | S | Success |
2222 | F | Invalid request body |
1001 | F | Request 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 |
1007 | F | Missing mandatory element |
501 | F | System Error |
2005 | F | Checksum provided is invalid |
324 | F | Duplicate reference Id |
2006 | F | Reference Id is invalid |
1011 | F | Parameter illegal |
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"}}}'