Good Chef & Webbers: Powering subscriptions with Medusa’s commerce modules

May 25, 2023 by

Shahed Nasser

Nicklas Gellner

Shahed Nasser and Nicklas Gellner

How Webbers built a subscription-based meal shop using Medusa.
Webbers Agency helped build an online meal subscription store for Good Chef that sells shock frozen plant-based food. Webbers chose Medusa for its building blocks, which provided them with the flexibility to support Good Chef’s subscription logic while giving customers a great online experience.

Ideal solution for a bespoke subscription model

When scoping the Good Chef project, Webbers identified that the subscription logic would be a key constraint on the implementation. Other ecommerce platforms were too rigid to support Good Chef's subscriptions, and the alternative of building the entire system from scratch would mean spending a lot of time recreating core commerce features like cart logic and discounts.
Instead, they chose to use Medusa, which provides building blocks for core commerce logic that can easily be customized for custom needs, like Good Chef's subscriptions.
“We had used Magento and WooCommerce in the past, but they were not ideal for a modern headless stack. We tested Shopify, but then quickly hit a limit on how scalable and customizable the setup could be.” — Daan van den Burg, Managing Partner at Webbers Agency.
It was important for Good Chef that subscriptions could be paid with the customer's preferred payment method. Likewise, they wanted the subscription flow, e.g. when renewals should happen, to be controllable as part of the commerce logic. This meant that Webbers couldn't use a payment provider-specific subscription solution like Stripe Billing.
So, they decided to build the subscription logic into Good Chef's Medusa project, making it independent of payment providers and giving customers the best experience.

Building Subscription into Medusa

It is possible for customers to make single purchases on the site, but for the most part, customers sign up via the subscription flow outlined below.
To implement subscriptions, Webbers leveraged Medusa's support for custom data models. Webbers created a Subscription data model to hold information about Good Chef's offerings, including type of meal box, available frequencies and prices. Additionally, they added relations between Orders and Subscriptions to be able to track which Subscription an Order is related to.
“The architecture of Medusa made it simple to add custom logic to the codebase. It was very easy to create our own entities and extend Orders in Medusa.” — Pepijn van Vlaanderen, Head of Development at Webbers
To trigger the creation of new Orders, Webbers used Medusa's cron jobs to execute a nightly check for Subscriptions that need renewal. Orders are created with Line Items of the customer's chosen meal box and are automatically paid for through the Subscription payment method.
With this implementation, Webbers was able to bring Good Chef’s vision to life without compromising the commerce system’s flexibility or their control over the logic behind the subscription flow.

Straightforward Developer Experience

This project was Webbers’ first time using Medusa, so they had to learn its architecture and fundamentals to understand how to customize it and implement Good Chef’s use case. This was not a big challenge, and they quickly grasped the concepts within Medusa and how to utilize them.
“It was a new system for us, but it was straightforward and easy to learn.” — Pepijn van Vlaanderen
One of the aspects the Webbers team has come to appreciate is the developer experience that Medusa provides. It offers the flexibility to select only the necessary functionality for their use case and extend with custom logic when needed.
This made Medusa the commerce infrastructure of choice for Webbers, as they now use it as their go-to solution in other client projects.
“We like the SDK approach that Medusa offers, as it makes it easy for us to cherry-pick what we need and quickly build it out. It gave us the confidence to use Medusa for other projects so that we can help our clients and give them a stable ecommerce infrastructure.” — Pepijn van Vlaanderen

Share this post