Additional Info for Save Cards APIs

Response parameters for Save a Card API

The following table describes the parameters in the response:

Note: For every successful payment transactions, PayU returns the mihpayuid and cardToken parameters to the merchants, but networkToken and issuer_token are returned only if you are PCI-DSS compliant.

Parameter

Description

Example

status

The status of the response can be any of the following:

  • 1: Success

  • 0: Failure

1

msg

The description of the response whether the card details were stored successfully or not stored.

Card Stored Successfully.

cardToken

The cardToken is sent by PayU for the successful response.

74\*\*\*2e2fd9b7e\*\*\*24fef4e7ed7dac1fe624b7

network_token

The network token is returned in this parameter.

1234 5*** 9*** 3456

issuer_token

The parameter contains the issuer token that is returned by issuer.

3456 7*** A*** EFGH

Sample Response for Save Card API

Success scenarios

  • VISA
{
status: 1,
msg: "Card Stored Successfully.",
cardToken: "917757449926e57ff2662",
card_number: "XXXXXXXXXXXX1165",
card_label: "My_card",
network_token: "44173XXX1000XXX1",
issuer_token: QQ3LkzgZOnEjY428,
}
  • Mastercard
{
status: 1,
msg: "Card Stored Successfully.",
cardToken: "917e296b5b6da5d20fbfb",
card_number: "XXXXXXXXXXXX2346",
card_label: "Test_Card",
network_token: “3117328711111210”,
issuer_token: AQ3LkzgBNyEjY213,
}
  • American Express
{
status: 1,
msg: "Card Stored Successfully.",
cardToken: "917e29XXX6da5XXCbfb",
card_number: "XXXXXXXXXXX1002",
card_label: "AMEX_Card",
network_token: “51273287XXX61215”,
issuer_token: Va3RaqBNyPnY673,
}
  • Rupay
{
status: 1,
msg: "Card Stored Successfully.",
cardToken: "91XXX96b5b6da5dXXXbfb",
card_number: "XXXXXXXXXXXX0001",
card_label: “Rupay_Card",
network_token: “712XXX870976XX2”,
issuer_token: Ya4HawKgbLmr312,
}
  • Diners
{
status: 1,
msg: "Card Stored Successfully.",
cardToken: "91XXX296b5b6da5XXXbfb",
card_number: "XXXXXXXXXXXX0009",
card_label: "Diner_Card",
"network_token": "8koNXXXC1bT0Hv5a",
"issuer_token": "LQ3QkzXXXnEjY428"
}

Failure scenario

  • If card Number is invalid
{
"status": 0
"msg": CardNumber is invalid
}

Response parameters for Edit Card API

Parameter

Description

Example

status

The status of the response can be any of the following:

  • 1: Success
  • 0: Failure

1

msg

The description of the response whether the card details were stored successfully or not stored.

My_card Edited Successfully

cardToken

The card token is sent by PayU for the successful response.

745d7XXXd9b7e88824fXXXe7ed7XXX1fe624b74

networkToken

The network token is sent by PayU for the successful response.

1234 5XXX XXXX 3456

issuerToken

The issuer token is sent by PayU for the successful response.

3456 7XXX XXXX EFGH

Sample response

  • On successful update of card details
{
    "status": 1,
    "msg": " edited Successfully.",
    "cardToken": "9175XXX60be0bXXX20dd8",
    "network_token": "40XXX010371XXX12",
    "issuer_token": "LQ3XXXgEOnEXXX8",
    "card_number": "XXXXXXXXXXXXX2346",
    "card_label": "testAll"
}
  • If the wrong card token is provided to edit
{
"status": 0
"msg": Card not found to edit
}

Response parameters for Get User Cards API

Parameter

Description

Example

status

The status of the response can be any of the following:
1: Success

2: Failure

1

msg

The description of the response whether the card details were stored successfully or not stored.

Cards fetched Succesfully

user_cards

(JSON format) | The details are sent by PayU in JSON format for the successful response. For more information, refer to the next table.

Refer the sample response.

The details on the JSON format for a successful response is described in the following table:

JSON Field

Description

Example

card_name

  • *Note**: This parameter has been deprecated.

NA

card_type

This field returns the card type code. For the list of card type codes, refer to Card Type Codes and Supported Banks for Cards.

CC

card_token

This field returns the PayU Token for the card.

745d72e2fXXX7e88824fef4e7ed7dXXXfe624b7

