Hey Shopify Developer Community!
I’m working on an order editing app and encountered an interesting challenge with market-specific pricing that I’d love to get some guidance on.
The Challenge
I’m building an app that lets merchants edit orders, but I’ve run into a pricing discrepancy between the storefront and admin API prices. Here’s the specific scenario:
- A product costs $70 AUD in the admin
- Using current FX rates, this converts to $77 NZD
- The merchant has rounded this up to $80 NZD in their market settings
When my app adds products to an order through the Admin API, it’s using the base price instead of the market-specific price, effectively undercharging customers.
Current Workarounds
For cases where storefront prices are lower than admin prices, I’ve successfully implemented a solution:
- Query the storefront API for the current price
- Query the admin API
- Apply a custom line item discount to match the storefront price
However, this approach doesn’t work when storefront prices are higher than admin prices.
Interesting Discovery
While investigating, I noticed the Shopify admin UI uses a parameter called useContextualPricing
when editing products, which seems to solve this exact use case. However, this parameter isn’t currently available in the public API.
Questions for the Community
- Is there a recommended way to handle market-specific pricing in order editing apps?
- Are there plans to expose contextual pricing functionality in the API?
- Has anyone found a reliable workaround for this scenario?
Thanks in advance for any insights or guidance!