---
page_source: https://juspay.io/sea/docs/api-reference-global/docs/preauth-and-capture/preauth-and-capture-card-transaction
page_title: Pre-auth And Capture Card Transaction
---


# Pre-Auth And Capture




## Introduction



Pre-Authorization (Pre-Auth) and Capture is a two-step payment process, primarily in industries like hospitality, travel, and e-commerce. It separates the authorization of funds from their final collection, offering both merchants and customers greater flexibility and security during transactions.

* **Pre-Authorization (Pre-Auth):** 
  
  * The customer's card is temporarily authorized for a specific amount, reserving the funds without actually charging them.
  * The card issuer verifies that the customer has sufficient funds available.
  * Pre-Auth does not debit the amount from the customer's account; it just holds it until the transaction is completed or canceled.
  * **Example Use Case:** A hotel might place a pre-authorization hold when a guest checks in, covering the expected room charges and incidentals.
* **Capture:** 
  
  * Once the transaction is finalized (e.g., after the service is provided or goods are shipped), the merchant submits a request to capture the amount.
  * This is when the reserved funds are actually debited from the customer's account.
  * **Example Use Case:** After the guest checks out and final charges are determined, the hotel processes the capture, debiting the appropriate amount.
* **Void:** 
  
  * **Void API**  is used to cancel or void a payment transaction that has been authorized but not yet captured or settled.
  * This functionality is typically employed in pre-authorization and capture workflows or when a merchant needs to reverse a transaction before funds are debited from the customer’s account.
  * **Example Use Case:** If the guest decides to cancel their booking, the hotel processes a void transaction, ensuring the reserved amount is released back to the guest's account without delay.


## Transaction Flow:



