---
page_title: Refunds 
product: SmartGateway TranPortal Integration
page_source: https://smartgateway.hdfc.bank.in/docs/docs/smartgateway-tranportal-integration/docs/tranportal-integration/refunds
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
---


# Refunds



Refunds can be initiated only for transactions that are CHARGED. The refunded amount will be settled to the same payment method that the customer used for making the payment.


### Initiating Refunds



Ensure following request parameters are provided in Refund API request:


| Parameter | Type | Description |
|---|---|---|
| unique_request_id | Mandatory | Request ID that uniquely identifies this request. You cannot reuse the value for two different refund requests. This is to avoid processing duplicate refund requests.The length of the unique_request_id should be less than 21 characters |
| amount | Mandatory | Amount that has to be refunded. Amount has to be less than or equal to the amount of the order that is not yet refunded. If this parameter is not passed, then the order is refunded entirely |
| order_id | Mandatory | Order Id of the order for which you want to proceed with refund Example:- 1418394476 |



### Refund Status Mapping




| Refund Status | Description | Merchant Action |
|---|---|---|
| Pending | SmartGateway has marked refund and sent a refund request to underlying PG. | Call Order Status once again |
| Success | Refund has been successfully executed by underlying PG. | No action required |
| Failure | Refund is failed. | Initiate a fresh refund again |
| Manual Review | Refunds that are pending more than 10 days goes into manual review. | Get in touch with any SmartGateway POC |



## **Refund Capping** 



On HDFC SmartGateway, **Refunds are allowed only upto the available Sale Balance of any calendar day** , and not more than that.Eg: Refunds of INR 2,000/- cannot be processed on a day when the Total Sale Transactions for the day amount to only INR 1,000/-. Refund of INR 2,000/- can only be processed if Total Sale Transactions for the day exceed INR 2,000/-Refunds will be kept in **PENDING**  if **Total Sale Transaction Balance on any day is insufficient,**  and the order Status API will return the Error Message : **“Insufficient Sale Balance to process Refund”.** Refunds will be kept in **PENDING for 72 hours**  from the time of initiation, and if Sufficient Sale Balance is available at any time within 72 hours, the Refunds will be processed. If Sufficient Sale Balance does not become available, Refunds will be marked as **FAILED**  with the Error Message : “**Refund Failed due to Insufficient Sale Balance”.** 

New error message is introduced for handling of Refund capping as follows : 


| Refund Status | Description | Merchant Action |
|---|---|---|
| Pending | Insufficient Sale Balance to process Refund | Maintain Sufficient sale balance for the day.  |
| Failure  | Refund Failed due to Insufficient Sale Balance | Maintain Sufficient sale balance for the day.  |



### Updating Refund Status



1. **Order Status Function** : You need to poll this function and fetch refund details from the refunds block in the function response([Sample Response](https://docs.hdfcbank.juspay.in/docs/smartgateway-sdk-basic-auth/web/resources/sample-response-of-order-status)). Refer [Handle Payment Response](https://docs.hdfcbank.juspay.in/docs/smartgateway-sdk-basic-auth/web/how-to-integrate-sdks/handle-payment-responses) Section to know in detail.
2. **Webhook** : Consume ORDER_REFUNDED and ORDER_REFUND_FAILED and REFUND_MANUAL_REVIEW_NEEDED webhooks to update the refund status real time. Refer [Transaction Status](https://docs.hdfcbank.juspay.in/docs/smartgateway-sdk-basic-auth/web/resources/transaction-status) Section to know in detail.


## **Auto Refund** 



In payment ecosystem when a transaction traverses from your website to payment gateway and to bank page there are possibilities that customer might get charged for a transaction, however the transaction status might not get updated in realtime due delayed response from the payment provider or the bank's digital infrastructure that is supporting the transaction. These transactions will stay in pending state and move to success once the PG gets response from the processing bank or when the PG complete the reconciliation with the processing bank, this causes delayed success of transaction. Your business policy might have a predefined order timeouts (a specified duration post which payments will not be accepted against the order). This may range from few minutes to a few days depending on the type of product/ service offered by your business

Auto refund feature can be used to automatically refund -1. [Conflicted Transactions](https://docs.hdfcbank.juspay.in/docs/hdfc-resources/docs/common-resources/refunds#Conflicted-transaction)

2. [Multiple Charged Transaction](https://docs.hdfcbank.juspay.in/docs/hdfc-resources/docs/common-resources/refunds#Multiple-Charged-transactions)


### Conflicted transaction



For merchants rendering realtime services, they can set a threshold time as per their order fulfillment window on dashboard. If transaction goes into pending state and we receive success response from PG post the threshold time limit set by you, then we consider that transaction as conflicted transaction.

> **Note**
> Here the order fulfillment window means a specified duration in which payments will be accepted against an order.



> **Note**
> The auto refund of conflicted transactions threshold time will be calculated from the time of transaction initiation and not order creation.




### Multiple Charged transactions



Multiple charged transactions are those in which two or more transactions got charged against a same order. When customer attempts multiple transactions against an order ID where for the first transaction the amount is debited from customer’s account however transaction goes into pending state, customer attempts another transaction which gets successful and later the first transaction also gets successful, leading to more than one successful transaction against an Order ID.

**Note** 

If auto-refund for multiple charged transactions is enabled then expect for the first successful transaction all other transactions would be refunded against an Order.

**Steps to enable Auto Refunds for Multiple Charged transactions -** 

* Go to your Dashboard > Payments > Settings > Conflict > Enable the toggle of Multiple charged Transactions.


### Updating Refund Status for Auto-refunded transaction



1. **Order Status Function** : You need to poll the order status function and fetch refund details from the refunds block in the response, the order status of auto-refunded transaction would be **AUTO_REFUNDED** . Refer [Handle Payment Response](https://docs.hdfcbank.juspay.in/docs/hypercheckout-mobile-sdk/android/how-to-integrate-sdks/handle-payment-responses) Section to know in detail.
2. **Webhook** : Please consume the below webhooks to update the refund status for auto refunded transaction.**AUTO_REFUND_INITIATED:**  Generated when a transaction an auto refund entry for that transaction is created at SmartGateway**AUTO_REFUND_SUCCEEDED:** Generated when the transaction is auto refunded and refund is success.**AUTO_REFUND_FAILED:**  Generated when the transaction is auto refunded and refund has failed.

---

## See Also

- [Test Resources](https://smartgateway.hdfc.bank.in/docs/docs/smartgateway-tranportal-integration/docs/tranportal-integration/test-resources)
- [Mandate Flow](https://smartgateway.hdfc.bank.in/docs/docs/smartgateway-tranportal-integration/docs/tranportal-integration/mandate-flow)
