Hello!
We are currently working on integrating Shopify stores with our system using the GraphQL Admin API.
Our objective is to calculate shipping costs , specifically for subscription recurring orders.
Is there an officially recommended approach for achieving this using the GraphQL Admin API, or is this functionality only available through the Storefront API or checkout workflows?
Any guidance, suggested endpoints, or known workarounds would be greatly appreciated.
Thank you in advance!
Hi @WebcontriveApps
The recommended option would be to use the Storefront API to create a checkout and fetch shipping rates. You could try to manually calculate with the Admin API by querying the shipping rates of existing orders but that’s not a reliable method - so I wouldn’t recommend it. Would would be preventing you from using the Storefront API?
Thank you for the clarification!
To provide more context — we’re building a solution that merges recurring subscription orders based on their frequency and alignment, and we need to accurately calculate shipping costs for these merged orders according to the merchant’s existing shipping settings on Shopify.
Our goal is not to create a checkout or process payment, but simply to estimate shipping costs for upcoming merged subscription orders — exactly as Shopify would calculate them if the order was placed via the storefront.
Example Scenario:
- Week 2: Product A ($40, bi-weekly) → Shipping is $10
- Week 4: Product A + Product B ($40 + $35) → Shipping is Free, based on merchant’s rule: “Free shipping over $75”
So when we merge orders, we want to simulate Shopify’s shipping rules and logic:
- Free shipping thresholds
- Price-based rates
- Weight-based tiers
- Location-specific rules
We understand the Storefront API can fetch shipping rates via the checkout flow — but that involves cart-level context and doesn’t align well with subscription logic (which is built on contracts, not carts).
Our Questions:
- Is there a way to programmatically calculate shipping costs (based on merchant’s configured shipping settings) using GraphQL Admin API, Subscription APIs, or another backend-safe method?
- If not, what’s the recommended workaround for estimating shipping costs server-side for merged subscription orders, especially when no checkout is being created?
- Can Shopify expose shipping rate rules in any way that allows third-party systems to simulate the rate calculation logic accurately?
Any guidance or best practices for this type of subscription shipping logic would be incredibly helpful.
Thanks again for your time and insights!
@Liam-Shopify Can you please check above message?
Hi @WebcontriveApps
You can fetch shipping zones, profiles, and rates via the Admin API and then replicate the merchant’s shipping logic in your own backend. This involves:
- Querying the merchant’s shipping settings (zones, price/weight/location rules).
- Calculating the merged order’s subtotal, total weight, and shipping address.
- Applying the rules yourself to estimate the shipping cost.
This will give you all the merchant’s shipping rules, which you can then use to simulate rate calculation in your own code.
- Limitations:
- You must keep your logic in sync with Shopify’s, including any changes merchants make.
- You must handle edge cases (e.g., combined price/weight rules, location-specific logic, etc.).
- You cannot simulate third-party carrier-calculated rates (e.g., USPS, FedEx) as Shopify does not expose their calculation logic.
RE: Can Shopify expose shipping rate rules in any way that allows third-party systems to simulate the rate calculation logic accurately?
- Shopify exposes shipping rules (zones, price/weight tiers, free shipping thresholds, etc.) via the Admin API’s delivery profiles and shipping rates.
- Shopify does NOT expose the actual shipping rate calculation engine or a “simulate shipping” endpoint in the Admin API.
- Carrier-calculated rates are not exposed for simulation.
Thank you for the clarification!
When I trigger a recurring billing attempt for a subscription, I want to pass the shipping price data as well. How can I achieve this?
I’m currently using the following mutation to initiate the billing attempt, but I don’t see any option in the payload to include shipping price details.
Where and how should I pass the shipping-related data?
Additionally, when merging three contracts and triggering a billing attempt using the same mutation, how can I manage the shipping price in that case as well?
Is there a flow where, during a recurring billing attempt, Shopify automatically calculates the shipping charges and places the order accordingly?
If there are any recommendations or better ways to handle this, I’d be happy to learn.
Thanks again for your time and insights!