Dec 15, 2021

How We Integrated Shopify With Cliniko, HubSpot and SendGrid for IVF Matters

How We Integrated Shopify With Cliniko, HubSpot and SendGrid for IVF Matters

The IVF Matters project was a very technically complex integration.

IVF Matters is the UK's first online fertility clinic — a business where the product is medical service, the customer journey is emotionally sensitive, and the technical requirements for connecting the digital storefront to the clinical infrastructure are genuinely demanding.

The Problem

IVF Matters needed a Shopify store that could sell fertility services — consultations, tests, treatment packages — and then automatically route customers into the correct clinical management workflow based on what they had purchased.

The three systems that needed to connect were:

  • Cliniko (practice management, patient records and appointments)
  • HubSpot (CRM for relationship management)
  • SendGrid (transactional email sequences).

Shopify needed to be the commerce layer while connecting reliably to all three in real time.

Why Native Integration Wasn't Sufficient

There was no native Shopify–Cliniko integration, and even if there were, it wouldn't have handled the specific workflow requirements.

The requirement wasn't simply to sync data between systems — it was to trigger specific, product-dependent actions in each system based on the contents of a Shopify order.

When a customer purchases Product A, they need Email Sequence 1 (SendGrid), CRM Workflow 1 (HubSpot), and Patient Record Template 1 (Cliniko).

Standard integration tools can sync fields; they can't implement conditional, product-dependent routing logic of this complexity.

The Architecture: Custom Shopify App on Heroku

We built a custom Shopify app hosted on Heroku that sits between Shopify and the three downstream systems.

The app listens to Shopify's order webhooks and, when a relevant event fires, reads the order contents and executes the appropriate actions in each connected system.

The logic layer contains the product-to-workflow mapping and is configurable — IVF Matters can update workflows as their service offering changes without requiring code changes, because the mapping is managed through the app's configuration rather than hardcoded.

The Metafields Architecture

A critical component was using Shopify's metafield system to store the product-to-workflow configuration data within Shopify itself.

Each product has associated metafields defining which Cliniko template, HubSpot workflow, and SendGrid template sequence it should trigger.

The custom app reads these metafields when processing an order, keeping configuration data in the authoritative system (Shopify) rather than duplicating it in the middleware.

If your Shopify store needs to connect to systems beyond standard app integrations — CRMs, practice management platforms, ERPs, bespoke workflows — we'd like to understand the problem.

→ Read about our Shopify integrations and custom development service

→ Read the IVF Matters case study

Author

Darren Williams

Founder & Managing Director