Additional Info for Simple REST 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.

ParameterDescriptionExample
statusThe status of the response can be any of the following:
1: Success

0: Failure
1
msgThe description of the response whether the card details were stored successfully or not stored.Card Stored Successfully.
cardTokenThe cardToken is sent by PayU for the successful response.74\*\*\*2e2fd9b7e\*\*\*24fef4e7ed7dac1fe624b7
network_tokenThe network token is returned in this parameter.1234 5*** 9*** 3456
issuer_tokenThe 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: "4417328710000211",
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: "917e296b5b6da5d20fbfb",
card_number: "XXXXXXXXXXX1002",
card_label: "AMEX_Card",
network_token: “5127328709761215”,
issuer_token: Va3RaqBNyPnY673,
}
  • Rupay
{
status: 1,
msg: "Card Stored Successfully.",
cardToken: "917e296b5b6da5d20fbfb",
card_number: "XXXXXXXXXXXX0001",
card_label: “Rupay_Card",
network_token: “7128658709761092”,
issuer_token: Ya4HawKgbLmr312,
}
  • Diners
{
status: 1,
msg: "Card Stored Successfully.",
cardToken: "917e296b5b6da5d20fbfb",
card_number: "XXXXXXXXXXXX0009",
card_label: "Diner_Card",
"network_token": "8koNvAdC1bT0Hv5a",
"issuer_token": "LQ3QkzgEOnEjY428"
}

Failure scenario

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

Response parameters for Edit Card API

ParameterDescriptionExample
statusThe status of the response can be any of the following:
1: Success
0: Failure
1
msgThe description of the response whether the card details were stored successfully or not stored.My_card Edited Successfully
cardTokenThe card token is sent by PayU for the successful response.745d72e2fd9b7e88824fef4e7ed7dac1fe624b74
networkTokenThe network token is sent by PayU for the successful response.1234 5*** 9012 3456
issuerTokenThe issuer token is sent by PayU for the successful response.3456 7*** ABCD EFGH

Sample response

  • On successful update of card details
{
    "status": 1,
    "msg": " edited Successfully.",
    "cardToken": "9175d4260be0b4b720dd8",
    "network_token": "4012001037141112",
    "issuer_token": "LQ3QkzgEOnEjY428",
    "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

ParameterDescriptionExample
statusThe status of the response can be any of the following:
1: Success

2: Failure
1
msgThe 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 FieldDescriptionExample
card_nameNote: This parameter has been deprecated.NA
card_typeThis 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_tokenThis field returns the PayU Token for the card.745d72e2fd9b7e88824fef4e7ed7dac1fe624b7
network_tokenThis field returns the details of the network token in a JSON format."token_value": "51***56789012346",

"is_expired": 0,

"token_exp_mon": "11",

"token_exp_yr": "2021",

"token_bin": "512345"

}
issuer_tokenThis field returns the details of the issuer token in a JSON format.{

"token_value": "51***56789012346",

"is_expired": 0,

"token_exp_mon": "11",

"token_exp_yr": "2021",

"token_bin": "512345"

}
is_expiredThis 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_modeThis field returns the card mode.CC
card_noThis field returns a masked card number with only the last four digits.xxxxxxxxxxxx2356
card_brandThis field returns the card brand.VISA
card_binNote: This parameter has been deprecated.NA
token_binThis field returns the token bin information of respective token type (network or issuer).123456
card_PARThis 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_metadataThis field returns the JSON object with all the metadata and card art. 
token_exp_yrThis field returns the expiry year of the network token.2022
token_exp_monThis field returns the expiry month of the network token.10
token_valueThe field returns the value of the network or issuer token.51***56789012346

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": "0c186bdb8c0ebda30ab9d92816772cbfb946d027",
            "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
{
    status: 1,
    msg: "Cards fetched Succesfully",
    user_cards: 
{
    9175d4260be0b4b720dd8: 
{
    expiry_month: "11",
    is_expired: 0,
    card_mode: "CC",
    card_no: "485498XXXXXX1165",
    one_click_card_alias: "",
    one_click_status: "",
    card_token: "9175d4260be0b4b720dd8",
    one_click_flow: "",
    card_name: "",
    card_type: "CC",
    expiry_year: "2024",
    card_brand: "VISA",
    card_bin: "485498",
    isDomestic: "Y",
    PAR: null,
    }
    },
}
  • 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": "4640837450050615",
            "token_exp_mon": "01"
        },
        "trid": "400600",
        "card_mode": "",
        "token_refernce_id": "4776af84a5079512934417214171fd01",
        "card_no": "XXXXXXXXXXXX0615",
        "card_PAR": "V0010013021031409361532",
        "one_click_card_alias": "",
        "card_token": "60ac1025f09d1965b7dae2",
        "card_name": "",
        "cryptogram": "/wAAAAoAtd1XnhwAmbHTgkUAAAA="
    }
}

Failure Scenario

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