search
Your Paytm for business app is working and will keep working beyond March 15th, 2024. Click to know more

POSTFetch Cards for User API

Use Case

This API is used to fetch the list of saved cards along with card details such as Card Index, Last 4 digits, Expiry mapped etc. for a given user.

Request Attributes

Content Type : JSON

Head

AttributeDescription
version
string
mandatory

Version of the API.

Example: v1

requestId
string
mandatory

Unique reference ID which is given in request payload

requestTimestamp
string
mandatory

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

token
string
mandatory

Authorization string corresponding to the tokenType used.

Example: 739816707d7444XXXXXXXX6cb4264d0a1590145379323

tokenType
string
mandatory

This parameter identifies whether the API works on checksum authentication. The value to be sent in tokenType is 'JWT' for this API.

Body

AttributeDescription
mid
string
mandatory

Paytm provides MID as a unique identifier to each merchant. For your staging MID, click here. You get the production MID post the account activation.

Example: INTEGR7769XXXXXX9383

custId
string
mandatory

Unique user ID maintained by the merchant 

includeExpired
boolean
optional

Select if you want to fetch the user's expired cards or not. The default value is false.

Response Attributes

Content Type : JSON

Head

AttributeDescription
version
string

Version of the API passed in the request.
Example: v1

responseTimeStamp
string

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

Body

AttributeDescription
resultInfo
string

This parameter gives the information about the result of the API response

ResultInfo
+
AttributeDescription
resultCode
string

This is the resultCode corresponding to a particular message and is returned to the merchant. It's maximum length is 64. The different result codes corresponding to this API are mentioned below.

resultStatus
string

This parameter indicates the status of API call.

Possible values:
S
For Success
,
F
For Failure
resultMsg
string

This parameter is the result message which contains information about the result. The different result messages corresponding to this API are mentioned below in section " Response Codes and Messages".

cardInfos
object

List of assets.

It could be empty if no saved card is present.

CardInfos
+
AttributeDescription
cardIndexNumber
string

Unique Card Index Number of a card generated by Paytm.

mcin
string

Unique Reference ID of a card maintained by the merchant/Paytm.

firstSixDigit
string

First six digits of saved card

lastFourDigit
string

Last six digit of saved card

expiryMonth
string

Card Expiry Month

Format: MM, Example: 01, 02 ,12

expiryYear
string

Card Expiry Year

Format: YYYY

customerName
object

Name of the customer

CustomerName
+
AttributeDescription
firstName
string

First name of the customer

lastName
string

Last name of the customer

cardType
string

Saved instruments type

Possible Values: CREDIT_CARD, DEBIT_CARD

issuerDisplayName
string

Name of the bank issuing the card

issuerCode
string

Code of the bank issuing the card

cardScheme
string

The central payment method used by the saved card to process payment.

Possible Values: VISA, MASTER, MAESTRO

Payload for JWT Token

{
    "mid": "{mid}",
    "custId": "CUST_001",
    "requestId": "1234",
    "iat": {current-unix-epoch-time}
}

Error Codes and Messages

ErrorCode ErrorStatus ErrorMsg
0000 S Success
4001 F Card doesn't exist for given parameters
4002 F MID doesn't exist
4003 F JWT Token is invalid
4004 F Request Parameters are not valid
4005 F Mandatory Parameters missing
4006 F Update on card not supported
4007 F Card Decryption failed
4008 F Internal Server error
4009 F Card already exists
4100 F Either mcin or cin should be passed.
4101 F System error
4102 F Mid/RequestId in the query param doesn't match with the Mid/RequestId send in the request.
00000900 U Unknown Error
⇾
Staging
Production
https://securegw-stage.paytm.in/savedcardservice/vault/cards/fetchCardByMidCustId?mid={mid}&requestId=1234copy icon
REQUEST
RESPONSE
CURL
curl--location--request POST 'https://securegw-stage.paytm.in/savedcardservice/vault/cards/fetchCardByMidCustId?mid={mid}&requestId=1234'\
    --header 'Content-Type: application/json'\
    --data - raw ' {
        "head": {"version": "v1","requestTimestamp": "1627366851000","requestId": "1234","tokenType": "JWT","token": "eyJhbGciOiJIUzIXXXXXXXXXXXXXXXXXXXSmOx_IANNcebRg7c"},
        "body": {"custId": "CUST_001","mid": "{mid}","includeExpired": true}}'
copy icon