Void API

This will be used to void an authorized transaction. With this, the hold on the amount will be released.

Status Understanding:

Payment Gateway Response
SmartGATEWAY Transaction Status
Description
Pending
VOID_INITIATED
Void API was initiated from SmartGATEWAY, and the request is pending at the gateway's end.
Success
VOIDED
Void API was initiated, and void transaction was successfully completed.
Failure
VOID_FAILED
Void API was initiated, but the void transaction failed.
Timeout/no response from gateway
AUTHORIZED
Void API request initiated from SmartGATEWAY, but the request timed out, and no response is received from the gateway.
Request
Response
Endpoints
Sandbox Link
POST
https://smartgatewayuat.hdfcbank.com/v2/txns/:txn_uuid/void
Copy   
Production Link
POST
https://smartgateway.hdfcbank.com/v2/txns/:txn_uuid/void
Copy   
Authorization Header
Basic Auth *
Base64 Encoded Username:Password
Mandatory

Consists of two parts.

  • Username: API Key obtained from Juspay dashboard

  • Password: Empty string

Example:- Basic MUQ2QUxxxxxxxxxxxxU5QTIxQzNFNTQwNkFDMEZCOg==

Headers
x-merchantid *
String
Mandatory

Merchant ID provided by HDFC SmartGateway

x-routing-id *
String
Mandatory

Unique Customer ID mapped against each customer. Customer ID should be unique for each customer. In case of guest checkout, they should pass sort of customer ID equivalent (could be a cart ID, session ID) that will serve the purpose. NOTE: The provided ID serves as the basis for stickiness/affinity across our various stacks. Failure to pass the same ID for the same customers could result in improper API functionality.

Path Params
txn_uuid *
String
Mandatory

The unique id generated by SmartGATEWAY for a particular transaction.

time
Updated about 1 month ago

LET'S REWIND A LITTLE

Let’s go back, if you have missed anything

Capture API

Error Codes:

Scenario
Error Codes
Description
Sample Error Message
Performing VOID on AUTHENTICATION_FAILED transaction
400
Bad Request
{"error_message":"Cannot Void AUTHENTICATION_FAILED Transaction","status":"Bad Request","error_code":"Invalid","error_info":{"user_message":"Invalid request params. Please verify your input.","developer_message":"Cannot Void AUTHENTICATION_FAILED Transaction","code":"INVALID_INPUT","category":"USER_ERROR"}}
Performing void on charged transaction
400
Bad Request
{"error_message":"Cannot Void CHARGED Transaction","status":"Bad Request","error_code":"Invalid","error_info":{"user_message":"Invalid request params. Please verify your input.","developer_message":"Cannot Void CHARGED Transaction","code":"INVALID_INPUT","category":"USER_ERROR"}}
Performing void on charged transaction
400
Bad Request
{"error_message":"Cannot Void CHARGED Transaction","status":"Bad Request","error_code":"Invalid","error_info":{"user_message":"Invalid request params. Please verify your input.","developer_message":"Cannot Void CHARGED Transaction","code":"INVALID_INPUT","category":"USER_ERROR"}}
Adding double slash at the end of the endpoint of void curl
404
Not Found
Passing Invalid txn_uuid in void curl
400
Bad Request
{"status":"NOT_FOUND","error_info":{"user_message":"Cannot process your request as txn not found.","developer_message":"Txn not found.","code":"RESOURCE_NOT_FOUND","category":"USER_ERROR"},"status_id":40}
Passing V1 in place of V2 in void curl
404
Not Found
Performing Void on transaction which is in'PENDING' status
400
Bad Request
{"error_message":"Cannot Void PENDING_VBV Transaction","status":"Bad Request","error_code":"Invalid","error_info":{"user_message":"Invalid request params. Please verify your input.","developer_message":"Cannot Void PENDING_VBV Transaction","code":"INVALID_INPUT","category":"USER_ERROR"}}
Sample Request
Sample Response
{
    "udf4": "",
    "resp_category": null,
    "emi_details": {
        "bank": null,
        "monthly_payment": null,
        "interest": null,
        "conversion_details": null,
        "principal_amount": null,
        "additional_processing_fee_info": null,
        "tenure": null,
        "subvention_info": [],
        "emi_type": null,
        "processed_by": null
    },
    "udf8": "",
    "udf3": "",
    "udf6": "",
    "offers": [],
    "bank_error_code": "100",
    "status": "VOIDED",
    "bank_error_message": "Request was processed successfully.",
    "id": "ordeh_bd553e4f8be846af8aa72cd4ecc38f36",
    "return_url": "https://www.google.com",
    "last_updated": "2025-02-21T13:37:38Z",
    "txn_uuid": "moz7ZcaKzSxQ2NM7eTJ",
    "gateway_id": 6,
    "currency": "INR",
    "date_created": "2025-02-21T13:29:39Z",
    "resp_message": null,
    "udf2": "",
    "payment_links": {
        "mobile": "https://smartgateway.hdfcbank.com/payment-page/order/ordeh_bd553e4f8be846af8aa72cd4ecc38f36",
        "web": "https://smartgateway.hdfcbank.com/payment-page/order/ordeh_bd553e4f8be846af8aa72cd4ecc38f36",
        "iframe": "https://smartgateway.hdfcbank.com/payment-page/order/ordeh_bd553e4f8be846af8aa72cd4ecc38f36"
    },
    "customer_email": "prathamesh.rane@juspay.in",
    "customer_phone": "8604613494",
    "udf5": "",
    "card": {
        "extended_card_type": "CREDIT",
        "token_type": "ALT_ID",
        "tokens": [],
        "last_four_digits": "4007",
        "card_reference": "",
        "payment_account_reference": "V0010015820353305566264040717",
        "card_type": "CREDIT",
        "card_issuer": "ICICI Bank",
        "expiry_month": "11",
        "card_fingerprint": "1brnch3qul3pu3i5qchnhgksi9",
        "saved_to_locker": false,
        "using_token": false,
        "using_saved_card": false,
        "juspay_bank_code": "JP_ICICI",
        "name_on_card": "SRIKANTH MITRA",
        "card_isin": "474846",
        "expiry_year": "2031",
        "card_brand": "VISA",
        "card_issuer_country": "INDIA"
    },
    "status_id": 31,
    "merchant_id": "34436",
    "resp_code": null,
    "udf9": "",
    "amount": 1,
    "refunded": false,
    "auth_type": "THREE_DS_2",
    "order_id": "T1740144579",
    "payment_method": "VISA",
    "udf7": "",
    "udf10": "",
    "payment_gateway_response": {
        "epg_txn_id": "7401446566546851606127",
        "network_error_code": null,
        "auth_ref_num": null,
        "arn": null,
        "eci": "05",
        "resp_message": "Request was processed successfully.",
        "created": "2025-02-21T13:30:57Z",
        "current_blocked_amount": null,
        "rrn": null,
        "umrn": null,
        "resp_code": "100",
        "network_error_message": null,
        "gateway_merchant_id": "hdfc_89090381",
        "auth_id_code": "942617",
        "txn_id": "34436-T1740144579-1"
    },
    "effective_amount": 1,
    "txn_id": "34436-T1740144579-1",
    "product_id": "",
    "customer_id": "test123",
    "payment_method_type": "CARD",
    "amount_refunded": 0,
    "udf1": ""
}