Voids and Refunds API
VOID
or REFUND
methods.Note
To integrate with the Voids and Refunds API, direct your requests to the appropriate environment URL:
- Test:
https://sandbox.api.payulatam.com/payments-api/4.0/service.cgi
- Production:
https://api.payulatam.com/payments-api/4.0/service.cgi
For a deeper understanding of voids and refunds, including key concepts and considerations, refer to this document.
Considerations per Country
Before using the Voids and Refunds API, keep in mind the following country-specific considerations.
Argentina
Voids | Refunds |
---|---|
|
|
Brazil
Voids | Refunds |
---|---|
|
|
Chile
Voids | Refunds |
---|---|
|
|
Colombia
Voids | Refunds |
---|---|
|
|
Mexico
Voids | Refunds |
---|---|
|
|
Panama
Voids | Refunds |
---|---|
|
|
Peru
Voids | Refunds |
---|---|
|
|
Void
The VOID
method cancels a previously authorized transaction. This is an automatic process—as soon as the system submits a VOID
request, it does not follow any approval flow, and the integration will not charge the transaction to the cardholder.
Parameters for Request and Response
Request
Field Name | Format | Size | Description | Mandatory |
---|---|---|---|---|
language |
Alphanumeric | 2 | Language used in the request. This determines the language of error messages. See supported languages. | Yes |
command |
Alphanumeric | Max: 32 | Set to SUBMIT_TRANSACTION . |
Yes |
test (JSON)isTest (XML) |
Boolean | — | Set to true for test mode; otherwise, false . |
Yes |
merchant |
Object | — | Contains authentication data. | Yes |
merchant > apiLogin |
Alphanumeric | Min: 12, Max: 32 | User or login provided by PayU. How to get API Login. | Yes |
merchant > apiKey |
Alphanumeric | Min: 6, Max: 32 | Password provided by PayU. How to get API Key. | Yes |
transaction |
Object | — | Contains transaction data. | Yes |
transaction > order |
Object | — | Contains order details. | Yes |
transaction > order > id |
Number | — | ID of the order to be voided. | Yes |
transaction > type |
Alphanumeric | 32 | Set to VOID to cancel an authorized transaction. |
Yes |
transaction > reason |
Alphanumeric | — | Reason for voiding the transaction. | No |
transaction > parentTransactionId |
Alphanumeric | 36 | ID of the transaction to be voided. | Yes |
Response
Field Name | Format | Size | Description |
---|---|---|---|
code |
Alphanumeric | — | Response code of the transaction. Possible values: ERROR , SUCCESS . |
error |
Alphanumeric | Max: 2048 | Error message when the response code is ERROR . |
transactionResponse |
Object | — | Contains response details. |
transactionResponse > orderId |
Number | — | The generated or existing order ID in PayU. |
transactionResponse > transactionId |
Alphanumeric | 36 | PayU transaction ID. |
transactionResponse > state |
Alphanumeric | Max: 32 | Status of the transaction. |
transactionResponse > paymentNetworkResponseCode |
Alphanumeric | Max: 255 | Response code from the financial network. |
transactionResponse > paymentNetworkResponseErrorMessage |
Alphanumeric | Max: 255 | Error message from the financial network. |
transactionResponse > trazabilityCode |
Alphanumeric | Max: 32 | Traceability code from the financial network. |
transactionResponse > authorizationCode |
Alphanumeric | Max: 12 | Authorization code from the financial network. |
transactionResponse > responseCode |
Alphanumeric | Max: 64 | Response code related to the transaction status. |
transactionResponse > responseMessage |
Alphanumeric | Max: 2048 | Message related to the response code. |
transactionResponse > operationDate |
Date | — | Date when the response was generated in the PayU system. |
API Call
The following examples show the request and response bodies for this transaction type.
Request Example:
{
"language": "es",
"command": "SUBMIT_TRANSACTION",
"merchant": {
"apiKey": "4Vj8eK4rloUd272L48hsrarnUA",
"apiLogin": "pRRXKOl8ikMmt9u"
},
"transaction": {
"order": {
"id": "1400462414"
},
"type": "VOID",
"reason": "Reason for requesting the void of the transaction",
"parentTransactionId": "c8ec8737-7645-4756-a991-6e60a99eb4d9"
},
"test": false
}
Response Example:
{
"code": "SUCCESS",
"error": null,
"transactionResponse": {
"orderId": 1400462414,
"transactionId": "57546e0a-8275-48e3-af11-7d3dc7420bfe",
"state": "APPROVED",
"paymentNetworkResponseCode": "0",
"paymentNetworkResponseErrorMessage": null,
"trazabilityCode": "49263990",
"authorizationCode": "NPS-011111",
"pendingReason": null,
"responseCode": "APPROVED",
"errorCode": null,
"responseMessage": "APROBADA - Autorizada",
"transactionDate": null,
"transactionTime": null,
"operationDate": 1624880273010,
"referenceQuestionnaire": null,
"extraParameters": null,
"additionalInfo": null
}
}
Request Example:
<request>
<language>es</language>
<command>SUBMIT_TRANSACTION</command>
<merchant>
<apiKey>4Vj8eK4rloUd272L48hsrarnUA</apiKey>
<apiLogin>pRRXKOl8ikMmt9u</apiLogin>
</merchant>
<transaction>
<order>
<id>1400462466</id>
</order>
<type>VOID</type>
<parentTransactionId>50876ad6-46f2-4c8d-bb91-2f028b56ccb8</parentTransactionId>
</transaction>
<isTest>false</isTest>
</request>
Response Example:
<paymentResponse>
<code>SUCCESS</code>
<transactionResponse>
<orderId>1400462466</orderId>
<transactionId>5fbb1ab0-3d2e-448f-a0be-b0bcfb5501ae</transactionId>
<state>APPROVED</state>
<paymentNetworkResponseCode>0</paymentNetworkResponseCode>
<trazabilityCode>49263990</trazabilityCode>
<authorizationCode>NPS-011111</authorizationCode>
<responseCode>APPROVED</responseCode>
<responseMessage>APROBADA - Autorizada</responseMessage>
<operationDate>2021-06-28T06:57:44</operationDate>
</transactionResponse>
</paymentResponse>
Refunds
A refund is issued when a merchant voluntarily returns the payment to the shopper. This can happen due to customer dissatisfaction or when the product is out of stock. The REFUND
method reverses a previously captured transaction.
Refunds can be issued for the full amount or as a partial refund (PARTIAL_REFUND
).
Parameters for Request and Response
Request
Field Name | Format | Size | Description | Mandatory |
---|---|---|---|---|
language |
Alphanumeric | 2 | Language used in the request. This determines the language of error messages. See supported languages. | Yes |
command |
Alphanumeric | Max: 32 | Set to SUBMIT_TRANSACTION . |
Yes |
test (JSON)isTest (XML) |
Boolean | — | Set to true for test mode; otherwise, false . |
Yes |
merchant |
Object | — | Contains authentication data. | Yes |
merchant > apiLogin |
Alphanumeric | Min: 12, Max: 32 | User or login provided by PayU. How to get API Login. | Yes |
merchant > apiKey |
Alphanumeric | Min: 6, Max: 32 | Password provided by PayU. How to get API Key. | Yes |
transaction |
Object | — | Contains transaction data. | Yes |
transaction > additionalValues |
Object | — | Specifies the amount for a partial refund. Required for partial refunds. | No |
transaction > additionalValues > TX_VALUE |
Object | — | Contains the transaction amount details. Required for partial refunds. | No |
transaction > additionalValues > TX_VALUE > value |
Number | Max: 19 | Amount to be refunded. Required for partial refunds. | No |
transaction > additionalValues > TX_VALUE > currency |
Alphanumeric | 3 | ISO currency code. See accepted currencies. Required for partial refunds. | No |
transaction > order |
Object | — | Contains order details. | Yes |
transaction > order > id |
Number | — | ID of the order to be refunded. | Yes |
transaction > type |
Alphanumeric | 32 | Specifies the type of refund: - REFUND for full refunds.- PARTIAL_REFUND for partial refunds (if supported). |
Yes |
transaction > reason |
Alphanumeric | — | Reason for issuing the refund. | No |
transaction > parentTransactionId |
Alphanumeric | 36 | ID of the original transaction being refunded. | Yes |
Response
Field Name | Format | Size | Description |
---|---|---|---|
code |
Alphanumeric | — | Response code for the transaction. Possible values: ERROR , SUCCESS . |
error |
Alphanumeric | Max: 2048 | Error message when the response code is ERROR . |
transactionResponse |
Object | — | Contains response details. |
transactionResponse > orderId |
Number | — | The generated or existing order ID in PayU. |
transactionResponse > transactionId |
Alphanumeric | 36 | PayU transaction ID. |
transactionResponse > state |
Alphanumeric | Max: 32 | Transaction status. |
transactionResponse > paymentNetworkResponseCode |
Alphanumeric | Max: 255 | Response code from the financial network. |
transactionResponse > paymentNetworkResponseErrorMessage |
Alphanumeric | Max: 255 | Error message from the financial network. |
transactionResponse > trazabilityCode |
Alphanumeric | Max: 32 | Traceability code from the financial network. |
transactionResponse > authorizationCode |
Alphanumeric | Max: 12 | Authorization code from the financial network. |
transactionResponse > responseCode |
Alphanumeric | Max: 64 | Response code associated with the transaction status. |
transactionResponse > responseMessage |
Alphanumeric | Max: 2048 | Message associated with the response code. |
transactionResponse > operationDate |
Date | — | Date when the response was generated in the PayU system. |
API Call
The following examples show the request and response bodies for this transaction type.
Refund Request Example:
{
"language": "es",
"command": "SUBMIT_TRANSACTION",
"merchant": {
"apiKey": "4Vj8eK4rloUd272L48hsrarnUA",
"apiLogin": "pRRXKOl8ikMmt9u"
},
"transaction": {
"order": {
"id": "1400462687"
},
"type": "REFUND",
"reason": "Reason for requesting the refund of the transaction",
"parentTransactionId": "60e2080d-08b1-4db2-a54f-8bcbe8271662"
},
"test": false
}
Partial Refund Request Example:
{
"command":"SUBMIT_TRANSACTION",
"language":"es",
"merchant":{
"apiKey": "4Vj8eK4rloUd272L48hsrarnUA",
"apiLogin": "pRRXKOl8ikMmt9u"
},
"transaction":{
"additionalValues":{
"TX_VALUE":{
"value":"950",
"currency":"ARS"
}
},
"order":{
"id":"1400462690"
},
"parentTransactionId":"0486359b-a048-4b6b-9b72-af584e710e64",
"reason":"Reason for requesting the refund or cancellation of the transaction",
"type":"PARTIAL_REFUND"
}
}
Response Example:
{
"code": "SUCCESS",
"error": null,
"transactionResponse": {
"orderId": 1400462690,
"transactionId": null,
"state": "PENDING",
"paymentNetworkResponseCode": null,
"paymentNetworkResponseErrorMessage": null,
"trazabilityCode": null,
"authorizationCode": null,
"pendingReason": "PENDING_REVIEW",
"responseCode": null,
"errorCode": null,
"responseMessage": "1400462690",
"transactionDate": null,
"transactionTime": null,
"operationDate": null,
"referenceQuestionnaire": null,
"extraParameters": null,
"additionalInfo": null
}
}
Refund Request Example:
<request>
<language>es</language>
<command>SUBMIT_TRANSACTION</command>
<merchant>
<apiKey>4Vj8eK4rloUd272L48hsrarnUA</apiKey>
<apiLogin>pRRXKOl8ikMmt9u</apiLogin>
</merchant>
<transaction>
<order>
<id>1400462689</id>
</order>
<type>REFUND</type>
<reason>Reason for requesting the refund of the transaction.</reason>
<parentTransactionId>1d31ea44-0d8f-4e65-93ac-6be4347e5b40</parentTransactionId>
</transaction>
<isTest>false</isTest>
</request>
Partial Refund Request Example:
<request>
<command>SUBMIT_TRANSACTION</command>
<language>es</language>
<merchant>
<apiKey>4Vj8eK4rloUd272L48hsrarnUA</apiKey>
<apiLogin>pRRXKOl8ikMmt9u</apiLogin>
</merchant>
<transaction>
<additionalValues>
<entry>
<string>TX_VALUE</string>
<additionalValue>
<value>950</value>
<currency>ARS</currency>
</additionalValue>
</entry>
</additionalValues>
<order>
<id>1400462690</id>
</order>
<parentTransactionId>0486359b-a048-4b6b-9b72-af584e710e64</parentTransactionId>
<reason>Reason for requesting the refund or cancellation of the transaction</reason>
<type>PARTIAL_REFUND</type>
</transaction>
</request>
Response Example:
<paymentResponse>
<code>SUCCESS</code>
<transactionResponse>
<orderId>1400462691</orderId>
<transactionId>6cef020a-8006-4744-b7f9-d9a343807297</transactionId>
<state>PENDING</state>
<pendingReason>PENDING_REVIEW</pendingReason>
<responseMessage>1400462690</responseMessage>
</transactionResponse>
</paymentResponse>
Querying the Refund Status
As mentioned earlier, refund requests go through an approval process. PayU usually takes 1 to 3 days to review and either approve or reject the request. You can check the refund status using one of the following methods:
Checking the Status via the PayU Management Panel
-
Log in to the PayU Management Panel. In the left menu, expand the Transactions tab and select Sales Report.
-
Use the Filter my sales field to search for the order using the order ID or transaction ID.
-
Check the Status column to see whether the refund is approved, rejected, or still pending.
Checking the Status via the Queries API
You can also check the refund status using the Queries API. To do so, send a request with the order ID.
When you query an order, the system returns the most recent transaction associated with it.
The response can indicate one of three statuses:
-
Unresolved Request: The refund request is still under review. The order shows a
CAPTURED
status (result.payload.status
in the response).- The first transaction type is
AUTHORIZATION_AND_CAPTURE
(result.transactions.type
in the response). - The first transaction status is
APPROVED
(result.transactions.transactionResponse.state
in the response).
- The first transaction type is
-
Approved: A PayU customer service agent approved the refund request. The order shows a
REFUNDED
status (result.payload.status
in the response).- The first transaction type is
REFUND
(result.transactions.type
in the response). - The first transaction status is
APPROVED
(result.transactions.transactionResponse.state
in the response).
- The first transaction type is
-
Declined: A PayU customer service agent rejected the refund request. The order shows a
CAPTURED
status (result.payload.status
in the response).- The first transaction type is
REFUND
(result.transactions.type
in the response). - The first transaction status is
DECLINED
(result.transactions.transactionResponse.state
in the response).
- The first transaction type is
Handling Pending Refunds with the PayU Cancellations Module
This section will guide you on how to track the final status of a refund that you initiated through the PayU Cancellations Module, especially when you are relying on the Queries API for updates.
Manual Cancellations Module and Pending Refund Updates
When you request a refund through the Voids and Refunds API, PayU submits the request to the payment network. If the network rejects the refund, PayU initially returns a PENDING
status in the paymentResponse.transactionResponse.state
field.
In this scenario, PayU automatically activates the Cancellations Module to retry the refund. This process may involve multiple attempts, each generating a new refund ID, until a final status is reached. This mechanism improves refund success rates and reduces the need for merchants to submit multiple manual attempts.
To confirm whether the refund request submitted through the Voids and Refunds API has reached a final status (APPROVED
or DECLINED
), you should:
- Query its status using the Queries API (by order ID), or
- Wait for a notification via your configured webhook (
notifyUrl
for API integrations or the Confirmation Page for WebCheckout).
Notes
- If you do not want PayU to manage your refunds through the Cancellations Module, contact your account manager to disable this service. In that case, you will always receive the direct network response without PayU retries.
- In many countries, up to 99% of refunds processed via the Cancellations Module are approved. For partial refunds, the approval rate can reach 97%.
Identifying the Final Refund Status in the Queries API
To distinguish between your initial refund request and the attempts generated by the PayU Cancellations Module, use the order ID in the Queries API and check the following fields:
result > payload > status
– General order status (REFUNDED
if the full amount was refunded;CAPTURED
may indicate partial refunds).result > payload > transactions[] > id
– Refund transaction ID.result > payload > transactions[] > type
– Transaction type (REFUND
orPARTIAL_REFUND
).result > payload > transactions[] > source
– Source (EMPTY
= online refunds,CANCELLATIONS_MODULE
= retries via PayU Cancellations Module).result > payload > transactions[] > transactionResponse > state
– Refund status (PENDING
,APPROVED
,DECLINED
).result > payload > transactions[] > transactionResponse > operationDate
– Date and time when the refund was generated.result > payload > transactions[] > additionalValues > TX_VALUE > value
– Refund amount.result > payload > transactions[] > extraParameters > MANUAL_REFUND
– Indicates how the refund was processed (absent,TRUE
, orFALSE
).
Rules for Updating Refund Status
Follow these rules when updating your system:
MANUAL_REFUND |
Refund status | Meaning | Recommended action |
---|---|---|---|
Absent | PENDING |
Initial refund in process | Do not update |
Absent | DECLINED |
Initial request rejected; Cancellations Module activated | Do not update |
FALSE |
APPROVED |
Refund processed automatically by the Cancellations Module | Update status |
FALSE |
DECLINED |
Refund attempt failed via the Cancellations Module | Do not update |
TRUE |
APPROVED or DECLINED |
Refund finalized via the Cancellations Module | Update status |
Additional Considerations
- If the final status is
DECLINED
after the Cancellations Module operation, you may submit a new refund request via the Refunds API. When doing so, avoid updating based on previous transaction attempts — useoperationDate
andTX_VALUE
to track the correct refund attempt. - Always register one refund record per API request in your system, even if the Cancellations Module created multiple transactions.
- Update your refund record only when a final status is reached, following the rules above.
Identifying the Final Refund Status via Webhook
PayU also notifies you of the final refund status through your configured webhook (notifyUrl
for API integrations or Confirmation Page for WebCheckout).
Webhook Logic
- If the refund request status is
APPROVED
orDECLINED
, PayU immediately sends a webhook notification. - If the refund status is initially
PENDING
, no webhook is sent until a final status (APPROVED
orDECLINED
) is reached.
Webhook Update Rules
- If the initial status is
PENDING
, do not update the refund until you receive the webhook. - Once the webhook arrives, update the refund status accordingly (
APPROVED
orDECLINED
). - Use at least the following fields from the payload to identify the refund correctly:
transaction_type
– Transaction typevalue
– Refund amountresponse_message_pol
– Response messagetransaction_date
– Date and time of the transaction
Webhook Considerations
Unlike the Queries API, the webhook only notifies you once the refund reaches a final status. No notifications are sent for intermediate attempts (PENDING
) or retries within the Cancellations Module.
For this reason, we recommend implementing the webhook if you have not already done so. It allows you to update refund statuses automatically without applying the manual validation rules required for the Queries API.
This behavior applies when the following account settings are enabled:
- Allow reversal transactions with pending state: Off
- Activate pending response for voids and refunds: On