Skip to main content

Capture and Cancel

With PayU, any successful payments made are automatically captured, and the corresponding funds are added to the balance of the relevant shop. However, if you prefer it, you have the option to disable the auto-receive feature. By doing so, you can manually decide the status of each payment processed by PayU for your shop.

Disabling auto-receive grants you the flexibility to review each payment individually, allowing you to take actions based on your specific requirements.

You can capture or cancel orders with the WAITING_FOR_CONFIRMATION status. This status can only occur if you have disabled auto-receive on your POS. Otherwise, all successful payments for an order will automatically trigger the COMPLETED status.

If no capture or cancel action is taken, the order will be automatically canceled after the number of days specified by the payment method's auto-cancel policy.

Notes

Capturing and cancelling requests always concerns the whole order:

  • Capturing an order updates its status to COMPLETED (ended).
  • Cancelling an order returns all funds to the buyer account.

Capturing an Order

To capture an order, you need to send a POST request to the /orders/{id}/captures endpoint, with an empty request body. The id parameter represents the identifier of the order you wish to capture.

Order Capture Example
curl -X POST https://secure.payu.com/api/v2_1/orders/H9LL64F37H160126GUEST000P01/captures \
-H "Content-Type: application/json" \
-H "Authorization: Bearer 3e5cac39-7e38-4139-8fd6-30adc06a61bd" \

For details on the parameters, please refer to Capture Authorized Order section in the PayU API Reference.

Pre-authorization and Partial Capture

In the case of card payments, it is possible to authorize a certain order amount but capture only a portion of the funds deposited. This can be useful when some of the purchased items are unavailable or when the charge for renting a vehicle exceeds the actual amount to be paid.

Notes

This service requires additional arrangements and configuration on PayU side. To enable it, please get in touch with your account manager at PayU.


Currently, partial order capture does not support currency conversion and is not available for marketplace payments.


Just like with full order capture, partial order capture also completes the order.

Only orders created with an authorizationType parameter set to the PRE_AUTHORIZATION value in the payMethods.payMethod section can be partially received.

Order Extension Allowing Partial Capture
{
"payMethods": {
"payMethod": {
"type":"PBL",
"value":"c",
"authorizationType": "PRE_AUTHORIZATION"
}
}
}

To partially capture an order, you need to send a POST request to the /orders/{id}/captures endpoint, specifing a order currency and amount. The id parameter represents the identifier of the order you wish to capture.

Partial Order Capture Example
curl -X POST https://secure.payu.com/api/v2_1/orders/H9LL64F37H160126GUEST000P01/captures \
-H "Content-Type: application/json" \
-H "Authorization: Bearer 3e5cac39-7e38-4139-8fd6-30adc06a61bd" \
-d '{
"amount": "<amount in minor currency unit>",
"currencyCode": "currency code, e.g. EUR"
}'

For details on the parameters, please refer to Capture Authorized Order section in the PayU API Reference.

Notes

You can find automatic cancellation times of transactions in the Automatic Cancellation of Transactions section.

Capture Times for Different Card Schemes

You can check the exact time remaining to capture a transaction via Download Transaction Data. The time remaining is displayed in the validUntil parameter.

Notes

Pre-authorization configuration overrides the auto-collection settings for cards on your point of sale (POS). Please note that pre-authorized card transactions will not be automatically captured.

There is a risk associated with pre-auth and partial order capture. The allowed collection time for orders paid with Visa cards varies depending on the type of transaction or merchant category:

  • The standard collection time is 8 days.
  • For certain merchant categories, this collection time has been extended to 28 days.
  • For MIT (cardOnFile parameter set to STANDARD_MERCHANT)/recurring transactions, the allowed collection time is 3 days.

Late order capture carries the risk of a late presentment chargeback.

Below are the cpature times for different card schemes and types:

Capture Times for Visa Cards
Card TypeTransaction TypeAuthorization TypeMCCTime for Capture
Debit/Credit
E-commerce
All
All
8 days
Debit/Credit
All
Pre-Auth
All
28 days
Debit/Credit
MIT/recurring
All
All
3 days
Debit/Credit
Card not Present
All
4121
1 day
Capture Times for Mastercard Cards
Card TypeEnvironmentAuthorization TypeMCCTime for Capture
Debit/Credit
All
Auth
All
5 days
Debit/Credit
All
Pre-Auth
All
28 days
Notes

Please be aware that in order to comply with the specified time for capture, PayU must receive the capture request at least 1 day in advance.

Capturing an Order - PUT method (deprecated)

To update the order status, use the PUT method and make a request to the endpoint /api/v2_1/orders/{orderId}/status.

Capturing Order Example
curl -X PUT https://secure.payu.com/api/v2_1/orders/H9LL64F37H160126GUEST000P01/status \
-H "Content-Type: application/json" \
-H "Authorization: Bearer 3e5cac39-7e38-4139-8fd6-30adc06a61bd" \
-d '{
"orderId": "H9LL64F37H160126GUEST000P01",
"orderStatus": "COMPLETED"
}'

For details on the parameters, please refer to Capture Authorized Order section in the PayU API Reference.

Capturing Order Response
{
"status": {
"statusCode": "SUCCESS",
"statusDesc": "Status was updated"
}
}

Cancelling an Order

Notes

You can cancel (reject) orders processed by the PayU system, for example, if a product or service is not delivered.

Only orders which are not COMPLETED can be cancelled.

To cancel an order and proceed with a refund to the Payer's account, call the endpoint /api/v2_1/orders/{orderId} using the DELETE method.

Cancelling Order Example
curl -X DELETE https://secure.payu.com/api/v2_1/orders/H9LL64F37H160126GUEST000P01 \
-H "Content-Type: application/json" \
-H "Authorization: Bearer 3e5cac39-7e38-4139-8fd6-30adc06a61bd" \

For details on the parameters, please refer to Cancel an Order section in the PayU API Reference.

Cancelling Order Response
{
"orderId":"71S3CTJJXV140325GUEST000P01",
"extOrderId":"your_order_id"
"status":{
"statusCode":"SUCCESS"
}
}