Get User Cards API - Model 3

The Get User Cards API is used to fetch all the cards corresponding to the user. In this API, the card number and other sensitive information are not returned.

HTTP Method: POST

Sample request
  curl --request POST \
       --url 'https://test.payu.in/merchant/postservice.php?form=2' \
       --header 'Content-Type: application/x-www-form-urlencoded' \
       --header 'accept: text/html; charset=UTF-8' \
       --data key=JPM7Fg \
       --data command=get_payment_instrument \
       --data var1=JPM7Fg:abc \
       --data hash=750351ed44241b9739d2e374de45dd0be3c2f6d68305ceb81084960387b71722b0f8d224900f57202488a557ecfa6f2e22895f27585a413388684a142bb8e41e
Sample response
  {
    "status": 1,
    "msg": "Cards fetched Succesfully",
    "user_cards": {
      "a52aa1c09e11ac56926005": {
        "one_click_status": "",
        "one_click_flow": "",
        "card_type": "CC",
        "expiry_year": "2030",
        "network_token": {
          "token_bin": "439040",
          "is_expired": "0",
          "token_exp_yr": "2030",
          "token_exp_mon": "11",
          "token_value": "4390406210204342"
        },
        "expiry_month": "11",
        "is_expired": "0",
        "card_mode": "CC",
        "card_no": "XXXXXXXXXXXX6937",
        "one_click_card_alias": "",
        "card_token": "a52aa1c09e11ac56926005",
        "card_name": "raghu_visa",
        "name_on_card": "DUMMY",
        "card_brand": "VISA",
        "card_bin": "439040621",
        "isDomestic": "Y",
        "card_cvv": 0,
        "PAR": "V0010013022320257414953977387"
      }
    }
  }
Response parameters
FieldDescriptionExample
statusThe status of the response. Can be:
1: Success
0: Failure
1
msgThe description of the response indicating whether cards were fetched successfully or not.Cards fetched Succesfully
user_cardsA JSON object containing all saved cards for the user. Each card is identified by its unique card token as the key. For more details, refer to Card JSON object field descriptionRefer to Card JSON object field description

Card JSON object field description

FieldDescriptionExample
one_click_statusStatus for one-click payment feature.""
one_click_flowFlow type for one-click payment processing.""
card_typeThe type of the card. Can be:
CC: Credit Card
DC: Debit Card
CC
expiry_yearThe expiry year of the card.2030
expiry_monthThe expiry month of the card.11
is_expiredIndicates whether the card has expired:
0: Card is active
1: Card has expired
0
card_modeThe payment mode of the card (CC for Credit Card, DC for Debit Card).CC
card_noThe masked card number showing only the last four digits for security.XXXXXXXXXXXX6937
one_click_card_aliasAlias name for the card used in one-click payments.""
card_tokenThe unique PayU token assigned to this saved card.a52aa1c09e11ac56926005
card_nameThe name/label assigned to the saved card by the user.raghu_visa
name_on_cardThe cardholder's name as it appears on the card.DUMMY
card_brandThe brand/network of the card (VISA, MASTERCARD, AMEX, etc.).VISA
card_binThe Bank Identification Number (first 6-9 digits) of the card.439040621
isDomesticIndicates whether the card is domestic or international:
Y: Domestic card
N: International card
Y
card_cvvIndicates whether CVV is required for transactions:
0: CVV not required
1: CVV required
0
PARPayment Account Reference - a unique identifier for the card across all tokens, used for offers and risk checks.V0010013022320257414953977387
network_tokenA JSON object containing network token details for secure payments. For more information, refer to Network token JSON object field descriptionRefer to Network token JSON object field description

Network token JSON object fields description

FieldDescriptionExample
token_binThe Bank Identification Number for the network token.439040
is_expiredIndicates whether the network token has expired:
0: Token is active
1: Token has expired
0
token_exp_yrThe expiry year of the network token.2030
token_exp_monThe expiry month of the network token.11
token_valueThe actual network token value used for secure transactions.4390406210204342

Request parameters

Reference info for request parameters
Language
URL
Click Try It! to start a request and see the response here!