Get User Cards API

Use the v2 Get User Cards API to get the card details of a customer.

📘

Note

While PayU token is sent in payment response, the network/issuer token creation may fail. In this case, the subsequent transaction with the said PayU token may fail. Merchant can do a get_user_cards API to fetch only active/tokenized cards or listen to notification API (to be published) to maintain state at your end.

The Get User Cards API is used to fetch all the cards for a customer which were saved earlier. In this API, the card number and other sensitive information are not returned.

HTTP Method: POST

Query parameter

Parameter Description Example
userCredential
mandatory
String User authentication credential in the format username:userid. testuser:testuser123
getSoftDeleted
optional
Integer Flag to include soft-deleted records in the response. Set to 1 to include, 0 to exclude. 1

Request header

Parameter

Description

mid mandatory

Merchant ID provided by PayU. Use the value provided in your PayU dashboard.

Sample request

curl --location '<info.storecard.service.url>/storecard/instrument/v1?testuser%3Atestuser123&getSoftDeleted=1' \
--header 'mid: 2'

Sample response

{
    "message": "Success",
    "status": 1,
    "result": {
        "user_cards": {
            "a4270b1fc031d38079e": {
                "cardNo": "XXXXXXXXXXXX1258",
                "cardMode": "CC",
                "par": "V0010013021320427651459792018",
                "oneClickStatus": "",
                "oneClickCardAlias": "",
                "cardToken": "a4270b1fc031d38079e",
                "oneClickFlow": "",
                "cardName": "testAll",
                "nameOnCard": "DUMMY",
                "cardType": "CC",
                "isExpired": false,
                "cardExpiryMonth": 5,
                "cardExpiryYear": 2037,
                "networkToken": {
                    "tokenValue": "4489682380100740",
                    "isExpired": false,
                    "tokenExpiryMonth": 5,
                    "tokenExpiryYear": 2037,
                    "tokenBin": "448968"
                },
                "cardCVV": "0",
                "isDomestic": "Y",
                "cardBin": "448968",
                "cardBrand": "VISA"
            },
            "7ffe8ef0e2667aac3b8": {
                "cardNo": "XXXXXXXXXXXX1258",
                "cardMode": "CC",
                "par": "V0010013021320427651459792018",
                "oneClickStatus": "",
                "oneClickCardAlias": "",
                "cardToken": "7ffe8ef0e2667aac3b8",
                "oneClickFlow": "",
                "cardName": "testAll",
                "nameOnCard": "DUMMY",
                "cardType": "CC",
                "isExpired": false,
                "cardExpiryMonth": 5,
                "cardExpiryYear": 2037,
                "networkToken": {
                    "tokenValue": "4489682380100740",
                    "isExpired": false,
                    "tokenExpiryMonth": 5,
                    "tokenExpiryYear": 2037,
                    "tokenBin": "448968"
                },
                "cardCVV": "0",
                "isDomestic": "Y",
                "cardBin": "448968",
                "cardBrand": "VISA"
            },
            "cde4561f038e60f488": {
                "cardNo": "XXXXXXXXXXXX1258",
                "cardMode": "CC",
                "par": "V0010013021320427651459792018",
                "oneClickStatus": "",
                "oneClickCardAlias": "",
                "cardToken": "cde4561f038e60f488",
                "oneClickFlow": "",
                "cardName": "testAll",
                "nameOnCard": "DUMMY",
                "cardType": "CC",
                "isExpired": false,
                "cardExpiryMonth": 5,
                "cardExpiryYear": 2037,
                "networkToken": {
                    "tokenValue": "4489682380100740",
                    "isExpired": false,
                    "tokenExpiryMonth": 5,
                    "tokenExpiryYear": 2037,
                    "tokenBin": "448968"
                },
                "cardCVV": "0",
                "isDomestic": "Y",
                "cardBin": "448968",
                "cardBrand": "VISA"
            },
            "2f4537bbb66c15b1ca88": {
                "cardNo": "XXXXXXXXXXXX1258",
                "cardMode": "CC",
                "par": "V0010013021320427651459792018",
                "oneClickStatus": "",
                "oneClickCardAlias": "",
                "cardToken": "2f4537bbb66c15b1ca88",
                "oneClickFlow": "",
                "cardName": "testAll",
                "nameOnCard": "DUMMY",
                "cardType": "CC",
                "isExpired": false,
                "cardExpiryMonth": 5,
                "cardExpiryYear": 2037,
                "networkToken": {
                    "tokenValue": "4489682380100740",
                    "isExpired": false,
                    "tokenExpiryMonth": 5,
                    "tokenExpiryYear": 2037,
                    "tokenBin": "448968"
                },
                "cardCVV": "0",
                "isDomestic": "Y",
                "cardBin": "448968",
                "cardBrand": "VISA"
            },
            "2f5543d4fc7f23063df1": {
                "cardNo": "XXXXXXXXXXXX1258",
                "cardMode": "CC",
                "par": "V0010013021320427651459792018",
                "oneClickStatus": "",
                "oneClickCardAlias": "",
                "cardToken": "2f5543d4fc7f23063df1",
                "oneClickFlow": "",
                "cardName": "testAll",
                "nameOnCard": "DUMMY",
                "cardType": "CC",
                "isExpired": false,
                "cardExpiryMonth": 5,
                "cardExpiryYear": 2037,
                "networkToken": {
                    "tokenValue": "4489682380100740",
                    "isExpired": false,
                    "tokenExpiryMonth": 5,
                    "tokenExpiryYear": 2037,
                    "tokenBin": "448968"
                },
                "cardCVV": "0",
                "isDomestic": "Y",
                "cardBin": "448968",
                "cardBrand": "VISA"
            }
        },
        "user_instruments": {
            "testuser_instrument_token_999": {
                "friendlyName": "Test User Wallet",
                "nickName": "TestWalletUser"
            }
        }
    }
}

Response parameters

FieldDescriptionExample
statusStatus indicator: 1 for success, 0 for failure.1
msgHuman-readable response message indicating if card fetching was successful.Cards fetched Successfully
user_cardsContains saved card details for the user, with unique card tokens as object keys.

User Cards Object

FieldDescriptionExample
card_typeType of card: either CC (Credit Card) or DC (Debit Card).CC
expiry_yearExpiry year of the card.2030
expiry_monthExpiry month of the card.11
is_expiredShows whether the card has expired or not: 0 for active, 1 for expired.0
card_modeEither CC (Credit Card) or DC (Debit Card).CC
card_noMasked card number showing only the last four digits.XXXXXXXXXXXX6937
card_nameUser-defined name for the card.raghu_visa
name_on_cardCardholder name.DUMMY
card_brandNetwork or brand name for the card (e.g., VISA, MASTERCARD).VISA
card_binBank Identification Number of the card (first 6-9 digits).439040
isDomesticIndicates if the card is domestic or international: Y for domestic, N for international.Y
card_cvvIndicates if the CVV is required: 0 for Not Required, 1 for Required.0
PARPayment Account Reference – unique identifier for the card across environments for transaction checks.V0010013022526170404000072387
network_tokenContains network token details for secure transactions. For more information, refer to Network token object.For more information, refer to Network token object .

Network token object

FieldDescriptionExample
token_binBank Identification Number for the network token.439040
is_expiredIndicates the token's status: 0 for active, 1 for expired.0
token_exp_yrExpiry year of the network token.2030
token_exp_monExpiry month of the network token.11
token_valueThe actual token value used for secure transactions.4390406210204342