On this page
  1. Enable the action
  2. Access checks
  3. Recommended policy

Let customers cancel their own orders

The customer cancellation action is available in the signed-in customer's order view. It is separate from the Admin status allowlist.

Enable the action

  1. Open Stores > Configuration > MageB2B > Order Cancellation.
  2. In General settings, select one or more values under Allowed Order Statuses for Customer Cancellation.
  3. Save the configuration and clear the relevant Magento caches.
  4. Sign in as a customer who owns an order with one of those statuses.
  5. Open My Account > My Orders, then open the order.

The Cancel Order action appears only while the order has an allowed status. The customer must confirm the action.

Customer order view for a pending order with the Cancel Order self-service action

Access checks

The request is submitted as a POST action with Magento form-key protection. The controller also checks that the customer is signed in and owns the requested order. A customer cannot use the action to cancel another customer's order.

Guest orders do not have an authenticated customer account owner, so this self-service action does not apply to them.

Limit customer cancellation to statuses used before fulfillment, capture or invoicing. Test the action with each payment method and downstream order integration in use. A status name alone does not tell you whether an external payment or warehouse process has already started.

Display preferences

Adjust how this website is displayed. Changes apply immediately.

Text size
Text spacing
Reading aids

Follows the pointer. Move it with Alt + Up/Down outside input fields. Hidden while a dialog is open.

Uses the voices provided by your browser, which may use an online service. Reading starts only when you press Read aloud.

Your choices are saved in this browser for this website.