Menu

Partially refunding an order

Partially refunding an order

Copied!
curl https://api.worldpay.com/v1/orders/[your order code]/refund
    -H "Authorization:your-test-service-key"
    -H "Content-type: application/json"
    -X POST
    -d "{'refundAmount' : '100'}"
$worldpay = new Worldpay('your-test-service-key');

$worldpay->refundOrder('your-order-code', 100);
WorldpayRestClient restClient = new WorldpayRestClient("your-test-service-key");

OrderResponse orderResponse = restClient.getOrderService().refund('your-order-code', 100);
worldpay = Worldpay.new('your-test-service-key')

response = worldpay.refundOrder('your-order-code', 100)
WorldpayRestClient restClient = new WorldpayRestClient("https://api.worldpay.com/v1", "your-test-service-key");

restClient.GetOrderService().Refund('your-order-code', 100);

When refunding an order, if you pass an additional JSON object containing refundAmount, a partial refund can be requested, changing the paymentStatus to SENT_FOR_REFUND. A further partial or full refund can be requested once Worldpay receives acknowledgement from the Payment Provider - typically after 15 minutes. On partial refund completion, typically after 2 days, the paymentStatus is updated to PARTIALLY_REFUNDED. Multiple partial refunds can be performed per order until the order value is zero; after the final refund confirmation the paymentStatus will be REFUNDED.