Shop (the commerce module)
The shop lets a client sell physical products from their own site. Products and categories are ordinary content.
Visitors fill a cart, enter delivery details and pay on Mollie's hosted payment page. The business ships, cancels or
refunds the orders and keeps the stock count up to date. It is a server package (commerce, shown as Shop) that an
admin installs and switches on in the Modules screen. It requires the payments module and builds on
email: switch payments on first, with its Mollie key, and set up email, or the shop cannot
be switched on.
What users can do
Editors and admins:
- Write Products and Categories in the admin's Shop group, with drafts, versions and publishing (collections, versions). Only published products can be sold. A product has up to 50 variants (each with SKU, label, price, weight and a "Track stock" switch) and up to 12 images.
- Build the product pages from one page marked as the products' template (pages), and list products on a page with a Repeat for each over the Products source.
- On the Orders screen: search and filter orders, mark paid orders shipped (with carrier and tracking number), cancel unpaid ones, refund paid ones in full or in part, and download invoices and credit invoices.
- On the Stock tab: set how many of each tracked SKU are in stock (up to 2,000 tracked SKUs; with more, the tab says so).
- With the Shop manager role: make Promotions (a percentage or amount off, or free shipping) that apply automatically or with a discount code, and issue the codes.
- Admins also switch the shop on and off and set its settings on the Modules screen.
Visitors, on pages with the shop's starter components (see On the website):
- Add products to a cart, change quantities, see the total with shipping and VAT for their country, enter name, email and delivery address, and pay through Mollie. Running promotions show in the cart, and a discount code can be typed there.
- Return to the order page and see as soon as the payment goes through. A confirmation email with the invoice (PDF) follows once paid, and a credit invoice with each refund.
- Signed in, see the orders placed with their address (My orders starter), and keep a name and delivery address on
the account (
GET,PUTandDELETE /my/profile; no starter shows them yet).
AI users can read products and write product drafts. They cannot see orders or who ordered, but get three read-only tools for the shop's numbers (For AI assistants).
Who may do it
| Action | Permission | Roles |
|---|---|---|
| Products: read, create, update | collections.commerce-products.read/create/update | admin, editor, ai (drafts only) |
| Products: publish, delete | collections.commerce-products.publish/delete | admin, editor |
| Categories: everything | collections.commerce-categories.* | admin, editor (no AI access) |
| See orders and the Stock tab | commerce.orders.read | admin, editor, Shop manager, Order handler |
| Mark shipped, cancel | commerce.orders.manage | admin, editor, Shop manager, Order handler |
| Refund | commerce.orders.refund | admin, Shop manager |
| Set stock | commerce.stock.manage | admin, editor, Shop manager, Stock clerk |
| Promotions and discount codes | commerce.promotions.manage | admin, Shop manager |
| Switch on/off, settings, export, uninstall | packages.manage (Modules) | admin |
| Read the shop's numbers with AI tools | commerce.read | admin, ai |
| Cart, discount code, stock signal, checkout, order status | none (rate-limited) | visitors |
Admins get every action of a module automatically. Refunding is not among the editor defaults: give it with the Shop
manager role. commerce.read gates the AI tools. It is not commerce.orders.read, which shows who ordered: AI
accounts never hold that.
For AI assistants
While the shop is on, an AI assistant connected over MCP (AI assistants) has three read-only tools:
commerce_orders_to_ship: the paid orders not shipped yet, oldest first (at most 50), with number, when paid, the amount in cents and currency, destination country, whether it is oversold, and the SKUs, titles and quantities, plus how many are waiting in all.commerce_sales_today: for one day (today unless given), in the site's time zone, how many orders were paid, what was charged, the VAT in it and what was refunded since, per currency. Totals only.commerce_low_stock: the SKUs with stock tracked and 3 or fewer available, with on hand, reserved and available.
They never refund, ship or change an order or the stock, and show no name, email address, street address, company or VAT number.
The shop's roles
The shop brings three team roles, which an admin gives to editors on the Team screen (Module roles):
| Role | Always holds | Holds by default | Manages |
|---|---|---|---|
| Shop manager | commerce.orders.read, commerce.orders.refund | commerce.orders.manage, commerce.stock.manage | the members of all three roles |
| Order handler | commerce.orders.read, commerce.orders.manage | – | – |
| Stock clerk | commerce.stock.manage | – | – |
An admin can add or remove the shop's other actions on each role. A Shop manager sees the members of the three roles, invites new ones and moves them between these roles. The roles give no access to products and categories.
In the admin
Products and Categories are in the sidebar's Sales section, as the standard collection list and entry editor.
- Product fields: Title, Slug, Description, Category, Images (max 12), Variants (1–50: SKU, Label, Price in euros, Track stock), SEO (SEO title, Meta description).
- Category fields: Title, Slug, Description, Image.
Orders
Orders (Sales section; needs commerce.orders.read) has two tabs. The sidebar entry shows how many paid orders are
not shipped yet.
Orders tab. A table (Order, Customer, Status, Total, Placed), newest first, 25 per page, with a search box (number,
name or email) and a status filter (All, Pending, Paid, Shipped, Failed, Expired, Cancelled, Refunded). Clicking a row
opens the order beside the list on a wide screen (Escape closes it) and as a sheet on a narrower one. It shows an
oversold warning, status, dates, the Mollie payment id (tr_…), the customer, the lines, shipping, total and refunded
amount, and:
- With
commerce.orders.manage: Mark shipped (paid orders; the customer gets a "shipped" email; an oversold order asks for confirmation first) and Cancel order (pending orders; asks for confirmation). - Carrier (PostNL, DHL, DPD, UPS and GLS are offered; any other can be typed) and Tracking number. Filled in before Mark shipped, they go with it. On a shipped order, Save tracking sets or corrects them.
- With
commerce.orders.refund, on paid or shipped orders: "Amount to refund (euros)" (empty = the rest), a reason (optional, max 255, the customer sees it) and Refund, which asks for confirmation. It cannot be undone. - History, oldest first: order placed, payment, invoice and each credit invoice (number, amount, time; each downloads as a PDF), and how it ended (shipped with carrier and tracking number, cancelled, expired or failed).
Stock tab. Every tracked SKU of the published products with its title, "N reserved" and an "In stock" number. Save
appears once the number changes. The tab is disabled without commerce.stock.manage, and shows Retry if the list
can't load. If the count changed after the tab read it (an order was paid, or someone else saved), saving is refused
and Reload the stock appears, so a sale is never counted back. The number you typed for that SKU is lost on reload.
Promotions
Promotions (Sales section; needs commerce.promotions.manage) lists each promotion as Scheduled, Running
or Ended. New promotion asks for:
- its Name (shown in the cart and on the invoice);
- Automatically or With a code;
- what it Gives: Percentage off (1–100), Amount off the order (incl. VAT) or Free shipping;
- what it is For: all products, some categories or some SKUs;
- a Minimum those products must cost together (incl. VAT), and Starts and Ends (empty: until you end it);
- for a code, whether it Combines with automatic promotions.
A promotion that has started can only change its end. End now ends it, and its codes stop working. One that has not started can be deleted.
Under Codes, a code promotion issues either One code for many customers (with a number of uses, and Its own
text if you want one, such as ZOMER25: 4 to 32 letters and digits) or Codes that each work once (random, 10
characters, up to 1,000 at a time). The shop keeps only a fingerprint of a code, so codes are shown once, to copy or
download as CSV. A text that another promotion's code still has is refused until that code has expired.
Module settings
Modules screen, Shop. Amounts are in euros.
| Setting | Meaning | Default |
|---|---|---|
| Shipping | Added to every order; 0 = free (up to €1,000) | €0 |
| Charge the customer's country VAT (One-Stop-Shop) | VAT at the delivery country's rate for consumers abroad | off |
| Sell to businesses (reverse charge) | EU businesses abroad with a VAT number buy without VAT | off |
| Shipping countries | Countries the shop ships to, in the order the cart offers them (the first is chosen). Each may have its own shipping amount, else it pays Shipping. The 27 EU countries plus United Kingdom, Switzerland, Norway, Iceland, Liechtenstein, United States, Canada and Australia; at least one | Netherlands, Belgium, Germany, France, Luxembourg, Austria, Spain, Italy, Denmark, Sweden, Finland, Ireland, Portugal, Poland, none with its own amount |
| Shipping by weight | Up to 10 weight bands, each "from (grams)" and an extra amount; the heaviest band the parcel reaches is added to the shipping | none |
| Free shipping from | Orders of at least this amount ship free; 0 = never (up to €100,000) | €0 |
| Hold stock while paying (minutes) | How long stock is reserved during payment (5–1440) | 10 |
| Order page | Slug of the page that shows the order's status, where Mollie returns customers | bestelling |
| Email new orders to | Up to 20 addresses that get a mail per paid order | none |
| Require accepting the terms | Customers must tick the terms box before paying; orders without it, or with another text than the terms text, are refused | off |
| Terms text | Text by the terms box, per site language (language code such as nl or en, and text, up to 300 characters); the accepted one is kept with the order | nl: "Ik ga akkoord met de algemene voorwaarden.", en: "I agree to the terms and conditions." |
| KvK number | On invoices | none |
| VAT number | Your own, on invoices (NL123456789B01) | none |
The shop charges the VAT rates in force under Settings, VAT rates (the defaults, or your own), per EU country and kind. The screens are in English and Dutch.
Elsewhere, for whoever may read orders:
- Dashboard card "Orders to ship" (default layout, small): the count of paid, unshipped orders, with a link.
- Inbox: the same paid orders, newest first, each opening the order beside the list.
- Search (Ctrl+K): orders by number, customer name or email, the newest five. Invoice and sale (factuur, verkoop) find the Orders screen.
On the website
With the website module on, the shop gives its editor five starter components (Components screen, marked From commerce). An admin adds one to the library, then puts it on a page like any component; once added it is an ordinary component. Their texts come in Dutch and English.
- Product grid: products as cards with image, title and price (on a reduction, the lowest price of the 30 days before it, struck through), each linking to its own page. Settings: heading, intro, which products and how many (the Products source below), the text when there are none. Looks: Cards and Plain.
- Add to cart: for a product's page. Bind its Product to the product's slug (
entry.slugon the products' template). It shows the price, or a choice of variant with each price (sold out ones marked), a quantity and In winkelwagen. After adding, a message and a link to the cart page (both settings). On a reduction it adds "Laagste prijs van de afgelopen 30 dagen:" / "Lowest price of the last 30 days:" with that price. - Cart and checkout: the cart at today's prices with quantities to change or remove, subtotal, each applying
promotion, a discount code field, shipping, total and the VAT in it for the chosen country (none for a business
abroad with a VAT number, when the shop sells to businesses). Then delivery details, the terms box when required, and
Afrekenen, which goes on to Mollie. A visitor clicking twice orders once. Settings: heading, intro, the empty-cart
text and the button text.
- The terms box shows the shop's Terms text in the page's language (the default language's if missing).
- The street and the house number are separate fields (the order's address line is the two together). A business may add its KvK number (eight digits, kept with the order, shown in the admin).
- With the Dutch services module on, its address and company lookup blocks placed above the cart fill these fields in. The shop works without them.
- Order status: the page customers come back to from Mollie (make it the shop's Order page). It shows whether the order is paid as soon as the payment comes in, and asks again every 30 seconds for up to two minutes in case the connection dropped. It reads the order from the visitor's browser: someone opening it elsewhere is pointed to their confirmation email. Once shipped with a tracking number it adds "Verzonden met PostNL, trackingnummer …" / "Sent with PostNL, tracking number …", linking to the tracking page for PostNL, DHL, DPD, UPS and GLS (plain text for another carrier). Settings: heading, intro, and the texts for paid, processing and failed.
- My orders: for the account page. A signed-in visitor sees the orders placed with their account's email address,
guest orders included, newest first (the last 50): number, date, total and a status (Wacht op betaling, Betaald,
Verzonden, Terugbetaald, or Niet betaald for a failed, expired or cancelled order). With none it says "Je hebt nog
geen bestellingen.". Someone not signed in is asked to sign in (a setting,
/accountby default). It works once accounts are on and an admin switched the shop's user capability on (its card on the Modules page). Checking out never needs an account.
The Products source (data sources) gives each product its title, first image, a
formatted price (the lowest variant price, with "from"/"vanaf" when variants differ), on a reduction the lowest price of
the 30 days before it (was), its SKU when it has exactly one variant, its description and its page path. Settings:
sort (newest, price low–high, price high–low, name A–Z), category and limit (1–100, default 12). Other frontends can
still check out with the rules below.
Every published product gets its own page, built from the page marked as the products' template.
The cart is kept by the shop, with the browser keeping only a reference to it. It holds what is in it, never prices, which are read when it is shown and again at checkout, and nothing personal. It is removed when its order is placed, and by retention (Carts, 30 days by default) after its last change. Stock is held only at checkout, while the visitor pays. A product taken off sale after it was added is left out of the cart and of the order.
Ordering for an organisation
When accounts belong to organisations (a customer company), the shop gives two roles per organisation. The organisation's owners and managers give them to members on the site, and the team on an account's Roles dialog:
- Viewer (
viewer): reads the organisation's orders (/my/organisations/{id}/orders, the newest 50). - Buyer (
buyer, a viewer too): keeps the organisation's delivery addresses (at most 50) and orders for it, to one of them (/my/organisations/{id}/checkout, with the cart, the address, and the organisation's VAT number if it has one). The order is placed as the organisation: its name as the business, reverse charge as for any business, and the buyer's own address as who ordered.
Approvals. An organisation can have its larger orders approved first:
- Its owners and managers set an approval amount on the site (
/my/organisations/{id}/settings), and the team sets it on the organisation's shop panel. It is in euros, with VAT. With none, no order waits. - A third role, Approver (
approver, a viewer too), is given by the organisation's owners only. - An order above the amount waits (Waiting for approval). Its stock stays held for the shop's Hours an order waits for approval (72 by default), there is no payment yet, and the approvers get an email.
- An approver approves it on the site (
/my/organisations/{id}/orders/{order}/approve). Payment starts then, with the usual reservation time, and the answer is the link to pay: the approver may pay at once, and the buyer gets the same link by email. An approver never decides on their own order. - Rejecting it (
…/reject, with a reason) cancels it, releases its stock and tells the buyer why. - When the buyer is the only approver, or there is none, the shop is emailed instead, and the team approves or rejects on the Orders screen. The team can decide on any waiting order there.
- An order nobody answers in time expires, as an unpaid one does. Waiting orders count towards the three unpaid orders a customer may have at a time.
The order keeps the organisation's name. When an organisation is deleted its addresses go with it, but its orders stay as long as the law keeps them. On SHADE's Organisations screen, an organisation shows the shop's panel with its orders and addresses (for whoever may read orders), and an order on the Orders screen says which organisation it was for.
Rules and limits
Promotions and discount codes
- A customer gets, per product, the automatic promotion that takes most off it. Automatic free shipping applies when its products reach its minimum.
- One code per order. A code that combines comes on top of what the automatic promotions left. One that does not gives the larger of the two (free shipping counted in), and the cart says when the automatic promotions were better.
- A code is case-insensitive. In a random code, spaces and hyphens are ignored and O is read as 0. A code with its own text must be typed as it is.
- For an unknown, used up or expired code the cart says only "This code does not work". A working code under its minimum, or for none of the products, says so. A code expires with its promotion, and at the latest after 366 days.
- A code's use is counted when the order is placed, in the checkout's transaction, so two customers can never both use a code's last use. The use belongs to the order, which keeps the promotion and code. When the order ends unpaid (payment fails or lapses, cancelled, rejected) the use is given back. An order paid after all takes it again and keeps its discount even when the code has no use left.
- Discounts come off the price with VAT, before the VAT is worked out (VAT directive, article 79): a percentage per product, an amount over the products it is for in proportion to their price. The invoice VAT is the VAT on what is paid. The invoice and order emails show the discount.
- Lowest price of the last 30 days (Price Indication Directive, article 6a): the shop records each SKU's price when a product is published. When a product is cheaper than before (a lower price, or an automatic percentage off with no minimum), the shop shows the lowest price of the 30 days before the reduction began, never a typed price. Promotions with a code or a minimum are not shown this way.
- Retention keeps past prices for at least 31 days (Past prices, 90 by default) and ended promotions for at least 31 days (Ended promotions, 365 by default). Orders keep their discounts' names and amounts.
Invoices
- The shop does no bookkeeping. It charges the right VAT, keeps the order as charged and issues invoices and credit invoices. Ledgers, VAT returns, One-Stop-Shop returns and annual accounts belong in your bookkeeping software. A connector to Moneybird or Exact Online is planned (Roadmap); with it on, that software may issue the invoices instead and the shop's own are off by default.
- An order gets its invoice when it is paid, never before. Invoice numbers are one unbroken series per year (
2026-0001,2026-0002…; the year counts in the site's time zone), apart from order numbers, so unpaid orders leave no gaps. An order paid twice still has one invoice. - The invoice is a PDF in Dutch or English (the order's language). It shows your business's name and address (your main location, in Settings, Locations; the site's name while there is none), KvK and VAT number, the customer's address (and company and VAT number), number and date, order number and payment date, each line with quantity, price and VAT rate, shipping, the total without VAT, the VAT per rate and the total. A reverse-charge sale says Btw verlegd with the customer's VAT number. It is attached to the confirmation email.
- Each refund makes a credit invoice in the same series, naming the invoice: minus the amount refunded, its VAT per rate in the share refunded. It is attached to the refund email.
- Invoices and credit invoices are SHADE's fiscal records. Each PDF is kept exactly as issued, never on the website, until 1 January of the eighth year after the year it was issued, also when its order is deleted or the shop is removed. Then retention deletes it. They are listed in a person's data (Privacy) with that date, but not deleted on request. While private files are switched off (Settings, Modules), no invoice can be made, so paid orders wait for it.
Prices, VAT and shipping
- Prices are entered in euros per variant and kept in cents. Currency is EUR only. Prices are never taken from the visitor's browser: at checkout the shop reads the published variants and keeps title, unit price and total per line.
- VAT. Prices include VAT. Each product has a VAT category: Standard rate (default), Reduced rate (food, books and other reduced-rate goods) or Zero rate. The rate comes from VAT rates, so a rate change needs no product edited. VAT per rate = round(amount × rate / (100 + rate)). Shipping's VAT is split over the rates by each rate's share of the goods (shipping alone: the standard rate). Each order line keeps its rate, and the order keeps the VAT per rate and in total, as charged. The product page says incl. btw / incl. VAT; the cart, both emails and the admin's order view list Waarvan btw N% / including VAT N% per rate. Cart and checkout calculate it the same way.
- Rates charged are those in force when the cart or checkout calculates. An order placed just after a new rate starts gets the new rate; earlier orders keep theirs. SHADE never fetches rates: when a country changes one, set it under VAT rates (ahead, with its start date) until a shop release updates the defaults.
- Other EU countries, businesses and exports:
- Charge the customer's country VAT (One-Stop-Shop): a consumer in another EU country pays the same price, with their country's VAT inside it at its rate for the product's category. The order keeps the VAT country.
- Sell to businesses (reverse charge): the cart offers I am ordering for a business with company name and VAT number. A business in another EU country with a VAT number of that country's format pays the price without VAT. The cart shows VAT reverse-charged, and the order, the emails ("VAT reverse-charged (Article 196 VAT Directive): …, VAT number …") and the admin say so. A Dutch business pays Dutch VAT. A number that doesn't fit the country is refused ("This is not a VAT number of the delivery country"). The format is checked, and the number in VIES if you switched that on in VAT rates: VIES saying no refuses it ("This VAT number is not valid in VIES"); VIES not answering leaves it to the format. The order keeps which check decided.
- Exports: a delivery outside the EU pays the price without the Dutch VAT, at 0% (Article 146 VAT Directive), shipping too. A business there needs no EU VAT number. The order keeps the delivery country as its VAT country, and the admin, emails and invoice say "Export outside the EU: 0% VAT". The shop does not charge import duties or VAT in the customer's country.
- Shipping is one amount per order from the settings, or the delivery country's amount when Shipping countries gives one, plus the Shipping by weight surcharge: the heaviest band the parcel reaches, by the sum of each line's variant weight (Weight (grams), with packaging; empty = 0) × quantity. It is free from the Free shipping from amount, in every country and at any weight. The cart recalculates when the country changes. The cart and emails say Gratis / free.
Stock and reservations
- Stock is not part of the product content (publishing or restoring a version never resets it). It is kept per SKU (on hand), and what orders being paid reserved is held by SHADE's holds. Available = on hand − reserved.
- Variants without "Track stock" are unlimited. A tracked SKU with no stock set counts as 0, so it is sold out until someone sets stock.
- Visitors only see a signal, never counts: in stock, low (3 or fewer), out of stock, or untracked.
- At checkout, tracked SKUs are checked and reserved until "Hold stock while paying" runs out. If anything is short, nothing is reserved and checkout is refused, listing what is left. The last item is never sold twice, even when two visitors check out at the same moment.
- Every minute, pending orders past their reservation become Expired and their stock is released.
- Stock cannot be set below what is reserved, nor from a count that changed meanwhile (the stock API takes the count it
replaces,
expectedOnHand, and answers CONFLICT when it differs). Refunds do not put stock back; count returns by setting the stock again.
Checkout and order numbers
- A visitor can check out 10 times per minute (request protection). Sending the same checkout again gives one order and one payment; if that attempt had failed, it is refused.
- At most 3 unpaid orders at a time per email address (capitals and surrounding spaces ignored) and per IP address: orders waiting for payment whose stock is still held. A fourth checkout is refused ("You have 3 orders waiting for payment…") until one is paid or its hold runs out. This stops a script making a drop look sold out. Two simultaneous checkouts take turns. Only a keyed hash of the IP address is kept with the order's hold, and only while it waits for payment.
- Limits: lines 1–50, quantity 1–99 per line (and per SKU after merging duplicates), name max 120, email max 254. Unknown or unpublished SKUs are refused. The country must be one of the shop's Shipping countries ("The shop does not ship to this country"), and the postcode one of that country's ("Not a postcode of this country"; see Locations for the countries whose postcodes are checked).
- Order numbers are
<year>-<six digits>(e.g.2026-000123), counted per year in the site's time zone. Failed checkouts keep their number. - Payment goes through the payments module: Mollie's hosted checkout, in the page's language, with the
description "
", returning the customer to the order page. If starting the payment fails, the order is marked Failed and its stock released. - The terms checkbox is required in the browser. Its text and the time are stored with the order and shown in the admin ("Terms accepted: …").
- Require accepting the terms: checkout refuses an order without accepted terms, or whose text is not one of the shop's Terms text (any language, surrounding spaces ignored). Without the setting nothing is checked and a ticked text is kept as sent. The accepted text is kept as proof: the text, its version, the customer and when, in their data on the Personal data screen and kept on erasure, for seven years by default (Data retention). A sale of goods carries the EU's 14 days to withdraw from the day they arrive.
- SKUs are unique. Publishing a product is refused when one of its SKUs is used twice in it, or sold by another published product ("Another product already sells this SKU: …"), since stock is kept per SKU.
Payment and order statuses
- Paid (for a pending, expired or failed order): the reserved stock is taken and the order becomes Paid. If the reservation had lapsed, the stock is taken anyway when there is enough. Otherwise the order is marked oversold (a warning in the admin and the shop's email) for someone to decide. It is never refunded automatically. Repeated reports do nothing.
- Failed or cancelled (pending order): Failed, stock released. Expired: Expired, stock released.
- Statuses: Pending, Paid, Failed, Expired, Shipped, Cancelled, Refunded.
- Manual changes: Paid → Shipped; Pending → Cancelled (stock released). A paid order is cancelled by refunding it. Anything else is refused.
- Cancelling also cancels the Mollie payment where Mollie allows it (bank transfer and some other methods; an open card or iDEAL payment cannot be cancelled and simply expires). If the customer still pays, the order becomes Paid like a late payment (taking the stock if there is some, otherwise oversold), the customer gets the usual confirmation, and the shop's email starts with "PAID AFTER IT WAS CANCELLED: … Ship it, or refund it under Orders."
- Carrier and tracking number are set together, on a paid order (going with Mark shipped) or a shipped one (to
correct them; no second email). The carrier is 2 to 40 letters, digits, spaces, dots, dashes, ampersands and
apostrophes. The tracking number is 4 to 40 letters, digits and dashes (spaces dropped). Links go only to the fixed
https tracking pages of PostNL, DHL, DPD, UPS and GLS, never to a typed address; PostNL's link carries the delivery
country and postcode. Through the API (
commerce.orders.manage), which is how a carrier module sets them:PATCH /orders/:id/statuswithcarrierandtrackingNumberbesidestatus: "fulfilled", orPUT /orders/:id/trackingwith both. - Refunds apply to paid or shipped orders, for any amount up to what is left. A full refund makes the order Refunded. A partial refund keeps its status and adds to the refunded amount. Simultaneous refunds wait for each other. A refund Mollie already holds but the order doesn't (made in Mollie's dashboard, or one whose recording failed) counts toward the amount asked: only the rest goes to Mollie, and the order and its credit invoice record both.
- Refunds made in Mollie's dashboard: when Mollie reports one, the order records it at once (refunded amount, Refunded when nothing is left, a credit invoice and the refund email), in the audit log as made at the payment provider. Only what the order did not hold yet counts, so a refund is never counted twice.
Emails
Sent through email. Each is queued in the same transaction as the order's change and sent
by the background work right after, so an email is never lost when SHADE stops in between. One that cannot go is tried
6 more times, a minute apart and doubling (to an hour); past that it is in the error log and on the module's health
card. The order never waits for its email. The module needs the queue capability for this, which its consent lists.
- To the customer on payment: plain text, Dutch or English (the checkout's language, else the site's default): greeting, lines, shipping, total and the VAT per rate. Reply-to is the first notification address.
- To the shop (each "Email new orders to" address): English, with the customer, lines and totals, and an OVERSOLD warning when relevant. Reply-to is the customer.
- To the customer when shipped: "Je bestelling … is onderweg" / "Your order … is on its way", with the delivery address, the carrier and tracking number with the tracking page when set, and the lines.
- To the customer on a refund: "Terugbetaling van bestelling … bij …" / "Refund of order … at …", with the amount and the credit invoice attached (the reason also goes to Mollie, which shows it to the customer).
- No emails on failure or cancellation: the business tells the customer itself.
Switching off and uninstalling
See Modules.
- The turn-off dialog warns (does not block) when there are pending orders or paid orders not yet shipped. Because the module holds data, its name must be typed to confirm. Product pages can be redirected elsewhere while it is off; the redirects disappear when it is switched on again.
- While off, cart and checkout stop working, expired reservations are not released, and payment updates are not passed to it.
- Export and uninstall work as for any module: uninstall first backs up the settings, orders, products and categories, then deletes them.
Personal data
- Orders hold the customer's name, email and delivery address, the language and the amounts. They are not linked to a user account (accounts): My orders finds them by the account's confirmed email address, so deleting an account leaves its orders as they are.
- A name and delivery address a signed-in customer saved (
/my/profile) are kept on their account, one per account. They are shown and exported with the account's data on the Personal data screen, deleted when the customer asks, and deleted with the account. Orders keep their own copy as charged. - Orders are kept seven years by default (the Dutch bookkeeping term) and then deleted with their lines. An order with a later credit invoice is kept until that invoice is seven years old too (see Data retention). A customer's orders are shown and exported on the Personal data screen but kept when they ask for deletion (bookkeeping law); they are not anonymised early. Orders never paid go after 90 days.
- The order page reveals only the number and status, and once shipped the carrier and tracking number (PostNL's link holds the postcode), and only to someone with the order's random id.
- AI assistants have no access to orders: they never see customers.
Order events for other systems
An optional capability of the shop (Webhooks): switch it on on the Modules page, then
pick its events for an address on the Webhooks screen. Each carries the order: id, number and status, the customer's
name, email and address (and company and VAT number), amounts and VAT, what was refunded (each amount as
{ amount, currency }: whole cents and currency), the carrier and tracking number (or null), and the lines.
commerce.order.created: a customer placed an order and went to pay (not paid yet).commerce.order.paid: the order was paid, withpaidAfterCancelandoversold.commerce.order.cancelled: the order was cancelled, or its payment failed or expired (itsstatussays which).commerce.order.refunded: part or all of it was refunded, with this refund'samount.
Without the website module
A site built in its own code, in any framework, can still be a shop. The package @shadestack/commerce-client gives it
what the starter components do for the website editor: typed functions for the shop's routes and a cart that keeps its
own state. It is released with the commerce module, at the same version, and needs only @shadestack/client beside it.
import { createCart, getProduct } from '@shadestack/commerce-client'
// On the server, for a product page:
const product = await getProduct({ slug: 'mok', locale: 'nl' }, { baseUrl: process.env.SHADE_API_URL })
// In the browser:
const cart = createCart({ locale: 'nl' })
await cart.add(product.sku)
const { pay } = await cart.checkout({ fullName, email, line1, houseNumber, postalCode, city, country: 'NL' })
location.assign(pay)
The route functions are getProduct, viewCart, addToCart, setCartQuantity, setCartCode, checkoutCart,
getOrderStatus and getMyOrders. A product page can read its product on the server. The cart renders in the browser,
since that is where its id is kept.
createCart() makes a cart with load, add, set, remove, setCode, setDelivery (the country and VAT number
the totals are for) and checkout, and a store any framework can read: subscribe and getSnapshot (a Svelte store,
or React through useSyncExternalStore). Its state says whether it is loading, saving or showing an error. An error
carries SHADE's key and the problem per field, so a form can show each message beside its field. A shopper who presses
Afrekenen twice, or whose connection drops while paying, still places one order: the cart sends the same
idempotency key with every retry of one attempt.
After checkout the customer pays and comes back to your order page. createOrderStatus() shows the order they just
placed and keeps it up to date while the order is open (waiting for approval, or its payment being processed). It hears
at once when the shop approves the order or marks it paid, and checks again every 30 seconds. Its state holds the
order's number, status and, once sent, the carrier and tracking number.
const order = createOrderStatus()
order.store.subscribe(({ data }) => showStatus(data.order?.status))
await order.load()
On an account page, createMyOrders() lists a signed-in visitor's own orders with status and total. For a visitor who
isn't signed in its error has status 401, so the page can ask them to sign in.
One cart with the starters. The browser keeps only the cart's id, in local storage under shade.kept.cart, the same
key the Add to cart and Cart starter components use. After checkout it keeps the order's id under shade.kept.order,
as the Cart and Order status starters do. A site that mixes editor pages with pages of its own has one cart and one
order page, and a change in one tab reaches the others. Keeping the ids needs no consent: they hold no personal data
and exist only once a visitor adds something or orders.
The package's README is the full contract, with snippets for React, Vue and Svelte. The shop starter is a whole shop
built on it (Use-case starters).
For developers
The code and its tests: the README of shade-plugin-commerce; the client package's in its client/ folder.