Refunding an order

Refunding an order

    -H "Authorization:your-test-service-key"
    -H "Content-type: application/json"
    -X POST
$worldpay = new Worldpay('your-test-service-key');

WorldpayRestClient restClient = new WorldpayRestClient("your-test-service-key");

worldpay ='your-test-service-key')

WorldpayRestClient restClient = new WorldpayRestClient("", "your-test-service-key");


Refund a order through a POST on the Order Refund API URL, without any request body. An order can be refunded once Worldpay receives capture confirmation from the Payment Provider. This typically occurs within 15 minutes, but can take significantly longer depending on the Payment Provider.

Note: You cancancelan AUTHORIZED order

Live orders are refunded using theLive Service Keyand test orders are refunded using theTest Service Key, in the Authorization http header.

When a refund is requested, the paymentStatus is changed to SENT_FOR_REFUND. Once the refund is complete, typically after several days depending on the Payment Provider, the paymentStatus changes to REFUNDED.