Refunds¶
A Refund reverses the payment to the consumer.
curl -X POST \
https://api.test.payments.worldline.com/api/v2/merchants/1570616552/orders/order_example_1/refunds \
-H 'Accept: application/json' \
-H 'Content-Type: application/json'
-H 'Authorization: Bearer 573cec25a87526dcceacad786bbbba83b1a5172'
POST /api/v2/merchants/1570616552/orders/order_example_1/refunds HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Bearer 573cec25a87526dcceacad786bbbba83b1a5172
{
"amount": {
"amount": 10.50,
"currency": "EUR"
}
}
<RefundOrderRequest>
<OrderInfo>
<OrderId>order_example_1</OrderId>
</OrderInfo>
<RequestInfo>
<TransactionChannel>Web Online</TransactionChannel>
<TimeoutSeconds>45</TimeoutSeconds>
</RequestInfo>
<MerchantInfo>
<MerchantId>1570616552</MerchantId>
</MerchantInfo>
<PayInfo>
<Amount>10.50</Amount>
<Currency>
<AlphabeticCode>EUR</AlphabeticCode>
</Currency>
</PayInfo>
</RefundOrderRequest>
The RefundOrder response will have the RefundedAmount updated with the total amount of successful RefundOrder requests. The response will also contain the individual credit and/or payout transaction results.
You must always refer back to a previous payment, either by an orderId, or an orderId and transactionId.
- When referencing by orderId only (not a transactionId), the system will issue a refund for all payment transactions on the order. This may result in more than one refund transaction in the response.
- When referencing by transactionId, the system will issue a refund for that transaction only. The response will only contain one transaction.
You cannot refund a higher amount than what has been successfully paid, if the merchant configuration is not specifically set to allow higher amounts.
For cards, and refunds involving Payout transactions, you may do partial refunds, i.e. multiple refunds on the same order, up to the total amount that was paid.
Some payment methods do not support an automated reversal of the money flow, and therefore more account details must be collected by the consumer to complete the refund via a Payout. Contact your integration manager for more details.
RefundOrder retry support¶
The RefundOrder method supports retries. i.e., the request can be sent multiple times with the same parameters without any side effects, until a terminal response is received. This is useful if e.g., the response from the bank is delayed, not received at all or pending, but a terminal response is still required by the merchant.
In order to use the retry capability, the merchant defined RequestId
parameter must be included in the first and all subsequent retried RefundOrder requests within the same scope. The RequestId must be unique per MerchantId.