Request a Refund

The Refund a Transaction endpoint allows merchants to request a refund for a transaction. Below is a step-by-step guide on how to request a refund through the API.

Refund Flow

  1. Merchant → PagSeguro: Merchant requests a refund from PagSeguro.
  2. PagSeguro → Merchant: PagSeguro receives the data and returns the refund identifier to the Merchant.
  3. PagSeguro: PagSeguro processes the data transferred by the Merchant.
  4. PagSeguro → Merchant: PagSeguro notifies the Merchant of the transaction status change.
  5. Merchant: Merchant receives the notification and updates the order status.

Refund Eligibility

To determine whether a transaction is refundable, you can check the refundable parameter in the Search Transaction Using Transaction Code endpoint. If the transaction is refundable, the API will return true for this parameter.

Additionally, you can validate which payment methods are refundable by PagSeguro by referring to the list of payment methods available by country (!!!!!ADD PAGE LINK!!!!).

Examples

To request a refund for a transaction, make a request to the Refund a Transaction endpoint, as shown in the example below.

The response will contain details about the refund request, such as ID, amount, and status.

{
    "notification_url": "https://www.merchantwebsite.com/notify?type=refund",
    "amount": 101.1,
    "reference": "REF-XXX-1234567890"
}
{
    "id": 35,
    "reference": "REF-XXX-1234567890",
    "amount": 100.1,
    "status": "requested",
    "created_at": "2021-04-12T11:16:55Z",
    "updated_at": "2021-04-12T11:16:55Z"
}