Menu

Cancelling an order

Cancelling an order

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

try {
    $worldpay->cancelAuthorisedOrder('your-order-code');
} catch (WorldpayException $e) {
    echo 'Error code: ' .$e->getCustomCode() .'

    HTTP status code:' . $e->getHttpStatusCode() . '

    Error description: ' . $e->getDescription()  . '

    Error message: ' . $e->getMessage();
}
OrderService orderService = new WorldpayRestClient('your-service-key').getOrderService();
orderService.cancel("your-order-code");
worldpay = Worldpay.new("your-service-key")
worldpay.cancelAuthorisedOrder(orderCode);
WorldpayRestClient restClient = new WorldpayRestClient("https://api.worldpay.com/v1", "your-service-key");
restClient.GetOrderService().CancelAuthorizedOrder("your-order-code");

Authorized orders can be cancelled by sending a cancel request.