To refund a payment, you must call the API method refund. A payment can be refunded if, and only if, its status confirmed (CO). Open (OP) or pending (PE) payments (CO) cannot be refunded, only cancelled.
The refund flow works as stated in the following diagram:
The merchant requests the refund through the Merchant Area or through the API. This refund request gets directly into EBANX refund queue, marked as Requested. EBANX then acknowledges the refund and the refund is marked as Pending. When the customer receives the money back (in his bank account or through his credit card), the refund transitions its state to Confirmed. When the refund is Requested or Pending, it can be cancelled by the merchant.
Some important remarks about refunds in EBANX:
Each payment can have many refunds, given that the sum of their amounts does not exceed the original payment amount. Cancelled refunds do not count toward this sum.
Only confirmed payments (CO) can be refunded.
The currency of the refund is the same as the original payment.
A successful request will return a JSON expression similar to the one below.