Technical
Shopify Odoo Integration: What to Sync, Who Owns It, How to Test
A practical guide to connecting Shopify and Odoo: which data to sync, which system owns it, how to handle multiple stores and warehouses, how to survive failures and retries, and how to test before go-live.
Kalvyai Engineering · · 8 min read

On this page
Most Shopify and Odoo integrations that go wrong do not fail because of bad code. They fail because nobody decided which system is the source of truth for each piece of data. Two systems then overwrite each other, stock drifts, and finance stops trusting the numbers.
This post covers what to sync, who should own it, how to handle multiple stores and warehouses, how to deal with failures, and how to test before you switch it on.
Decide data ownership first
Before you map a single field, write down one owner per data type. The owner is the only system allowed to create or change that data. The other system receives a copy.
A common split that works for most product businesses:
Data | Owner | Direction | Notes |
|---|---|---|---|
SKU, barcode, cost, weight | Odoo | Odoo → Shopify | Odoo is where purchasing and stock happen |
Selling price | Odoo (usually) | Odoo → Shopify | Unless marketing manages prices in Shopify |
Descriptions, images, SEO | Shopify | Not synced back, or Shopify → Odoo | Content teams work in Shopify |
Stock quantities | Odoo | Odoo → Shopify | Never let both systems adjust stock |
Orders | Shopify creates them | Shopify → Odoo | Odoo owns fulfilment after import |
Fulfilment and tracking | Odoo | Odoo → Shopify | Delivery validated in Odoo updates Shopify |
Customers | Shopify for online contacts | Shopify → Odoo | Odoo owns credit terms and B2B data |
Payments captured | Shopify / payment provider | Shopify → Odoo | Odoo owns the accounting entries |
Refunds | Shopify (where issued) | Shopify → Odoo | Odoo records the credit note |
Your split may differ. The point is that every row has exactly one owner. If a field has two owners, you will get loops and overwrites.
What to sync, object by object
Products and variants
Match products on SKU, not on name. Each Shopify variant should map to one Odoo product variant, and you should store the Shopify product ID and variant ID on the Odoo record so later updates do not rely on SKU lookups alone.
Things to settle early:
- Variant attributes. Shopify limits the number of options per product. If your Odoo products use more attributes, you need a mapping rule.
- Unsynced products. Not every Odoo product should be on Shopify. Use an explicit flag on the Odoo product rather than syncing everything.
- Deletions. Prefer archiving over deleting in both systems. A deleted product breaks the link to historical orders.
Stock
Stock is where most integrations lose trust. Keep Odoo as the owner and push quantities to Shopify per location.
Push the quantity you can actually sell, not the raw on-hand figure. In Odoo, free_qty on the product (computed for a given location context) already excludes reserved quantities. Many businesses also subtract a small safety buffer per SKU so that a delayed sync does not cause overselling.
In Shopify, stock lives on inventory items at locations. Each variant has an inventory item, and you set the available quantity per location. Push absolute values ("set to 12"), not deltas ("subtract 1"). Absolute values are safe to resend; deltas double-count when a message is retried.
Orders
Orders flow from Shopify to Odoo. Usually you import them as confirmed sales orders so Odoo creates the delivery.
Decisions you need to make:
- When to import. On order creation, or only once payment is captured. Importing unpaid orders reserves stock early, which is often what you want, but you then need to handle cancellations.
- Taxes. Either trust the tax lines Shopify calculated and map them to Odoo taxes, or let Odoo recompute. If Odoo recomputes, totals can differ by rounding. Our usual rule: the amount the customer paid in Shopify is the truth, and any mismatch is flagged for review rather than silently corrected.
- Shipping, discounts, gift cards. Map shipping lines to a service product, order-level discounts to a discount line or distributed per line, and decide how gift card payments are booked.
- Edits and cancellations. Shopify orders can be edited after creation. Decide whether edits update the Odoo order or are blocked once the delivery has started.
After the order ships in Odoo, send the fulfilment back to Shopify with the tracking number so the customer gets the shipping notification. Shopify handles fulfilment through fulfilment orders assigned to locations, which matters once you have more than one warehouse (see below).
Customers
Create or match an Odoo contact for each order. Match on email first, then on phone, and store the Shopify customer ID on the contact. Guest checkouts have no Shopify customer record, so decide whether they become individual contacts or go to a generic "Shopify guest" partner.
Marketing consent belongs to Shopify. Do not push consent changes back unless you have a clear process for it.
Payments
Shopify captures the money; Odoo records it. For each order, register a payment in Odoo against a journal per gateway (Shopify Payments, PayPal, manual, cash on delivery, and so on).
The harder part is payouts. A payout from a gateway is net of fees and refunds and covers many orders. Plan how you will match the bank deposit to the individual payments and book the fees, otherwise your gateway clearing account will never reach zero.
Refunds and returns
Refunds created in Shopify should create a credit note in Odoo linked to the original invoice. If the refund includes restocking, create a return in Odoo as well so the stock comes back through a proper receipt, not a manual adjustment.
Watch for partial refunds (one line, or shipping only) and refunds without a return (damaged item, goodwill). Each needs its own mapping.
Multi-store and multi-warehouse setups
Several Shopify stores, one Odoo
Each store needs its own configuration in Odoo:
- company (if stores belong to different legal entities)
- warehouse to fulfil from
- pricelist and currency
- sales team or channel tag for reporting
- payment journals and tax mapping
The same SKU can exist in several stores. Keep one Odoo product and store one Shopify ID mapping per store, instead of duplicating products.
If stores sell from shared stock, every store reads from the same Odoo quantity. Overselling risk rises with the number of channels, so safety buffers matter more here.
Several warehouses
Map each Shopify location to one Odoo warehouse or stock location. Then:
- Push stock per location, using the matching Odoo location as the context for
free_qty. - When an order arrives, use the location Shopify assigned to the fulfilment order to pick the Odoo warehouse, or apply your own routing rules in Odoo. Pick one approach; mixing both causes confusion.
- When a delivery is validated, create the fulfilment in Shopify against the right fulfilment order and location.
Keep a mapping table you can read and edit, for example:
stores:
eu-store:
company: "Acme EU"
pricelist: "EUR Retail"
locations:
"gid://shopify/Location/111": "WH-AMS/Stock"
"gid://shopify/Location/112": "WH-BER/Stock"
safety_buffer: 2
us-store:
company: "Acme US"
pricelist: "USD Retail"
locations:
"gid://shopify/Location/201": "WH-NJ/Stock"
safety_buffer: 3Handling failures and retries
Assume every message will sometimes arrive late, twice, out of order, or not at all. Shopify documents that webhooks can be delivered more than once and are not guaranteed to arrive in order. Shopify also retries failed deliveries for a limited time.
Receive fast, process later
Your webhook endpoint should do three things only: verify the signature, store the raw payload, and return 200. Do the actual work in a background job. Slow endpoints cause timeouts, which cause Shopify retries, which cause duplicates.
import base64
import hashlib
import hmac
def verify_shopify_hmac(raw_body: bytes, header_hmac: str, secret: str) -> bool:
digest = hmac.new(secret.encode(), raw_body, hashlib.sha256).digest()
expected = base64.b64encode(digest).decode()
return hmac.compare_digest(expected, header_hmac)
def handle_webhook(request, store):
raw = request.get_data()
if not verify_shopify_hmac(raw, request.headers.get("X-Shopify-Hmac-Sha256", ""), store.secret):
return 401
event_id = request.headers.get("X-Shopify-Webhook-Id")
topic = request.headers.get("X-Shopify-Topic")
# Store first; a unique constraint on (store, event_id) drops duplicates
save_inbound_event(store, event_id, topic, raw)
return 200Make every job idempotent
Processing the same event twice must give the same result. Practical rules:
- Look up the Odoo record by Shopify ID before creating anything. One Shopify order ID, one Odoo sales order, enforced by a unique constraint.
- Compare the Shopify
updated_aton the payload with the last one you processed. Skip older payloads that arrive late. - Push absolute stock values, never deltas.
Retry the right failures
Split errors into two groups:
RETRYABLE = {429, 500, 502, 503, 504}
def classify(error):
if getattr(error, "status", None) in RETRYABLE:
return "retry" # rate limit or temporary outage
if isinstance(error, (TimeoutError, ConnectionError)):
return "retry"
return "needs_human" # missing SKU, bad tax mapping, archived productRetry transient errors with exponential backoff and a cap on attempts. Do not retry data errors: a missing SKU will still be missing on the tenth attempt. Move those jobs to a failed state with a clear message and alert someone.
Respect Shopify API rate limits. The REST and GraphQL Admin APIs use different limiting models, so read the limit headers or cost fields in responses and slow down before you hit 429s.
Reconcile on a schedule
Webhooks alone are not enough. Add scheduled jobs that:
- Pull orders updated since the last successful cursor and import anything missing.
- Run a full stock push at a quiet hour to correct drift.
- Compare order counts and totals per day between Shopify and Odoo and report differences.
This catches events lost during outages, deploys, or webhook subscriptions that were removed after repeated failures.
Make failures visible
A failed job that nobody sees is worse than one that crashes loudly. You need a list of failed and pending jobs per store, the error message, the payload, and a retry button. Our ConnectIQ app adds this to Odoo: unified multi-store sync telemetry, queue tracking and AI error diagnostics.
Testing before go-live
Test against copies, never against production.
- Set up a test environment. Use a Shopify development store and a copy of your Odoo database with outgoing email and live payment providers disabled. Odoo can neutralise a duplicated database.
- Load real master data. Import your actual product catalogue, locations and tax setup. Test data that is too clean hides mapping problems.
- Run the order scenarios. At minimum:
- single item, multiple items, multiple variants
- discount code, free shipping, gift card
- each payment method you offer, including cash on delivery
- order edit after creation
- cancellation before and after shipping
- full refund, partial refund, refund with and without restock
- split shipment from two warehouses
- guest checkout and returning customer
- each store and currency
- Break things on purpose. Stop the Odoo worker while orders come in, then restart it. Send the same webhook twice. Send an old payload after a newer one. Archive a product that is in an open order. Confirm nothing duplicates and every failure shows up in your monitoring.
- Check stock end to end. Receive stock in Odoo, confirm Shopify updates. Sell in Shopify, confirm the reservation in Odoo and the new quantity in Shopify.
- Check accounting. Have finance review invoices, payments, credit notes and a sample payout reconciliation. Totals should match Shopify to the cent.
- Load test. Push a realistic peak volume, such as your busiest sale day, and watch queue length and API limit usage.
- Run in parallel. If possible, run the integration in read-only or shadow mode against production for a few days and compare results before letting it write.
Go-live checklist
- Initial product and stock sync completed and spot-checked
- Open Shopify orders imported or deliberately excluded
- Webhooks registered for production URLs and verified
- Scheduled reconciliation jobs enabled
- Alerts routed to a named person, not a shared inbox nobody reads
- Rollback plan written down: how to pause sync and fulfil manually
How Kalvyai can help
We design and build Shopify and Odoo integrations, from the ownership model and mapping through to retries, monitoring and go-live testing. If you want a ready-made starting point, our Shopify Odoo Connector connects Shopify and Odoo and keeps them in sync. You can browse our other apps at store.kalvyai.com.
If you are planning an integration or fixing one that drifts, get in touch and tell us about your stores, warehouses and order volume.
- Shopify
- Odoo
- Integration
- Inventory
- E-commerce
- ERP
Kalvyai Engineering · Engineering team
The engineers who build, connect and fix business systems at Kalvyai: Odoo, ERPNext, Shopify and AI agents that work inside them with approvals, budgets and an audit trail.



Comments
No comments yet. Questions and corrections are welcome.
Rate this post or leave a comment