network_token

This field returns the details of the network token in a JSON format.

"token_value": "51XXX56789012346",

"is_expired": 0,

"token_exp_mon": "11",

"token_exp_yr": "2021",

"token_bin": "512345"

}

issuer_token

This field returns the details of the issuer token in a JSON format.

{

"token_value": "51XXX567890XXX46",

"is_expired": 0,

"token_exp_mon": "11",

"token_exp_yr": "2021",

"token_bin": "512345"

}

is_expired

This field returns any of the following values to signify whether the card is active or not:
1: Card has expired

0: Card is active

1

card_mode

This field returns the card mode.

CC

card_no

This field returns a masked card number with only the last four digits.

xxxxxxxxxxxx2356

card_brand

This field returns the card brand.

VISA

card_bin

  • *Note**: This parameter has been deprecated.

NA

token_bin

This field returns the token bin information of respective token type (network or issuer).

123456

card_PAR

This field returns the PAR (Payment Account Reference). This is a unique identity for the card across all the tokens. Typically, this will be used for offers and risk checks.

abcdefgh123456789123456789fgh

card_metadata

This field returns the JSON object with all the metadata and card art.

token_exp_yr

This field returns the expiry year of the network token.

2022

token_exp_mon

This field returns the expiry month of the network token.

10

token_value

The field returns the value of the network or issuer token.

51XXX5678XXX2346

Sample response

  • Cards are found in the vault for PCI Compliant Merchants
{
    "status": 1,
    "msg": "Cards fetched Succesfully",
    "user_cards": {
        "0c186bdb8c0ebda30ab9d92816772cbfb946d027": {
            "card_no": "XXXXXXXXXXXX8548",
            "card_token": "0c186bdbXXXbda3XXXd92816772cbXXX46d027",
            "card_name": "nilesh2_card_name",
            "card_mode": "CC",
            "card_PAR": "RCKGgxEEFX1un19I",
            "card_type": "VISA",
            "issuer_token": {
                "token_value": "8koNvAdC1bT0Hv5a",
                "is_expired": 0,
                "token_exp_mon": "11",
                "token_exp_yr": "2021",
                "token_bin": "123456"
            },
            "network_token": {
                "token_value": "8koNvAdC1bT0Hv5a",
                "is_expired": 0,
                "token_exp_mon": "11",
                "token_exp_yr": "2021",
                "token_bin": "512345"
            }
        }
    }
}
  • Response for Non-PCI Compliant Merchants
{
    "msg": "Cards fetched Succesfully",
    "status": 1,
    "user_cards": {
        "9e299603hd4g7201b9cf6": {
            "one_click_status": "",
            "one_click_flow": "",
            "card_type": "MAST",
            "expiry_year": "2024",
            "isDomestic": "Y",
            "issuer_name": null,
            "expiry_month": "02",
            "card_mode": "DC",
            "is_expired": "0",
            "card_cvv": 1,
            "card_no": "XXXXXXXXXXXX81",
            "one_click_card_alias": "",
            "card_token": "9e299603hd4g7201b9cf6",
            "card_name": "MASTERCARD****7781",
            "card_brand": "MAST",
            "name_on_card": "TEST",
            "card_bin": "519950"
        }
    }
}
  • No cards are found for the user
{
"status": 0
"msg": Card not found.
}

Sample Response for Delete Card API

  • On successful deletion
{
        status: 1,
        msg: "My_card card deleted successfully",
}
  • On failure of deletion
{
"status": 0,
"msg": card not found
}

Sample Response for Get Payment Details (Crytogram) API

Successful Scenario

{
    "status": "1",
    "msg": "Instrument details",
    "details": {
        "one_click_status": "",
        "one_click_flow": "",
        "card_type": "VISA",
        "network_token": {
            "token_exp_yr": "2025",
            "token_value": "464XXX7450050615",
            "token_exp_mon": "01"
        },
        "trid": "400600",
        "card_mode": "",
        "token_refernce_id": "4776af84a5079512934417214171fd01",
        "card_no": "XXXXXXXXXXXX0615",
        "card_PAR": "V0010013021031409361532",
        "one_click_card_alias": "",
        "card_token": "60ac10XXX09d1965b7dae2",
        "card_name": "",
        "cryptogram": "/wAAAAoAtd1XnhwAmbHTgkUAAAA="
    }
}

Failure Scenario

{
"status": 0,
"msg": card not found
}