Calculation Principles
- Duties and taxes at checkout are calculated based on initial product allocation to hubs
- For domestic shipments (within the US or Canada), Shopify calculates domestic taxes which are combined with Global-e cross-border D&T (if applicable)
-
Duties and taxes are calculated per parcel based on parcel hub and destination country:
- Threshold calculations are based on parcel value (not order value)
- If final D&T exceeds the amount paid at checkout, the difference is absorbed as a merchant subsidy
- If a refund is issued before fulfillment is completed, the D&T will be refunded based on the D&T paid for the product at checkout.
How Shipping Cost Is Calculated
Overview
Many Shopify merchants use multiple shipping profiles or hubs. Shopify’s carrier-service API sends one request per hub, each containing only part of the cart, which leads to duplicate shipping charges, incorrect free-shipping threshold evaluations, and inconsistent promotions. This feature introduces a consolidated shipping-cost engine. At checkout start, a new ingestion API captures the full cart data (items, quantities, discounts, addresses). The shipping domain computes the total cost once, caches it, and returns delta-based responses so shoppers only pay the highest cost. The solution supports fallback to existing behaviour when data isn’t available, allows merchants to opt into split-shipping, and improves the checkout experience for mixed-hub orders, benefitting both merchants and Global-e.Business Process
The following shows the business process:- Checkout start: The client triggers a SaveShopifyCheckoutData API call (via webhooks, analytics, or UI extension) that sends the full cart context (items, quantities, discounts, addresses, locale, currency, token).
- Data ingestion & storage: Platform stores this snapshot in Couchbase/ValKey using the checkout token and merchant ID as keys.
- Carrier-service calls: Shopify calls the carrier service in parallel per hub/profile.
- Split-shipping option: If merchant opts for split shipping, skip consolidation and return individual hub costs.
- Fallback: If no cached checkout data is found (cache miss), perform the current per-hub shipping calculation (“as today”) to avoid blocking checkout.
- Duties & Taxes: The service reads the consolidated shipping cost from cache to compute duties and taxes consistently across hubs.
Prerequisites & Dependencies
The following list shows the prerequisites and dependencies:- Shopify checkout integration to trigger the ingestion API.
- Couchbase/ValKey storage layer with an atomic “first call” claim logic.
- MAS flag EnableCarrierServiceConsolidateCalculation to control rollout.
- Merchant configuration to align shipping service levels across hubs.
Relevant Platforms and Shippers/Carriers
The relevant platforms include Shopify, but may be extended to other platforms in the future. The relevant shippers/carriers include Global-e shipping services, and integration with the Duties & Taxes domain.Edge Cases and Limitations
If the ingestion API isn’t called before carrier-service calls (e.g., headless checkout or network failures), consolidation falls back to standard per-hub calculations.Feature KPIs
The following list shows the feature KPIs:- Percentage reduction in duplicate shipping charges for mixed-order merchants.
- Free-shipping thresholds evaluated at checkout level rather than per hub.
- Consolidated shipping-cost accuracy (is greater or equal to 95% of calls return single cost).
- Response time: 99% of consolidated shipping calls is less than 500 ms.
- Fallback hit rate is less thsn 5%.
FAQ and Common Questions
- Can this work with X platform? The initial implementation is for Shopify. Support for other platforms (GEM, Magento, SFCC, BigCommerce) may be considered after the Shopify rollout.
- Will it impact existing customers? Regular (single-hub) orders will not be affected, and shipping costs are calculated as today. For mixed-order merchants, the feature consolidates costs to avoid duplicates; merchants can opt out via configuration.
- What happens if checkout data is missing? If the ingestion API isn’t called or cache lookup fails, the system falls back to the existing per-hub calculation to avoid blocking checkout, and the event is logged.
- Can merchants opt to charge shipping separately? Yes. Merchants can choose split-shipping mode via configuration, which disables consolidation.

