Skip to main content
The e-commerce module turns Strapi into the back office of an online store. You manage the catalog, the customers, the orders, the payments, the shipments, the invoices and the promotions in one place, and your storefront talks to the module through a private API. The module runs a single store. It is off by default, so nothing changes in Strapi until you turn it on.

Requirements

Before you start, check that you have:
  • the Littlebox Strapi Suite plugin installed in your Strapi project;
  • access to the server environment, so you can set the environment variables listed below and restart Strapi;
  • a storefront (your public website) that calls the storefront API. You can build it however you like. See the frontend guide.
The integrations are optional, and you turn on only the ones you need:
  • Stripe to take card, MB WAY and other online payments;
  • Moloni to issue certified invoices and credit notes;
  • DPD Portugal and CTT Expresso Portugal to create shipments with a carrier;
  • Resend to send e-mails to your customers.

Turn the module on

Step 1: Access the Strapi admin panel.
Step 2: Go to the Littlebox Strapi Suite and select “E-commerce”. You can also click the “Littlebox Strapi Ecommerce” shortcut in the main menu of Strapi.
Step 3: The screen shows “The E-commerce module is disabled”. Click “Enable E-commerce”.
The module opens on the product list. Its side menu has these entries:
  • Products: the catalog, with variants, prices, stock and images.
  • Categories: the tree that organizes the products.
  • Collections: groups of products, chosen by hand or by conditions.
  • Tags: free labels for the products.
  • Orders: every order, from the storefront or created by you.
  • Customers: the people who bought or registered.
  • Promotions: discounts, codes and gifts. It only shows when you can read promotions.
  • Settings: the store, the API, the integrations, the e-mails and the scheduled jobs.

Turn the module off

Step 1: Go to “Settings” and open the “General” tab.
Step 2: In the “E-commerce module” card, click “Disable”.
Step 3: Confirm.
While the module is off, the store is closed:
  • every e-commerce endpoint, in the admin and in the storefront API, answers 404 Not Found, so the site cannot show products or take orders;
  • Stripe payment notifications also get 404, and Stripe retries them for up to 3 days;
  • the module only shows the screen to turn it back on.
No data is deleted. Products, orders, customers and settings stay as they are.

Environment variables

The module keeps secrets (integration passwords, API keys, customer passwords) safe with two kinds of server keys. You set them in the environment of the Strapi server, for example in the .env file, and then you restart Strapi. Generate each value with this command. It prints at least 32 random bytes in base64, which is the minimum for a pepper:
.env
You can also set the encryption key in the plugin configuration as ecommerce.encryptionKey. When both exist, the plugin configuration wins.
Without the encryption key
The General tab shows “The encryption key is not configured”. Everything else keeps working, but you cannot save integration credentials, and customer accounts are not available.
Without a pepper
The module still starts. If you choose a customer accounts mode other than guest only, the General tab shows “Customer accounts are not ready yet”, and customers cannot sign in.
Rotate the pepper
To change the pepper, add a new version, for example LTB_ECOMMERCE_PASSWORD_PEPPER_V2, and keep V1 as it is. The highest number is the current version. Each customer password moves to the new version the next time that customer signs in. Keep the old versions set until no password uses them.
Never change the value of a pepper version that is already in use. Every password stored with it stops working. Also keep the encryption key stable: when it changes, the saved credentials can no longer be read (you must type them again) and every customer is signed out.

Permissions

The module adds its own actions to Strapi roles. Go to Settings → Administration Panel → Roles, open a role, and find them under Plugins → Littlebox Strapi Suite → ecommerce.
When a person can read a screen but not change it, the module shows a notice such as “You can view these settings, but you do not have permission to change them.” and hides the buttons that need the missing permission.

Storefront API

Your storefront server uses the storefront API to list products, categories and collections, run the cart and the checkout, start Stripe payments, and handle the customer accounts. Every request carries the token from the API tab and a checkout session, and the browser never calls the API directly. See the frontend guide to connect your storefront.