The Get Additional Charge Info API enables merchants to retrieve the applicable convenience fee for a payment transaction before the customer completes checkout. This API evaluates PayU pricing rules and returns the fee breakup (base amount, GST, and total) along with card BIN details, allowing merchants to display transparent pricing to customers.
Use Cases
- Display convenience fees to customers during checkout
- Calculate total payable amount including additional charges
- Retrieve card BIN details (card type, issuing bank, domestic/international status)
- Pre-validate pricing for different payment modes (Credit Card, Debit Card, EMI, Net Banking, etc.)
Endpoint
| Environment | URL |
|---|---|
| Test | https://test.payu.in/merchant/postservice?form=2 |
| Production | https://api.payu.in/merchant/postservice?form=2 |
HTTP Method: POST
Content-Type: application/x-www-form-urlencoded
Sample Request
curl --location 'https://test.payu.in/merchant/postservice?form=2' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'key=smsplus' \
--data-urlencode 'command=get_additional_charge' \
--data-urlencode 'var1={"requestId":"abc1234","amount":10000,"category":"CC","bankCode":"CC","cardNo":"45678930013904","bin":"456789"}' \
--data-urlencode 'hash=c9c2440160a75303e1d272044dbfa5c1e5a13b225dcac11f69a9079491cf2660fd79f32e1e9c05c903ec1cc8ad0746b3989c20f922d32aab1dd124206ccdc5a1'Note: Replace
key,var1payload values, andhashwith your actual merchant credentials and computed hash before making the request.
Request Parameters
| Parameter | Type & Description | Example |
|---|---|---|
key | String (Mandatory) Merchant key provided by PayU during onboarding. | smsplus |
command | String (Mandatory) API command identifier. Must be set to get_additional_charge. | get_additional_charge |
var1 | JSON String (Mandatory) JSON-encoded string containing the transaction details. See var1 Parameters below for structure. For more information, refer to var1 JSON Object Fields Description | Refer to |
hash | String (Mandatory) SHA-512 hash for request validation. Hash sequence: key|command|var1|saltCompute on the server-side using your merchant salt. or more information, refer to Hash Generation | c9c2440160a75303... |
Hash Generation
The hash parameter ensures request integrity and authenticity. It must be computed on the server-side using SHA-512.
Hash Sequence
key|command|var1|salt
Sample hash generation code
<?php
$key = "smsplus";
$command = "get_additional_charge";
$var1 = '{"requestId":"abc1234","amount":10000,"category":"CC","bankCode":"CC","bin":"456789"}';
$salt = "your_merchant_salt";
$hashString = $key . '|' . $command . '|' . $var1 . '|' . $salt;
$hash = strtolower(hash('sha512', $hashString));
echo $hash;
?>import hashlib
key = "smsplus"
command = "get_additional_charge"
var1 = '{"requestId":"abc1234","amount":10000,"category":"CC","bankCode":"CC","bin":"456789"}'
salt = "your_merchant_salt"
hash_string = f"{key}|{command}|{var1}|{salt}"
hash_value = hashlib.sha512(hash_string.encode('utf-8')).hexdigest().lower()
print(hash_value)var1 JSON Object Fields Description
The var1 parameter must be a JSON-encoded string containing the following fields:
| Parameter | Type & Description | Example |
|---|---|---|
requestId | String (Mandatory) Unique UUID to identify this request. Use a unique identifier for each API call. | abc1234 |
amount | Number (Mandatory) Transaction amount in paise (for INR). For example, ₹100.00 = 10000 paise. | 10000 |
category | String (Mandatory) Payment category/mode. Possible values: • CC — Credit Card• DC — Debit Card• EMI — EMI• NB — Net Banking• UPI — UPI• CASH — Cash Cards / Wallets | CC |
bankCode | String (Mandatory) Bank code or ibiboCode identifying the payment partner. Examples: • CC — Credit Card (any issuer)• EMIIC3 — ICICI EMI• AXIB — Axis Bank Net Banking | CC |
bin | String (Conditional) Card BIN (first 6, 8, or 9 digits of the card number). Required for Credit Card (CC) or Debit Card (DC) transactions if cardNo is not provided.Ignored for non-card payment modes. | 456789 |
cardNo | String (Conditional) Full card number. Required for Credit Card (CC) or Debit Card (DC) transactions if bin is not provided.Ignored for non-card payment modes. | 45678930013904 |
Sample Response
Success Response
{
"status": 1,
"details": {
"requestId": "abc1234",
"amount": 10000,
"additionalChargeBase": 236,
"additionalChargeGst": 42,
"additionalChargeTotal": 278,
"cardBinDetails": {
"card_type": "CREDIT",
"issuing_bank": "HDFC Bank",
"is_domestic": true
}
}
}Error Response
{
"status": 0,
"msg": "mandatory param requestId is missing",
"errorCode": "MANDATORY_PARAMS_MISSING"
}Response Parameters
Success Response (status = 1)
| Field | Type & Description | Example |
|---|---|---|
status | Integer Response status. 1 indicates success. | 1 |
details | Object Contains the convenience fee breakup and card details. | See details object below |
details Object
| Field | Type & Description | Example |
|---|---|---|
requestId | String The unique request identifier sent in the request. | abc1234 |
amount | Number Original transaction amount (in paise). | 10000 |
additionalChargeBase | Number Base convenience fee amount (in paise), before GST. | 236 |
additionalChargeGst | Number GST applied on the convenience fee (in paise). | 42 |
additionalChargeTotal | Number Total convenience fee including GST (in paise). additionalChargeTotal = additionalChargeBase + additionalChargeGst | 278 |
cardBinDetails | Object | null Card BIN information. Returns null for non-card payment modes or if BIN lookup fails. | See cardBinDetails object below |
cardBinDetails Object
| Field | Type & Description | Example |
|---|---|---|
card_type | String Type of card. Values: CREDIT, DEBIT | CREDIT |
issuing_bank | String Name of the card issuing bank. | HDFC Bank |
is_domestic | Boolean Indicates whether the card is domestic ( true) or international (false). | true |
Error Response (status = 0)
| Field | Type & Description | Example |
|---|---|---|
status | Integer Response status. 0 indicates an error. | 0 |
msg | String Human-readable error message describing what went wrong. | mandatory param requestId is missing |
errorCode | String Machine-readable error code for programmatic handling. | MANDATORY_PARAMS_MISSING |
Error Codes
| Error Code | Error Message | Cause |
|---|---|---|
MANDATORY_PARAMS_MISSING | • mandatory param requestId is missing• mandatory param amount is missing• mandatory param category is missing• mandatory param bankCode is missing• Either of bin or cardNo should be non null for CC | One or more required parameters are missing from the request. |
INVALID_BIN | invalid bin | The provided BIN is not valid (must be 6, 8, or 9 digits). |
INVALID_CARDNO | invalid card number | The provided card number is not valid or does not pass Luhn check. |
INVALID_CATEGORY_BANKCODE_MAPPING | bank code should be mapped to correct category | The bankCode does not match the provided category. For example, using a Net Banking bank code with category CC. |
INVALID_BIN_CATEGORY_MAPPING | Respective Bin belongs to creditcard | The BIN belongs to a different card type than the specified category. For example, using a credit card BIN with category DC. |
Notes
-
Amount Format: All monetary values (
amount,additionalChargeBase,additionalChargeGst,additionalChargeTotal) are in paise for INR. Divide by 100 to get the rupee value. -
Display to Customer: Use the
additionalChargeTotalto show the total convenience fee to customers during checkout. Example:Order Amount: ₹100.00 Convenience Fee: ₹2.78 Total Payable: ₹102.78 -
Card Details: The
cardBinDetailsobject is useful for:- Displaying card issuer to the customer
- Applying different pricing for domestic vs. international cards
- Validation and fraud prevention
-
Error Handling: Always check the
statusfield first. Ifstatus = 0, parse theerrorCodefor programmatic handling and display themsgto help debug the issue. -
Request Uniqueness: Use a unique
requestId(UUID recommended) for each API call to ensure idempotency and aid in troubleshooting.
Testing
Use the test environment URL with your test merchant credentials:
- Test URL:
https://test.payu.in/merchant/postservice?form=2 - Test Card BINs: Use standard test card numbers provided by PayU to simulate different scenarios
Test Scenarios to Validate
| Scenario | Test Case |
|---|---|
| ✅ Valid Credit Card | Provide valid bin or cardNo with category=CC and bankCode=CC |
| ✅ Valid Debit Card | Provide valid bin or cardNo with category=DC and appropriate bankCode |
| ✅ Net Banking | Provide category=NB with appropriate bankCode (omit bin and cardNo) |
| ✅ UPI | Provide category=UPI with appropriate bankCode |
| ❌ Missing Mandatory Param | Omit requestId, amount, category, or bankCode to test error handling |
| ❌ Invalid BIN | Provide invalid BIN (e.g., 5 digits or alphabetic characters) |
| ❌ Wrong Category-BankCode | Use Net Banking bankCode with category=CC |
Support
For technical assistance or questions about this API:
- Merchant Dashboard: https://merchant.payu.in
- Integration Support: [email protected]
- Developer Documentation: https://docs.payu.in
