Behio Storefront SDK
Customer

Withdrawal and Returns

The EU online withdrawal function, returns and complaints, with acknowledgement by e-mail

Overview

Since 19 June 2026 every online shop selling to consumers in the EU must offer an online withdrawal function (Art. 11a of Directive 2011/83/EU, inserted by Directive 2023/2673). The consumer opens a clearly labelled link, states their name, the order and the e-mail for the confirmation, confirms, and immediately receives an acknowledgement on a durable medium (e-mail) with the content of the statement and the date and time of submission.

Behio does the legal part on the server: it records the statement, computes the withdrawal period, sends the acknowledgement (even when the merchant switched the return e-mail off) and notifies the merchant. The template only has to render the link and the two-step form.

The merchant switches the function on or off and may extend the period in Settings → Cart and order → Withdrawal from contract. It is on by default with 14 days. getShopInfo() returns the setting:

const {data: shop} = await storefront.getShopInfo();
if (shop?.withdrawal?.enabled) {
  // render "Withdraw from contract here" in the footer and in the customer account
}

Placement and labels

  • Put the link in the footer of every page and in the customer account (order detail). It must stay available for the whole period.
  • Use an unambiguous label: "Withdraw from contract here" (cs "Odstoupit od smlouvy", sk "Odstúpiť od zmluvy").
  • The confirmation button must be labelled "Confirm withdrawal" (cs "Potvrdit odstoupení").

Two-step flow

Step 1 identifies the order (POST, so the e-mail never lands in a URL) and prefills the name:

const {data: order, error} = await storefront.returns.lookupOrder(orderNumber, email);
// order.customerName: name from the billing address (prefill, editable)
// order.items[].returnableQuantity: units not yet covered by another request
// order.withdrawal: {enabled, periodDays, deadlineAt, withinPeriod, flags}

Step 2 shows a summary of the statement and the Confirm withdrawal button. Only that button calls withdraw:

const {data: ack, error} = await storefront.returns.withdraw({
  orderNumber,
  email,
  name,
  // items: [{orderItemId, quantity}], omit to withdraw from the whole order
  note, // optional
  confirmed: true,
});

The response is the acknowledgement to display: submittedAt (date and time), items, deadlineAt, withinPeriod and confirmationSent, which says whether the e-mail really went out. With React use useLookupReturnableOrder() and useSubmitWithdrawal().

A withdrawal is never refused because the period has passed or because the goods may be exempt (custom-made goods, digital content after consent): the consumer may always submit the statement and the merchant decides. Such requests carry flags for the merchant (AFTER_DEADLINE, DIGITAL_CONTENT_CONSENT). BEFORE_DISPATCH tells the merchant to stop the shipment.

Errors

KeyWhen
be.storefront.orderNotFoundUnknown order or the e-mail does not match (same answer for both, so order numbers cannot be probed)
be.storefront.withdrawalAlreadySubmittedEvery item of the order is already covered by a withdrawal or a return
be.storefront.withdrawalDisabledThe merchant switched the function off
be.storefront.orderCancelledNotReturnableThe order was cancelled
be.validation.failedMissing confirmed: true, name or a valid e-mail

The endpoint is rate limited (10 requests per minute per visitor).

Returns and complaints

returns.submit() records a return or a complaint with a reason (DEFECTIVE, WRONG_ITEM, NOT_AS_DESCRIBED, ...). Storefronts built before 2.25.0 send withdrawals through it with the reason CHANGED_MIND; the server records those as withdrawals too, with the same acknowledgement, so older templates comply without a redeploy.

returns.getStatus(returnId, email) returns the current state, including type (WITHDRAWAL or RETURN).

On this page