Shopify Buy SDK multi-currency price mismatch with line items
This is a Shopify-specific issue rather than a Sanity question, but I can provide some helpful context since you're asking the community.
The issue you're experiencing with Shopify Buy SDK and presentment prices not matching line items is a known problem in the Shopify ecosystem, particularly with multi-currency stores. Based on the thread you linked and common patterns with this issue, here's what's typically happening:
The Core Problem:
When you fetch product data with includePresentmentPrices: true, the presentment prices shown on products don't always match what appears in the checkout line items. This is usually due to:
- Exchange rate locking: Shopify locks the exchange rate at checkout creation, so if there's any delay or rate fluctuation between fetching products and creating the checkout, prices can differ
- Rounding rules: Different rounding rules applied at the product level vs. checkout level, especially for .99 pricing strategies in Markets
- Timing issues: The presentment currency rate used when querying products may differ from the rate applied when the checkout is created
Common Solutions:
- Always use checkout line item prices as the source of truth for display purposes once a checkout is created, rather than relying on the original product presentment prices
- Refetch checkout data after creation to get the actual locked-in prices that will be charged
- Check your Markets rounding rules in Shopify admin - inconsistent rounding settings can cause these mismatches
- Ensure presentmentCurrencyCode is consistently set throughout your flow
If you're using Sanity with Shopify:
If you're building a Sanity-powered storefront that integrates with Shopify, you might want to consider storing only reference data (like product IDs, descriptions, images) in Sanity while always fetching real-time pricing from Shopify directly. This ensures you're always working with current exchange rates and pricing.
Since this is fundamentally a Shopify API behavior issue rather than a Sanity issue, you may get better traction posting in Shopify developer communities or their GitHub discussions for the Buy SDK. The thread you linked shows others have experienced this, and it often requires working within Shopify's pricing model constraints rather than finding a "fix."
Show original thread3 replies
Was this answer helpful?
Sanity – Build the way you think, not the way your CMS thinks
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.