![Image](https://dth95m2xtyv8v.cloudfront.net/tesseract/assets/resources-global/Screenshot%202024-12-09%20at%208.05.37%E2%80%AFPM.png)




## Advantages:



* **Fraud Prevention:**  Verifies fund availability without immediate charging, reducing the risk of failed transactions.
* **Flexibility:**  Suitable for scenarios where the final charge amount may change.
* **Customer Satisfaction:**  Ensures funds are held securely until the transaction is confirmed.
* **Reduced Chargebacks** : Ensures funds are only captured once the goods or services are confirmed, minimizing disputes and chargebacks.

> **Warning**
> * Pre-Auth holds typically expire after a set period (usually 7-30 days) if not captured.
> * Merchants must ensure timely capture to avoid losing the authorization hold.
> * Partial capture of the authorized transaction amount is not allowed.




## Integration Enablement:




### Dashboard Setup:



* Enable the required flag in the gateway configuration within the PG Control Center on the Juspay dashboard.
* **Flag enablement during gateway configuration:** Login to Juspay Dashboard → Select the preferred gateway → Navigate to “Payment Method Configurations” → Select “Advanced Features” → Enable the flag “Pre-authorization”
  
  [Video](https://dth95m2xtyv8v.cloudfront.net/tesseract/assets/ec-api-global/Screen%20Recording%202025-01-21%20at%203.16.52%E2%80%AFPM.mov)
* **Flag enablement for existing gateway:** Login to Juspay Dashboard → Select the preferred gateway → Navigate to “Advanced Features” under “Payment Method Configurations” → Enable the flag “Pre-authorization”
  
  [Video](https://dth95m2xtyv8v.cloudfront.net/tesseract/assets/ec-api-global/Screen%20Recording%202025-01-21%20at%203.00.53%E2%80%AFPM.mov)


### **New Card Transaction Flow** 



1. [Call “Card Info” API](https://juspay.io/sea/docs/ec-api-global/docs/base-integration/card-info)**[](https://juspay.io/sea/docs/ec-api-global/docs/base-integration/card-info)** - Get Card details using card bin. You can also use this API to check if a card is eligible for Mandate or direct OTP payments.
2. [Call Order Create API](https://juspay.io/sea/docs/ec-api-global/docs/base-integration/create-order-apiorders) - Call this API to create an order at Juspay system before initiating the transaction.
   
   > **Note**
   > Parameter `metadata.txns.auto_capture`**** as**** `false`**** is required to pass in the order creation API for Pre-auth and Capture card transactions
3. [Call “Credit / Debit Card transaction” API](https://juspay.io/sea/docs/ec-api-global/docs/base-integration/card-transaction-api)**** - Call this API using Card details and cvv provided by the customer to initiate a card transaction. The status will be in Authorized State on the successful transaction completion.
4. [Call Capture API](https://juspay.io/sea/docs/ec-api-global/docs/base-integration/capture-api) - Call this API to confirm and capture the held transaction amount, transferring it to the merchant's account.
5. [Call Void API](https://juspay.io/sea/docs/ec-api-global/docs/base-integration/void-api)- Call this API to cancel the held transaction, releasing the amount back to the user's account.
   
   > **Note**
   > * Merchant must call `Capture API`to collect the transaction amount and`Void API`to release the held amount back to the user's account.


### **Saved Card Transaction Flow** 



1. [Call “List Card” API](https://juspay.io/sea/docs/ec-api-global/docs/base-integration/list-stored-cards) - List all the cards stored for a customer. This API gives back only card tokens and other metadata relevant to the cards stored against the customer.
2. [Call Order Create API](https://juspay.io/sea/docs/ec-api-global/docs/base-integration/create-order-apiorders) - Call this API to create an order at Juspay system before initiating the transaction.
   
   > **Note**
   > Parameter `metadata.txns.auto_capture`**** is required to pass in the order creation API for Pre-auth and Capture card transactions
3. [Call “Credit / Debit Card transaction” API](https://juspay.io/sea/docs/ec-api-global/docs/base-integration/card-transaction-api)**[](https://juspay.io/sea/docs/ec-api-global/docs/base-integration/card-transaction-api)** - Call this API using card token and cvv provided by the customer to initiate a card transaction
4. [Call Capture API](https://juspay.io/sea/docs/ec-api-global/docs/base-integration/capture-api) - Call this API to confirm and capture the held transaction amount, transferring it to the merchant's account.
5. [Call Void API](https://juspay.io/sea/docs/ec-api-global/docs/base-integration/void-api)- Call this API to cancel the held transaction, releasing the amount back to the user's account.
   
   > **Note**
   > * Merchant must call `Capture API`to collect the transaction amount and`Void API`to release the held amount back to the user's account.


## Refunds on Pre-auth Transactions:



* Refunds can be initiated only for transactions which are in AUTHORIZED status.


### Error Codes




| Scenario | Error Codes | Description | Sample Error Message |
|---|---|---|---|
| Refund on AUTHENTICATION_FAILED transaction | 400 | Bad Request | {"error_message":"This refund cannot be processed as the forward order/transaction is not successful.","status":"ERROR","error_code":"invalid.order.not_successful","error_info":{"user_message":"Invalid request params. Please verify your input.","developer_message":"This refund cannot be processed as the forward order/transaction is not successful.","code":"INVALID_INPUT","category":"USER_ERROR"},"status_id":-1} |
| Refund on Voided transaction | 400 | Bad Request | {"error_message":"This refund cannot be processed as the forward order/transaction is not successful.","status":"ERROR","error_code":"invalid.order.not_successful","error_info":{"user_message":"Invalid request params. Please verify your input.","developer_message":"This refund cannot be processed as the forward order/transaction is not successful.","code":"INVALID_INPUT","category":"USER_ERROR"},"status_id":-1} |
| Refund with amount greater than the order amount | 400 | Bad Request | {"error_message":"Refund amount exceeds the total refundable amount.","status":"ERROR","error_code":"invalid.amount.exceeded","error_info":{"user_message":"Invalid request params. Please verify your input.","developer_message":"Refund amount exceeds the total refundable amount.","code":"INVALID_INPUT","category":"USER_ERROR"},"status_id":-1} |
| Refund on transaction which is in 'PENDING' status | 400 | Bad Request | {"error_message":"This refund cannot be processed as the forward order/transaction is not successful.","status":"ERROR","error_code":"invalid.order.not_successful","error_info":{"user_message":"Invalid request params. Please verify your input.","developer_message":"This refund cannot be processed as the forward order/transaction is not successful.","code":"INVALID_INPUT","category":"USER_ERROR"},"status_id":-1} |
