Spree Commerce is an open-source e-commerce platform written in Ruby on Rails that provides the core of an online store, including catalog, cart, checkout, orders, payments, shipping, taxes and an administration panel, as a set of Rails components that developers extend in code. Among store platforms in e-commerce, it belongs to the group of developer-oriented, self-hosted frameworks rather than ready-made hosted services.
The project started in 2007 and has gone through several major versions. Its design favors API-first and headless use: the same commerce engine can serve a classic server-rendered storefront, a separate JavaScript front end, a mobile app or a marketplace with many vendors.
How Spree Commerce is built
Spree Commerce is built as a collection of Rails engines packaged as Ruby gems, which a developer adds to a Rails application. The engines share one relational database, usually PostgreSQL or MySQL, and expose models, controllers and views that the host application can reuse or override.
The main parts are listed below. Recent versions have reorganized the packages, so names differ slightly between releases, but the division of responsibilities has stayed similar.
| Component | Responsibility | Typical consumer |
|---|---|---|
| Core | Data models and business logic | All other components |
| Storefront API | Shopper-facing endpoints for cart and checkout | Headless front ends, mobile apps |
| Platform API | Administrative endpoints for catalog and orders | Integrations, back-office tools |
| Admin | Web dashboard for merchants | Store staff and operators |
| Storefront | Server-rendered shop templates | Merchants without a separate front end |
The APIs follow the JSON:API specification for request and response formats, and the administrative API uses OAuth 2.0 tokens for authorization. This makes Spree suitable as the commerce layer in a headless commerce or composable commerce architecture.
The Spree data model and checkout flow
The Spree data model separates products from variants: a product holds shared information such as name and description, while each variant represents a purchasable combination of options, such as size and color, with its own SKU and price. Categories are organized as taxonomies and taxons, which form trees for navigation and filtering.
Stock is tracked per variant in stock locations, which allows one store to fulfill from several warehouses or shops. An order contains line items, shipments, payments and adjustments, the general mechanism for taxes, promotions and other price changes.
Checkout is driven by an order state machine. The default sequence is shown in the table; developers can add, remove or reorder steps in code.
| State | What happens | Data recorded |
|---|---|---|
| Cart | Shopper adds or removes items | Line items, quantities |
| Address | Billing and shipping addresses entered | Address records |
| Delivery | Shipping method selected per shipment | Shipments, shipping rates |
| Payment | Payment method chosen and authorized | Payment records, gateway response |
| Confirm | Optional review step before placing | Final totals |
| Complete | Order placed and stock allocated | Order number, completion time |
Because state transitions trigger callbacks, the state machine is also the main extension point for custom logic, such as fraud checks before payment or extra validation for business customers.
Spree compared with other store platforms
Spree is best understood as a framework for building a store, not as a finished hosted product. Merchants trade setup speed for control over code, data and hosting, which places it closer to Solidus, Sylius, Saleor and Medusa than to Shopify or Wix eCommerce.
The comparison below summarizes how Spree differs from several neighbors in the store platforms topic.
| Platform | Language or stack | Hosting model | Typical buyer |
|---|---|---|---|
| Spree Commerce | Ruby on Rails | Self-hosted or managed | Teams with Rails developers |
| Solidus | Ruby on Rails | Self-hosted | Rails teams wanting a conservative fork |
| Sylius | PHP, Symfony | Self-hosted | Teams with Symfony developers |
| Medusa | Node.js, TypeScript | Self-hosted or cloud | JavaScript-focused teams |
| Shopify | Proprietary | Hosted software as a service | Merchants wanting speed over control |
Solidus deserves special mention: it began in 2015 as a fork of Spree and still shares much of its original data model, so experience and some extensions transfer between the two, although the projects have diverged considerably.
Customization, extensions and licensing
Spree is customized mainly through Ruby code in the host application. Developers override views, add models and attach behavior to core classes, traditionally through decorators that reopen Spree classes with additional methods. Shared functionality is distributed as extension gems, for example for payment gateways, product reviews or multi-vendor marketplaces.
The flexibility has a cost. Heavy use of decorators couples the store to internal implementation details, which makes major version upgrades difficult. Recent versions encourage events, dependency injection and API-level integration to reduce that coupling.
Licensing should be checked for each major version. Older releases were distributed under the permissive BSD 3-Clause license, while newer releases introduced different terms for parts of the code base, including a commercial option for some features. A merchant planning a closed-source deployment should review the license of the exact version before committing.
When Spree is a good fit and when it is not
Spree suits organizations whose requirements do not fit a standard hosted platform and that can maintain a Rails application over several years. Native support for multiple stores, currencies and languages from one installation makes it common in cross-border retail and B2B portals.
| Project situation | Fit | Reason |
|---|---|---|
| Complex B2B pricing and approval rules | Good fit | Logic can be coded directly in the core |
| Multi-vendor marketplace | Good fit | Marketplace extensions and flexible data model |
| In-house Rails team already in place | Good fit | Reuses existing skills and infrastructure |
| Small shop without developers | Poor fit | Hosting, security and upgrades need engineers |
| Need for a large app marketplace | Poor fit | Extension ecosystem is far smaller than Shopify’s |
The most common mistakes are underestimating operating costs, such as hosting, PCI DSS scope for payment handling and security patching, and over-customizing the core so that later upgrades require a near rewrite.
In everyday language
Spree Commerce is like a professional kit for building an online shop. It already contains the hard parts, such as the shopping cart, checkout, product list and order tracking, but a programmer has to assemble them, decide how the shop looks and keep it running.
Services such as Shopify are more like renting a furnished store: quick to open, but with limited changes. Spree is closer to owning the building. You get full control, but you also take responsibility for maintenance.
Seen in the real world
A European distributor of industrial fasteners wanted an online portal where about 2,000 business customers could see negotiated price lists, order by SKU and request approval for orders above a set limit. Standard hosted platforms required costly workarounds for these rules.
Its four-person Rails team built the portal on Spree Commerce, using separate stores for three countries with local currencies and languages. They added an approval step to the order state machine and synchronized prices and stock with the company’s ERP system through the Platform API every few minutes.
Within a year, most repeat orders moved online from email and phone, and the sales team spent more time on new accounts. The company also budgeted one developer for upgrades and security patches, because ownership of the code meant ownership of its maintenance.