1. Home
  2. Docs
  3. Developers Guide
  4. Integration APIs
  5. Refund APIs
  6. cancel_refund_transaction

cancel_refund_transaction

This command can be used for 2 different purposes:

1. To cancel a transaction which is in ‘auth’ state at the moment

2. To refund a transaction which is in ‘captured’ state at the moment

ParameterDescriptionSample Value
var1Payu ID (mihpayid) of transaction
8000123
var2 This parameter should contain the Token ID (unique token from merchant) for the refund request. Token ID has to be generated at your end for each new refund request. It is an identifier for each new refund request which can be used for tracking it. It must be unique for every new refund request generated – otherwise the refund request would not be generated successfully. Token ID length should not be greater than 23 characters 7800456
var3 For captured transaction: This parameter should contain the amount which needs to be refunded. Please note that both partial and full refunds are allowed.
Hence, for partial refund, this var3 value would be less than the amount with which the transaction was made. For full refund, var3 value would be equal to the amount with which the transaction was made. For pre-auth transaction:
If the transaction is in pre-auth state currently, then only a full cancellation is allowed. The amount must be same as the auth amount. Partial amount would not be allowed.
500

a. if token is missing

Array (
[status] => 0
[msg] => token is empty )

b. if amount is missing

Array(
[status] => 0
[msg] => amount is empty )

c. if transaction isn’t found

Array (
[status] => 0
[msg] => transaction not exists )

d. on successful processing at our end

Array (
    [status] => 1
    [msg] => Cancel Request Queued
    [txn_update_id] => Request ID
    [bank_ref_num] => Bank Reference Number
    [mihpayid] => PayU Transaction id
)

e. on successful processing on our end for captured transactions

Array (
    [status] => 1
    [msg] => Refund Request Queued
    [request_id] => Request ID
    [bank_ref_num] => Bank Reference Number
    [mihpayid] => PayU Transaction id
)

f. if failed to refund

Array (
[status] => 0
[msg] => Refund request failed )

g. if capture is done on the same day

Array (
    [status] => 1
    [msg]=> Capture is done today, please check for refund status tomorrow
    [request_id] => Request ID
    [bank_ref_num] => Bank Reference Number
    [mihpayid] => PayU ID
)

h. if invalid token

Array(
[status] => 0
[msg] => token already used or request pending. )

i. on successful processing at PayU end for auth transactions

Array (
[status] => 1
[msg] => Cancel Request Queued [txn_update_id] => Request ID [bank_ref_num] => Bank Reference Number
)

j. if failed to cancel a transaction

Array (
[status] => 0
[msg] => Cancel request failed )