---
page_title: Void API
product: SmartGateway TranPortal Integration
page_source: https://smartgateway.hdfc.bank.in/docs/docs/smartgateway-tranportal-integration/docs/preauth-and-capture/void-api
openapi: https://smartgateway.hdfc.bank.in/docs/docs/api/swagger?document=https%3A%2F%2Fsmartgateway.hdfc.bank.in%2Fdocs%2Fdocs%2Fsmartgateway-tranportal-integration%2Fdocs%2Fpreauth-and-capture%2Fvoid-api
llms_txt: https://smartgateway.hdfc.bank.in/docs/docs/llms.txt
product_llms_txt: https://smartgateway.hdfc.bank.in/docs/docs/smartgateway-tranportal-integration/llms.txt
---

## API Version: default


# 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. |
## Endpoints:
- Sandbox: https://smartgateway.hdfcuat.bank.in/v2/txns/:txn_uuid/void

- Production: https://smartgateway.hdfc.bank.in/v2/txns/:txn_uuid/void

## Request Type: 
POST

## Authorization:

#### Basic Auth:
Consists of two parts.

* Username: API Key obtained from Juspay dashboard
* Password: Empty string

Example:- Basic MUQ2QUxxxxxxxxxxxxU5QTIxQzNFNTQwNkFDMEZCOg==
- Tags: Base64 Encoded Username:Password, Mandatory
## Headers:

#### x-merchantid:
Merchant ID provided by HDFC SmartGateway
- Tags: String, Mandatory

#### x-routing-id:
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.
- Tags: String, Mandatory

#### x-resellerid:
Reseller ID provided by bank
- Value: hdfc_reseller
- Tags: String, Required
## Sample Code Snippets:
### Sample Request:

#### Request Code Snippet:

```request
curl --location --request POST 'https://smartgateway.hdfc.bank.in/v2/txns/:txnUUID/void' \
--header 'accept: application/json' \
--header 'Authorization: Basic <base64encoded>'

```

### Sample Response:

#### Response:
```json
{
    "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.hdfc.bank.in/payment-page/order/ordeh_bd553e4f8be846af8aa72cd4ecc38f36",
        "web": "https://smartgateway.hdfc.bank.in/payment-page/order/ordeh_bd553e4f8be846af8aa72cd4ecc38f36",
        "iframe": "https://smartgateway.hdfc.bank.in/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": ""
}

```

## Path Parameters:

#### txn_uuid:
The unique id generated by SmartGATEWAY for a particular transaction. 
- Tags: String, Mandatory
## API Responses:
### 200:

#### udf1-10:
- Description: UDFs passed during order creation will be received
- Tags: string

#### txn_uuid:
- Description: The unique id generated by Juspay for a particular transaction. Can be used as an identifier in case of UPI transaction. Its txn_uuid apssed in the capture request.
- Tags: string

#### txn_id:
- Description: Transaction ID of specified txn_uuid
- Tags: string

#### status_id:
- Description: Status ID of the transaction
- Tags: integer

#### status:
- Description: Status of the void transaction
- Tags: string

#### return_url:
- Description: Redirectional URL once the transaction is completed.URL passed in the request will be received
- Tags: string

#### refunded:
- Description: Denotes whether transaction is refunded or not
- Tags: boolean

#### payment_method_type:
- Description: payment method type of transaction
- Tags: string

#### payment_method:
- Description: payment method of transaction
- Tags: string

#### payment_gateway_response:
- Description: Lists the response received from the gateway 
- Value:
  - **Txn_id**:
    - Description: Transaction ID of specified txn_uuid
    - Tags: string
  - **Rrn**:
    - Description: RRN provided by bank for tracking status
    - Tags: string
  - **Resp_message**:
    - Description: Denotes the response received from gateway
    - Tags: string
  - **Resp_code**:
    - Description: Denotes response code of the transaction
    - Tags: string
  - **Epg_txn_id**:
    - Description: Transaction id created at the void transaction processed gateway
    - Tags: string
  - **Created**:
    - Description: Denotes the status updation time
    - Tags: string
- Tags: object

#### order_id:
- Description: Order ID of the transaction
- Tags: string

#### gateway_id:
- Description: Denotes Juspay gateway ID with which the transaction was processed
- Tags: integer

#### date_created:
- Description: Response time
- Tags: string

#### currency:
- Description: Currency of the processed transaction
- Tags: string

#### card:
- Description: Card details passed in the transaction request
- Tags: object

#### bank_error_message:
- Description: Error message in case of transaction failure
- Tags: string

#### bank_error_code:
- Description: error code for the transaction failure
- Tags: string

#### auth_type:
- Description: Type of transaction
- Tags: string

#### amount_refunded:
- Description: specifies the Refunded amount
- Tags: integer

#### amount:
- Description: Transaction amount
- Tags: integer
### 400:

#### error_message:
- Description: Provides the reason for the error
- Value: Sample Response:Cannot Void AUTHENTICATION_FAILED Transaction
- Tags: String

#### status:
- Description: Error status
- Value: Response:Bad Request
- Tags: String

#### error_code:
- Description: Specifies the Error code 
- Value: Sample Response:Invalid
- Tags: String

#### error_info:
- Description: Additional information on the error message
- Value:
  - **User_message**:
    - Description: Error message can be displayed to the user
    - Value: Sample Response:Invalid request params. Please verify your input.
    - Tags: String
  - **Developer_message**:
    - Description: Detailed info on the error
    - Value: Sample Response:Cannot Void AUTHENTICATION_FAILED Transaction
    - Tags: String
  - **Category**:
    - Description: category of the error
    - Value: Response: USER_ERROR
    - Tags: String
- Tags: JSON
### 401:

#### status:
- Description: error
- Tags: string

#### error_code:
- Description: access_denied
- Tags: string



## 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"}} |


---

## See Also

- [Capture API](https://smartgateway.hdfc.bank.in/docs/docs/smartgateway-tranportal-integration/docs/preauth-and-capture/capture-api)
- [Native OTP Introduction](https://smartgateway.hdfc.bank.in/docs/docs/smartgateway-tranportal-integration/docs/native-otp/native-otp-introduction)
