Skip to main content
Version: 3.0.0 (current)

Cancel an order

POST 

/v3/session/:sessionId/order/cancel

Cancel an order of a payment session. It is only possible to cancel an order that has order status order_approved_not_captured. If the order has been captured it is no longer possible to cancel the order as it should be refunded instead. It is also not possible to cancel a pending or rejected order.

Most payment providers confirm a cancellation right away and you get a 204. A few process it in the background and answer 202 with status: cancel_pending instead. In that case the order sits in order_cancel_pending and the authorization stays live until the provider replies. You then get an order_status webhook with one of:

  • order_cancelled - the cancellation went through. An authorization that had already expired ends up here too, since it can no longer be captured. Look at transaction.status to tell them apart: cancelled or expired.
  • order_approved_not_captured - the provider refused the cancellation. The order is back where it was and can still be captured.

Request

Responses

The cancellation is accepted but not confirmed yet. The order is now order_cancel_pending and the authorization stays live until the provider replies. Wait for the order_status webhook - see the endpoint description for the outcomes.