During Black Week, scarce promo stock is often gone before the first parcel leaves the warehouse. Part of it has not actually been sold, only ordered: prepayment orders for which no bank transfer ever arrives. In Shopware, stock drops when the order comes in, not when the payment does (Shopware documentation). The item shows as sold out, customers who are ready to pay go elsewhere, and the goods wait for money that is not coming. This article shows how to end unpaid prepayment orders automatically after a fixed deadline and release the promo stock: with a rule per payment method, a reminder, cancellation and restocking, built as a custom extension for Shopware.
Why unpaid prepayment ties up scarce stock
Shopware 6 separates the order from the payment. The order is created as soon as the customer clicks the button to place an order with obligation to pay; the payment status initially remains “Open” (Shopware documentation). With payment methods that redirect to a payment service provider, payment usually follows right away. With prepayment, the shop waits for a bank transfer that arrives days later or not at all. When the order is placed, Shopware starts at least three state machines for it, one each for the order, the payment and the delivery (Shopware developer documentation).
The waiting does not affect stock. Stock is reduced when the order comes in (Shopware documentation). If an item is marked as closeout, it cannot be sold beyond the available stock (Shopware documentation). For a promotion with a small quantity, a few open prepayment orders are enough to make the item unavailable to everyone else, even though not a single euro has been paid. Without the closeout flag, the item stays orderable, but stock goes negative and the shop sells goods it may not be able to restock.
In Black Week, this meets high demand. For Black Friday and Cyber Monday 2025, the German Retail Federation expected revenue of 5.8 billion euros (HDE). About one in two, 52% of the internet users aged 16 and over surveyed in Germany, planned to take advantage of the reduced prices in 2025, most of them online (Bitkom). Tying up goods in these days in orders that do not get paid means losing sales to customers who would have paid.
How large the share of prepayment is in your own revenue can only be seen in your own shop data. The study “Payment behavior in Germany 2025” gives a frame of reference: in the payment diary of the private individuals surveyed, direct debits and bank transfers accounted for 30% of payment transactions for online purchases and internet payment methods for 50% (Deutsche Bundesbank). Prepayment by bank transfer is part of those 30%; the study does not give a separate figure for prepayment at this point.
Anyone advertising a promotion at a specific price must disclose it if the goods foreseeably will not be available for a reasonable period in a reasonable quantity; if the stock lasts less than two days, the business has to prove that this was reasonable (UWG, Annex No. 5). Goods tied up by unpaid orders are not available to customers who are ready to pay. What this means for quantity notices and presentation is covered in our article Out of stock: what happens to unavailable products.
What standard Shopware handles and what it does not
Shopware’s stock management is designed for restocking. According to the developer documentation, stock is incremented and decremented as orders are placed, modified, canceled and refunded (Shopware developer documentation). The field product.stock is the primary source for the current stock (Shopware developer documentation). When an open prepayment order is canceled, the goods therefore go back into available stock without anyone correcting the quantity by hand.
What is missing is the trigger. The settings of the Community Edition do not provide a deadline after which unpaid prepayment orders are canceled on their own. The time limit that Shopware does know in the payment process applies to payments that redirect to a payment service provider: without a custom entry, a default of 60 minutes applies there (Shopware documentation). For a bank transfer, which needs no redirect, this value plays no role.
The Flow Builder only helps in part. It reacts to status changes, for example when a payment reaches the status “Reminded” or an order is canceled (Shopware documentation). Actions that are only triggered after a certain period, on the other hand, are available only in a paid plan (Shopware documentation). For the deadline itself, the Community Edition therefore needs an extension. How triggers, conditions and actions work together is explained in our article on the Flow Builder in Shopware.
For individual cases, the Administration is enough: orders can be filtered by payment status and payment method and canceled in bulk. How this works after sales events is shown in the article on bulk editing of orders. In Black Week, however, this turns into daily manual work that depends on one person and their calendar. Customers can also cancel their order themselves in their account if the shop enables this under “Allow cancellations” (Shopware documentation); waiting for that is not a plan for promo stock, though.
| Task | Standard Shopware (Community Edition) | With a custom extension |
|---|---|---|
| Stock on order | drops when the order comes in | unchanged, the standard stays |
| Stock on cancellation | rises with the cancellation | standard, triggered by the extension |
| Deadline per payment method | no setting | days per payment method and sales channel |
| Payment reminder | set status “Reminded” by hand | automatic after the reminder period |
| Cancellation after the deadline | by hand or via bulk edit | automatic, after checking incoming payment |
| Emails to customers | Flow Builder on status changes | unchanged via the Flow Builder |
| Traceability | status history per order | plus run and exception log |
Legal basis first: deadline in terms and order confirmation
Before a shop cancels orders automatically, it has to be clear whether a contract exists at all. Your terms and conditions govern this. The shop must confirm receipt of the order electronically without undue delay (Section 312i BGB). This confirmation of receipt is not necessarily the acceptance of the offer; whether it is depends on its wording together with the terms. Some terms provide for acceptance of prepayment orders only with the payment request or with shipping, others already with the order confirmation.
If, according to the terms, the contract is only concluded on receipt of payment or on shipping, an unpaid order is not yet a contract. The shop then does not accept the offer, and the cancellation email says so. If the contract has already been concluded, however, rescission is required. The law governs it as follows:
If, in the case of a reciprocal contract, the obligor does not render an act of performance which is due, or does not render it as contractually agreed, then the obligee may rescind the contract, provided the obligee has specified, without result, an additional period of time for performance or cure.
Section 323 (1) German Civil Code (BGB), English translation on gesetze-im-internet.de
For the automation, this means: the payment must be due, and the shop must have set a reasonable deadline that has expired without payment (Section 323 BGB). If no time for performance has been specified, the obligee may demand it immediately (Section 271 BGB); with prepayment, payment is therefore usually due when the contract is concluded. Rescission itself is effected by declaration to the other party (Section 349 BGB). The cancellation email is thus not just information but the declaration itself. It must reach the customer and state clearly that the contract has been rescinded.
In practice, this means: state the payment deadline in the terms and in the order confirmation with a specific date, send a reminder before it expires and, in the reminder, set a deadline that is reasonable under your terms. The law does not say in days how long a reasonable deadline is; that depends on the individual case, and you should not shorten deadlines for Black Week without legal advice. Our article on failed payments in online shops covers refusal of performance, default and deadlines for payment failures as a whole.
This article describes the technical implementation and the legal framework in outline; it does not replace legal advice. Whether your terms set the payment deadline effectively, when your contract is concluded and what wording the cancellation email needs are questions to clarify with your legal counsel before the automation goes live.
Release per payment method: deadline, reminder, cancellation
Not every payment method needs a release rule. In standard Shopware, four payment methods are active: cash on delivery, invoice, prepayment and direct debit (Shopware documentation). With invoice and cash on delivery, the goods ship before payment, so releasing stock makes no sense there. With direct debit, the shop collects the amount itself. With payments through a provider with a redirect, the outcome is usually decided within minutes. Prepayment is typically the payment method where stock stays tied up the longest without anything in return.
| Payment method | Payment deadline | Reminder | Cancellation after deadline |
|---|---|---|---|
| Prepayment | 7 days from order | after 3 days | yes, with restocking |
| Prepayment, promo items | own rule, legally reviewed | earlier than standard | yes, with restocking |
| Invoice | as per invoice | dunning process | no, the goods have shipped |
| Direct debit | not applicable | not applicable | no, returned debits handled separately |
| Cash on delivery | not applicable | not applicable | no |
| Payment with redirect | validity of the payment token | flow for failed payment | per the payment provider’s process |
The values in the table are examples, not a recommendation for your shop. What matters is that the rule depends on the payment method rather than on the order as a whole, and that it may differ per sales channel: a B2B channel with purchase on invoice needs different deadlines from the shop for consumers. For promo stock, a separate rule can apply, for example via a property or a tag that marks the promo items. Whether a shorter deadline for promo stock is reasonable, however, is a legal question, not a technical one.
Deadline per payment method
Days until the reminder and until cancellation, separated by payment method and sales channel, maintained in the extension’s configuration instead of in code.
Check before cancellation
Before every cancellation, the extension reads the current payment status again and skips orders with a partial payment or a manual lock.
Status changes instead of custom emails
The extension only sets statuses. The Flow Builder sends the emails via the triggers for the payment reminder and the canceled order.
Restocking via the standard
Shopware’s stock management restocks the goods on cancellation. There is no need to write product.stock separately.
The custom extension: a scheduled task
Shopware comes with its own mechanism for recurring jobs, the scheduled task. An extension registers a task and a handler: the task describes when work is due, the handler does it (Shopware developer documentation). The interval is set in seconds by the method getDefaultInterval() (Shopware developer documentation). For a payment deadline counted in days, one run per hour is enough. Since Shopware 6.7.13.0, the handler can also set the next run itself to the next record that is due (Shopware developer documentation).
The handler works through three steps per run. It looks for open prepayment orders whose reminder period has expired and sets their payment status to “Reminded”. It looks for orders whose payment deadline has expired, checks the payment status again and cancels them. And it writes a log with the order number, the old and new status and the reason. The query uses the ID of the payment method and the status of the latest transaction, not the display name of the payment method, which differs by language.
<?php declare(strict_types=1);
namespace Example\PrepaymentRelease\ScheduledTask;
use Shopware\Core\Checkout\Order\Aggregate\OrderTransaction\OrderTransactionDefinition;
use Shopware\Core\Checkout\Order\OrderDefinition;
use Shopware\Core\Framework\Context;
use Shopware\Core\Framework\MessageQueue\ScheduledTask\ScheduledTaskHandler;
use Shopware\Core\System\StateMachine\Aggregation\StateMachineTransition\StateMachineTransitionActions;
use Shopware\Core\System\StateMachine\Transition;
use Symfony\Component\Messenger\Attribute\AsMessageHandler;
#[AsMessageHandler(handles: UnpaidPrepaymentTask::class)]
final class UnpaidPrepaymentTaskHandler extends ScheduledTaskHandler
{
// Constructor with rules per payment method, payment matching,
// StateMachineRegistry and logger omitted here
public function run(): void
{
$context = Context::createDefaultContext();
// Step 1: reminder, payment status open -> reminded
foreach ($this->rules->dueForReminder($context) as $transactionId) {
$this->move(OrderTransactionDefinition::ENTITY_NAME, $transactionId,
StateMachineTransitionActions::ACTION_REMIND, $context);
}
// Step 2: deadline expired, check incoming payment again before canceling
foreach ($this->rules->dueForCancellation($context) as $order) {
if ($this->payments->hasIncomingPayment($order->orderId, $context)) {
$this->logger->info('Payment received, no cancellation', ['order' => $order->orderId]);
continue;
}
$this->move(OrderTransactionDefinition::ENTITY_NAME, $order->transactionId,
StateMachineTransitionActions::ACTION_CANCEL, $context);
// Cancel the order: stock management restocks the goods
$this->move(OrderDefinition::ENTITY_NAME, $order->orderId,
StateMachineTransitionActions::ACTION_CANCEL, $context);
}
}
private function move(string $entity, string $id, string $action, Context $context): void
{
$this->stateMachineRegistry->transition(
new Transition($entity, $id, $action, 'stateId'),
$context
);
}
} The example is deliberately shortened: error handling, locks against duplicate runs and the dry run are missing. Two points decide whether the automation holds up in daily operation. First, the queue has to be running. A task that is due is only executed once a worker processes the dispatched messages (Shopware developer documentation). In production, Shopware recommends processing this via the command line instead of in the Administration’s browser, so that tasks are also completed when no one is logged in (Shopware developer documentation). With managed Shopware hosting, this worker is part of operations. Second, every cancellation needs a fresh look at incoming payments.
Check incoming payment before canceling
The most serious mistake such an automation can make is canceling a paid order. With prepayment, there is a chain between the bank transfer and the status change in the shop: the customer’s bank, your own bank, the account statement, matching in the shop or in the ERP system. The payer’s payment service provider must ensure that the amount reaches the payee’s payment service provider at the latest by the end of the business day following receipt of the payment order (Section 675s BGB). For a transfer initiated on paper, this period may be extended by a further business day (Section 675s BGB). A transfer made on the last day of the deadline may therefore only show up in the account after that, and a weekend pushes it back further.
- Match the account before the run: the deadline task only runs after the day’s transactions have been matched, whether via bank import in the ERP system or via an integration with ERP and accounting.
- Grace period after the deadline: an extra day between the deadline and the cancellation catches transfers made on the last day.
- Exclude partial payments: if the payment status is “Partially paid”, the automation does not cancel but flags the case for review.
- Keep instant transfers in mind: with instant transfers, the merchant is credited with the amount almost in real time (Deutsche Bundesbank). Fetching account transactions several times a day catches such payments before the cancellation.
- Manual lock: a custom field on the order, for example for an arrangement with the customer, takes it out of the automation.
Then you need a fixed process: either the shop refunds the amount, or it offers the goods again if they are still in stock. Simply reopening a canceled order is risky because the stock may have gone to other customers in the meantime. Decide in advance and word the cancellation email so that it mentions this case.
Restock and sell promo items again
Once the order is canceled, stock management does the rest. It adjusts stock automatically when orders are placed, canceled or completed (Shopware developer documentation). What matters is the right status: cancellation works via the order status “Canceled”, and only this status resets the stock; setting the payment or delivery status to “Canceled” is not enough (Shopware documentation). The item can then be ordered again, even if it is marked as closeout, because the available stock has gone up. An extension that also increments product.stock itself would restock the goods twice.
The situation is different if stock management is turned off. Shopware allows this via the setting enable_stock_management; product.stock is then no longer updated automatically on orders (Shopware developer documentation). This is typical when an ERP system manages stock. The release then has to reach the ERP system, or the item stays sold out in the shop until the next sync runs. How a near-real-time sync is set up is described in our article on real-time inventory sync.
Marketplaces belong in the picture too. If you sell promo stock on marketplaces in parallel, check whether the restocked quantity arrives there while the promotion is still running. An integration with marketplaces usually takes stock from the shop or from the ERP system; what matters is how often it syncs.
An item that has stock again after the cancellation can be ordered in the shop again. If you offer a back-in-stock notification, you can inform interested customers after the release, provided they have given consent.
Reminder and cancellation email: what they should say
The extension only sets the status. The Flow Builder sends the emails, triggered by the status changes. Texts and layout thus stay in the email templates in the Administration and can be adjusted without development. How the order confirmation and other transactional emails are built properly is shown in our article on transactional emails in Shopware. The payment reminder should contain:
- order number, amount and bank details with the payment reference
- the date by which payment must have arrived, not just a number of days
- a note that the order will then be canceled and the goods released
- a link to the order in the customer account or for guests, to switch to another payment method if the shop allows this
- a contact option for questions, for example if the transfer is already on its way
If a contract has been concluded, the cancellation email is the declaration of rescission. It names the order, states clearly that the contract has been rescinded because payment was not received, and explains what happens to a late transfer. If no contract has been concluded yet under your terms, it says accordingly that the order is not accepted.
If you also cancel orders by hand via bulk edit during Black Week, set the option for status emails there deliberately. Otherwise, depending on the flow configuration, customers receive two emails for the same cancellation.
For this week and for December
This article is published in the middle of Black Week. An extension that still has to be developed and tested cannot sensibly go live before Cyber Monday. For the current sales days, there is an interim solution with built-in tools: once a day, filter the order overview by payment status “Open” and payment method prepayment, check orders whose deadline has expired and cancel them via bulk edit.
For December, the automation still pays off. Open prepayment orders from Black Week tie up goods precisely in the weeks before Christmas. For November and December 2026, HDE expects Christmas revenue of 23.1 billion euros in online retail, a nominal increase of 4.1% over 2025 (HDE). Every item that becomes available again during this time can go to paying customers. The rollout works in five steps:
- Define the rules: deadlines per payment method and sales channel, aligned with the terms and order confirmation.
- Dry run: at first, the extension only logs which orders it would remind and cancel.
- Test in the staging environment: test orders with prepayment, payment arriving shortly before the deadline, partial payment and guest orders.
- Check the emails: trigger the flows for the payment reminder and the cancellation with test addresses and agree the wording with your legal counsel.
- Go live and monitor: read the log daily in the first weeks and spot-check stock before and after the run.
After promotions, it is also worth looking at the opposite direction: customers who pay and then send part of the order back need a correctly calculated refund. This is covered in our article on partial returns after a promotion.
How we support the implementation
We develop release rules for unpaid orders as an extension for Shopware 6, tailored to your payment methods, sales channels and your ERP system. As a Shopware agency, we work with the status logic of orders, payments and deliveries every day.
Custom-built extension
Scheduled task, rules per payment method and sales channel, dry run and log, developed as part of our custom programming.
Matching against incoming payments
A check of incoming payments before every cancellation, connected to bank import or the ERP system via our integrations.
Testing before go-live
A test in the staging environment with prepayment, partial payment and late transfer before the automation works in the live shop.
Whether an automation pays off for your shop depends on how many prepayment orders remain open and how scarce your promo stock is. An analysis of the open orders from the last sales days is a good start. Get in touch with us if you want to set up the rule for your next promotion.
This article is based on the Shopware documentation (orders, products, payment methods, cart, Flow Builder) and the Shopware developer documentation (Stock, Stock Configuration, Orders, Add Scheduled Task, Message Queue), on the German Civil Code (Sections 271, 312i, 323, 349 and 675s BGB) and the annex to Section 3 (3) UWG (No. 5) as published on gesetze-im-internet.de, on the press releases of the German Retail Federation (HDE) of November 17, 2025 and November 3, 2026, the Bitkom press release of November 24, 2025 and the study “Payment behavior in Germany 2025” by Deutsche Bundesbank. All information retrieved on November 4, 2026. Forecasts and survey values may vary depending on the time.
By default, yes. In Shopware, stock is reduced when the order comes in, not only when payment arrives (Shopware documentation). With scarce promo stock, an item can therefore appear sold out even though some of the orders are not paid.
Not in the standard Community Edition. A payment deadline with automatic cancellation cannot be set there, and delayed actions in the Flow Builder belong to a paid plan (Shopware documentation). This is usually solved with an extension that checks deadlines per payment method as a scheduled task.
With stock management turned on, usually yes: Shopware adjusts stock when orders are canceled (Shopware developer documentation). If an ERP system manages stock and stock management in the shop is turned off, the release has to be booked there.
That depends on whether a contract already exists under your terms. If it has been concluded, rescission is typically only possible after a reasonable deadline for payment has expired without result (Section 323 BGB), and it is effected by declaration to the customer (Section 349 BGB). You should set deadlines and wording with your legal counsel.
The law does not give a fixed number; it requires a reasonable deadline (Section 323 BGB). Keep the transfer time in mind: the amount must reach the payee’s payment service provider at the latest by the end of the business day following receipt of the order, possibly one business day later for a transfer on paper (Section 675s BGB), plus weekends and your own account matching. The specific deadline belongs in the terms and the order confirmation.
For the current Black Week, a newly developed extension is usually too tight, because testing and agreeing the emails take time. As an interim solution, a daily pass through the order overview with a filter for open prepayment orders and cancellation via bulk edit helps. The automation can then be built calmly for December and the next promotions.