Commerce referral logo
27 January, 2026 //

Introducing Commerce Referral

#Backend
#Drupal

Daniel Johnson, Developer at Pivale Drupal agency - A man with dark hair and glasses.
Written by Daniel Johnson Backend developer

Daniel is a backend developer, with a keen focus on end-to-end testing, attention to detail and crafting bespoke ecommerce solutions. Daniel is a graduate of Keele University, with a year's study at VU Amsterdam, achieving a first class degree in Computer Science.

From Client Requirement to Drupal Contrib

At Pivale, much of our work begins with solving real, practical problems for our clients. One recent project introduced a requirement we see often in commerce platforms: supporting referral-based workflows in a way that fits naturally within Drupal Commerce.

While exploring possible solutions, we reviewed existing community modules, including Commerce Referral Discount. Although it addresses a similar problem space, it was originally developed for Drupal 7, has no stable releases, and follows a more rigid, link-driven referral flow with fixed discount configuration for both the referrer and the referee.

For our client’s needs, this approach lacked the flexibility required.

That led to the creation of Commerce Referral, a new Drupal contrib module designed around a more adaptable model.

The Problem Space

Referral systems often vary significantly between projects. Some rely on links, others on user actions, and many require custom business rules around eligibility, attribution, and rewards. Implementing these systems in a maintainable way — while staying aligned with Drupal Commerce — can quickly become complex.

What we needed was not an opinionated end-to-end referral solution, but a flexible foundation that could support different referral models.

What Commerce Referral Provides

Commerce Referral provides a backend framework for managing referrals within Drupal Commerce, without prescribing how users interact with the referral system.

Rather than hard-coding discounts or flows, the module integrates with Commerce Promotions, allowing the incentive for the referrer and the incentive for the referee to be configured independently and with all the functionality that comes with Commerce Promotions. Each side of the referral can use its own promotion, with its own conditions, limits, and applicability.

In addition, referrals themselves can have conditions applied. For example, it’s possible to limit how many referrals a user can make, or restrict referrals based on custom business rules. Any conditions defined on the associated Commerce Promotions are also respected, ensuring consistent behaviour across the commerce system.

This layered approach makes Commerce Referral adaptable to a wide range of referral workflows, from simple incentive schemes to more complex, rule-driven models.

Why Contrib Matters

We hope that in releasing Commerce Referral as a contrib module, others in the Drupal community to build on this flexible foundation, adapt it to their own referral workflows, and contribute improvements back to the ecosystem.

At Pivale, we regularly work with Drupal and Drupal Commerce to solve complex, real-world business requirements. Commerce Referral is one example of how client-driven problem solving can evolve into reusable, community-focused contributions.

We’re proud to actively contribute to the Drupal ecosystem and look forward to continuing to do so.

If there are any changes, bugs or additional features that you would like to see addressed, please do open a ticket or contribute!

Daniel Johnson, Developer at Pivale Drupal agency - A man with dark hair and glasses.
Written by Daniel Johnson Backend developer

Daniel is a backend developer, with a keen focus on end-to-end testing, attention to detail and crafting bespoke ecommerce solutions. Daniel is a graduate of Keele University, with a year's study at VU Amsterdam, achieving a first class degree in Computer Science.

Pri Scarabelli, Frontend Developer at Pivale digital transformation agency - a woman with dark hair, glasses, and a big smile

Contact us



Or send us a message...