Refund PIX Transaction
Introduction
- Only
CREDIT
transactions can be refunded, either partially or fully. - A single
CREDIT
transaction may undergo multiple partial refunds, provided the total refund amount does not exceed the original transaction value. - Refunds can be executed within 90 days following the original
CREDIT
transaction date.
How to Refund a PIX Transaction
To initiate a refund, call the Refund Transaction Endpoint endpoint. The code snippet below demonstrates how to make the request with the necessary headers and payload:
curl --request POST\
--url https://faas.sandbox.tracefinance.io/pix/api/transactions/{transactionId}/refund \
--header 'authorization: Bearer {accessToken}' \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '
{
"amount": {
"value": 10000
},
"motive": "PROCESSING_ERROR",
"idempotentId": "24b2ae17-5a58-4465-acbb-45e11fdc2496",
"additionalInfo": "Client canceled the purchase",
"bankAccountId": "9008369c-8837-43c7-b5f2-0229622bd21c"
}
'
Parameters:
- Replace
{transactionId}
path parameter with the ID of theCREDIT
transaction you wish to refund.(required) - The
idempotentId
is a unique identifier to prevent duplicate refund requests. (required) - The
additionalInfo
field is optional and may be used to provide context for the refund request to the banking team. (optional) bankAccountId
is the bank account designated to receive the PIX transaction. This information is required only if you have more than one bank account. (conditionally required)
Refund Types
- If the
amount
field is omitted or set asnull
, a full refund is processed, changing the original transaction status toREFUNDED
, and creating a newREFUND
transaction. - If a specific
amount
is specified, a partial refund is initiated. The original transaction's status becomesPARTIALLY_REFUNDED
, and a newREFUND
transaction is formed. Once the combined value of all partial refunds equals the original transaction's value, its status updates toREFUNDED
.
What Happens Next
When a refund is requested for a transaction, a Debit Refund Transaction is created, triggering the following events:
- A TRANSACTION_CREATED is issued for a new
REFUND
transaction, including theoriginalTransactionId
for tracking purposes. - A TRANSACTION_PROCESSING is sent when the new
REFUND
transaction is being processed. - A TRANSACTION_COMPLETED is sent once the
REFUND
transaction is successfully processed, marking the completion of the refund operation.
After the Debit Refund Transaction is completed, the original credit transaction that was refunded will have its status updated to either REFUNDED
or PARTIALLY_REFUNDED
(in cases where the refunded amount was partial).
- A TRANSACTION_REFUNDED is dispatched for the original credit transaction.
Updated 2 months ago