Capture a Pre-Authorized API

To capture a pre-authorized payment, use the following command. After the API command is successful, the transaction would be captured and settled to you.

HTTP Method: POST

Environment

Sample request

Cards

curl --location --request POST 'https://info.payu.in/merchant/postservice.php?form=2' \ 
--header 'Content-Type: application/x-www-form-urlencoded' \ 
--form 'key="JF***g"' \ 
--form 'command="capture_transaction"' \ 
--form 'hash="67411736ab98c59522492a12751a6015c41b87764019f9dc14052690c2c7af9095d31002fc109dcf3596c2f38792d56db6f6207b1989010f2adf51c144fa3019"' \ 
--form 'var1="15246574846"' \ 
--form 'var2="authorizeTransaction123"' \ 
--form 'var3="1"' 

UPI

curl --location --request POST 'https://info.payu.in/merchant/postservice.php?form=2' \   
 --header 'Content-Type: application/x-www-form-urlencoded' \   
 --form 'key="JF***g"' \   
 --form 'command="capture_transaction"' \   
 --form 'hash="67411736ab98c59522492a12751a6015c41b87764019f9dc14052690c2c7af9095d31002fc109dcf3596c2f38792d56db6f6207b1989010f2adf51c144fa3019"' \   
 --form 'var1="15246574846"' \   
 --form 'var2="authorizeTransaction123"' \   
 --form 'var3="1"'  
Sample response

Cards

{ 
    "status": 1, 
    "msg": "Capture Request Queued", 
    "request_id": "Request ID", 
    "bank_ref_num": "Bank Reference Number" 
} 

UPI

{
    "msg": "Transaction Processed successfully",
    "status": 1,
    "result": {
        "payuid": 613345678912399031,
        "txnId": "upiAuthCapture_12",
        "amount": 10000.00,
        "merchantId": 3,
        "authpayuid": "3975",
        "status": "in progress",
        "mode": "UPIOTM",
        "bankRefNumber": "410700457030",
        "payerVpa": "surya@icici",
        "field5": "3159219e58ed45eda39e8914b998401a@icici",
        "field9": "0|Transaction Successful"
    }
}

Response parameters
ParameterDescription
statusThis parameter returns the status of web service call. The status can be any of the following:

- 0 - If web service call failed
- 1 - If web service call succeeded
msgThis parameter returns the following message if the pre-auth transaction was successful: Capture Request Queued
request_idThis parameter returns the request ID for the transaction.
bank_ref_numThis parameter returns the bank reference number for the transaction.

Request parameters

ParameterReference
keyFor more information on how to generate the Key and Salt, refer to any of the following:

- Production: Generate Merchant Key and Salt

- Test: Generate Test Merchant Key and Salt
hashHash logic for this API is:
sha512(key|command|var1|salt)
sha512
Language
Click Try It! to start a request and see the response here!