Connecting Medusa to Salesforce
Medusa is a Node commerce engine you extend in your own codebase, which makes the conversion event a piece of application code — and therefore something that can be tested rather than hoped for. Sending conversions into Salesforce rather than out of it is how marketing data reaches the place sales actually works. The join between them succeeds or fails on one thing: whether the Lead or Contact identity reaches the Medusa order before the conversion happens, because Salesforce can only match a conversion it can tie back to a click it recognizes.
Free30 minutesNo obligation
Specific to this pair
Medusa to Salesforce: B2B orders on the account they belong to
Map Medusa customers and companies to Salesforce Contacts and Accounts via an external ID field, writing paid orders as won Opportunities or Orders from a payment-capture subscriber. Carry cart-metadata click IDs and UTMs onto custom fields for offline conversions later. Read records back to catch validation-rule rejections, and decide which system owns price.
Medusa is often chosen for B2B storefronts, with customer groups, company accounts and negotiated prices, and that is where pushing orders into Salesforce pays off. The join is the Medusa customer, and the company if you model one, to a Salesforce Contact and Account, with the Medusa ID stored in an external ID field so repeat orders find the same record. A paid order becomes a won Opportunity or an Order record, whichever your sales team reports on.
Carry the click IDs and UTM values from cart metadata onto custom fields on the Contact or the first order's Opportunity. That is what later lets you send Salesforce revenue, including deals a rep closes offline after the first web order, back to Google Ads or Meta as offline conversions. Write from a payment-capture subscriber, so cancelled and failed orders never become pipeline.
Two Salesforce traps meet Medusa here. Validation rules can reject an Opportunity missing a field your sales team requires while your subscriber logs success, so read the record back after writing. And if Salesforce price books differ from Medusa's customer-group prices, decide which system owns the amount before anyone builds a revenue report that uses both.
Medusa → Salesforce · what breaks
Why this join usually fails — Medusa → Salesforce
- 01
The Lead or Contact identity never reaches Medusa
The storefront is separate from the backend, and the identifier must be attached to the cart before the order is created.
- 02
Firing on order placed rather than payment captured
They are different events and the gap between them contains every failed and pending payment. Order-placed is the easier hook and the wrong one.
- 03
Writes that succeed and change nothing
Field-level security, validation rules and required-field constraints can reject a write while the API reports success. Open the record and look rather than trusting the response.
- 04
Nothing reconciles afterwards
Check the record in Salesforce itself, not the API response. Then confirm the value survives Lead conversion onto the Contact, Account and Opportunity — the mapping is separate and is usually the thing that was missed.
Medusa → Salesforce · the fix
What working looks like — Medusa → Salesforce
The Lead or Contact identity on every order
Conversions arriving in Salesforce
The marketing context appears on the record and flows into the opportunity, where sales and reporting can both use it.
Reconciled against the source
Medusa → Salesforce · architecture
How Medusa and Salesforce actually connect
- 1
Medusa holds the truth
Because you own the event handlers, the conversion can fire from the payment-captured event specifically rather than from whatever the frontend happened to render.
- 2
Salesforce needs a click to match
Salesforce needs a resolvable record and a custom field to write to. Field-level security and validation rules can silently reject writes, which is a Salesforce-specific failure that returns success at the API level and changes nothing.
- 3
The identifier is the bridge
The Lead or Contact identity, captured at the visit and carried into the Medusa order.
- 4
The event source decides reliability
Send orders at payment capture, at the paid total.
- 5
Deduplication at the destination
Salesforce deduplicates according to whatever matching rules your org has configured, which vary enormously between instances. Duplicate Leads are the standard failure and merging them afterwards is manual work.
Medusa → Salesforce · normal or broken
Working vs. broken, side by side — Medusa → Salesforce
Normal, not a fault
The Lead or Contact identity present on the order
Sent from a Medusa subscriber on order payment capture
Deduplicated correctly
Salesforce deduplicates according to whatever matching rules your org has configured, which vary enormously between instances. Duplicate Leads are the standard failure and merging them afterwards is manual work.
Reconciles with the source
Actually broken
The Lead or Contact identity missing on most records
The storefront is separate from the backend, and the identifier must be attached to the cart before the order is created.
Sent from the browser
They are different events and the gap between them contains every failed and pending payment. Order-placed is the easier hook and the wrong one.
Counted twice, or not at all
Field-level security, validation rules and required-field constraints can reject a write while the API reports success. Open the record and look rather than trusting the response.
Nobody has reconciled it
Medusa → Salesforce · diagnose
Diagnostic order — Medusa → Salesforce
- 01
Count orders carrying the Lead or Contact identity
- 02
Follow one real conversion end to end
- 03
Check which event your subscriber listens to
One line of code, and it decides whether you are counting orders or counting money.
- 04
Write a test value and open the record in the UI
The API saying it worked and the field actually holding the value are different things in Salesforce more than anywhere else.
- 05
Read the match rate, not the success message
Check the record in Salesforce itself, not the API response. Then confirm the value survives Lead conversion onto the Contact, Account and Opportunity — the mapping is separate and is usually the thing that was missed.
Medusa → Salesforce · prove
How it gets proven — Medusa → Salesforce
Source of truth
Medusa orders by payment status, emitted from your own subscriber code.
- The Lead or Contact identity confirmed present on a live order.
- A test value confirmed present on the record in the UI, and confirmed to survive Lead conversion.
- Payment-captured orders reconciled against imported conversions.
Medusa → Salesforce · free audit
What we check in the free audit
- Count orders carrying the Lead or Contact identity
- Follow one real conversion end to end
- Check which event your subscriber listens to
- Write a test value and open the record in the UI
- Read the match rate, not the success message
Checked against
Medusa orders by payment status, emitted from your own subscriber code.
Free30 minutesNo obligation
Medusa → Salesforce · when not to buy
When you don't need this — Medusa → Salesforce
- Measure identifier coverage yourself first — pull your last hundred orders and count how many carry the Lead or Contact identity.
- If every payment method you accept is instant, the two events nearly coincide and the distinction costs more than it returns.
- If your Salesforce org is administered by a team you cannot get time with, scope their availability before starting — this build is usually blocked on admin access rather than on the work.
Medusa → Salesforce · what we deliver
What gets built — Medusa → Salesforce
Identifier capture into Medusa
Write the identifier into cart metadata at first touch so it is carried onto the order automatically at completion.
Event source: a Medusa subscriber on order payment capture
Send orders at payment capture, at the paid total.
Dispatch to Salesforce
API writes to the Lead or Contact record, or a platform event, carrying the marketing context as custom field values.
Reversals where they exist
Refunds emit their own event and should reverse.
Written guarantee
95%+ tracking accuracy
Measured against Medusa orders by payment status, emitted from your own subscriber code.. Miss it and we keep working at no cost.
From $400 · See packages
FAQ
Medusa → Salesforce questions, answered
Write a subscriber on payment capture that upserts the Contact and Account by external ID and creates an Opportunity or Order, carrying click IDs from cart metadata.
Usually Contacts on an existing Account, matched by external ID or email domain. Create Leads only for buyers your sales team has never seen.
Almost always because the Lead or Contact identity never reached the Medusa order. The storefront is separate from the backend, and the identifier must be attached to the cart before the order is created. Measure coverage before debugging the dispatch.
Salesforce resolves on its own record identity — a Lead, a Contact, or an Account — rather than on a click identifier. What you are doing here is attaching marketing context to a record so the pipeline carries it, which means the click identifier arrives as a custom field value rather than as a matching key. The hazard is duplicates: two Leads for one person means two records with half the history each.
A Medusa subscriber on order payment capture. Send orders at payment capture, at the paid total.
Check the record in Salesforce itself, not the API response. Then confirm the value survives Lead conversion onto the Contact, Account and Opportunity — the mapping is separate and is usually the thing that was missed.
More on Medusa → Salesforce
- Medusa → Marketing CloudConnecting Medusa to Salesforce Marketing Cloud
- Salesforce → Google AdsConnecting Salesforce to Google Ads
- Salesforce → MetaConnecting Salesforce to Meta Conversions API
RELATED GUIDES
Where Medusa → Salesforce fits in the rest of your tracking
- Saleor → SalesforceConnecting Saleor to Salesforce
- Braintree → SalesforceConnecting Braintree to Salesforce
- Ecwid → SalesforceConnecting Ecwid to Salesforce
- Medusa → MarketoConnecting Medusa to Marketo
- Medusa → 6senseConnecting Medusa to 6sense
- BeautyConversion tracking for beauty brands, including the second order
- Shopify → SalesforceConnecting Shopify to Salesforce
- PrestaShop → SalesforceConnecting PrestaShop to Salesforce
Free · 30 min
Get Medusa and Salesforce joined properly
Free30 minutesNo obligation
