Cashfree payment gateway now supports Pre Auth on credit/debit card transactions. Pre Auth flow allows you to authorize any amount of funds from your customer’s card and capture these funds (or any part of it) at a later time. This is different from typical credit/debit card transactions where capture of funds happens immediately after transaction is authorized.
Casfree PG also allows you to void authorization or any transactions that haven’t been captured yet. This will deauthorize all the fund or the transaction and credit it back to the customer’s card immediately. Both void and capture can also be done manually on the merchant dashboard.
You can initiate a capture, void call only once per transaction. It should be done within 7 days from the date of transaction.
Captured transactions can’t be made void or vice versa.
Any amount blocked for transactions that are not captured within the 7 day period will be sent back to the customer.
Amount blocked for transactions will be sent back to the customer account immediately when you mark transactions as void.
Captured amount will be settled during the next settlement cycle
This endpoint allows you to capture a transaction.
Type | Value |
HTTP Method | POST |
URL | /api/v1/order/capture |
Content-Type | application/x-www-form-urlencoded |
Parameter | Description |
appId | Your app Id |
secretKey | Your secret key |
referenceId | The referenceId of the successful transaction that needs to be captured(Integer) |
idemKey | A unique Id generated by the caller to ensure single invocation of the capture API(Alphanumeric) |
captureAmount | The amount that needs to be captured. If this field is not included the full amount or the transaction will be captured (Decimal) (Optional) |
curl -XPOST -H 'Content-Type: application/x-www-form-urlencoded'-d'appId=MTA2OTkyMDE1ODE0NDIyNTExNjYjIz&secretKey=63ca0b83c8ca85d73fff9c3fd29a7c87e292fd63&referenceId=3890&idemKey=3890sdfas&captureAmount=1' 'https://test.cashfree.com/api/v1/order/capture'
{“status”:”OK”,“capturedAmount”:1,"captureStatus": "SUCCESS"“authId”:1,“message”:”Capture Success ul”}
{“status”:”ERROR”,“message”:”Already Captured Transaction”}
Successful Response Description
capturedAmount is the fund captured by this request
captureStatus will either be SUCCESS or PENDING depending on whether the capture is pending or is confirmed
authId is a unique id generated by Cashfree for this request
This endpoint allows you to void authorization or an uncaptured transaction.
Type | Value |
HTTP Method | POST |
URL | /api/v1/order/void |
Content-Type | application/x-www-form-urlencoded |
Parameter | Description |
appId | Your app Id |
secretKey | Your secret key |
referenceId | The referenceId of the successful transaction that needs to be captured(Integer) |
idemKey | A unique Id generated by the caller to ensure single invocation of the capture API(Alphanumeric) |
curl -XPOST -H 'Content-Type: application/x-www-form-urlencoded'-d'appId=MTA2OTkyMDE1ODE0NDIyNTExNjYjI&secretKey=63ca0b83c8ca85d73fff9c3fd29a7c87e292fd63&referenceId=3892&idempotencyKey=3892asdf''https://test.cashfree.com/api/v1/order/void'
{“status”:”OK”,“authId”: 72,“message”:”Void Successful”,"voidStatus": "SUCCESS"}
{“status”:”ERROR”,“message”:”Can only void successful transaction”}
Successful Response Description
authId is a unique id generated by Cashfree for this request.
This endpoint allows you to get the capture status for any order.
Type | Value |
HTTP Method | POST |
URL | /api/v1/captureStatus |
Content-Type | application/x-www-form-urlencoded |
Parameter | Description |
appId | Your app Id |
secretKey | Your secret key |
referenceId | The referenceId of the successful transaction that needs to be captured (Integer) |
curl -XPOST -H 'Content-Type: application/x-www-form-urlencoded'-d'appId=MTA2OTkyMDE1ODE0NDIyNTExNjYjI&secretKey=63ca0b83c8ca85d73fff9c3fd29a7c87e292fd63&orderId=123''https://test.cashfree.com/api/v1/captureStatus'
"status":"OK","message":"Capture Status","captureType":"CAPTURE","captureStatus": "SUCCESS"}
{“status”:”ERROR”,“message”:”Transaction does not exist”}
Successful Response Description
All possible values for captureType and captureStatus are:
CaptureType | CaptureStatus | Description |
CAPTURE | SUCCESS | Transaction has been successfully captured |
CAPTURE | PENDING | Capture has been attempted but pending |
CAPTURE | FAILED | Capture failed |
VOID | SUCCESS | Transaction has been successfully marked void |
VOID | PENDING | Void is pending |
VOID | FAILED | Void failed |
NONE | UNCAPTURED | Capture/Void not initiated |