Hello @ezup
You’re on the right track with using the DraftOrderCreate API for Shopify, but there’s a limitation: DraftOrderCreate does not automatically calculate tax lines unless certain conditions are met.
Here’s a breakdown of why you’re not seeing tax info — and how to get calculated taxes properly for use with a 3rd party payment gateway:
Why DraftOrderCreate isn’t returning taxes:
-
Taxes are calculated only when the use_customer_default_address or full tax-relevant data is passed, and even then, only if Shopify can determine the tax jurisdiction.
-
Shopify doesn’t calculate tax lines for draft orders the same way it does for checkout or order APIs.
-
Most importantly: taxes on Draft Orders are not guaranteed to be calculated until the order is completed or the invoice is sent.
Solution: Use the Checkout API or Order/Tax Services API instead
If your goal is to retrieve tax calculations before processing payment externally, this is the more reliable route:
Option 1: Use the Checkout API
The Checkout API (Storefront API) will:
. Accept full line items and shipping address
. Return a checkout object with accurate taxLines, totalTax, and totalPrice
Example mutation:
graphql…
mutation checkoutCreate($input: CheckoutCreateInput!) {
checkoutCreate(input: $input) {
checkout {
id
totalTaxV2 {
amount
}
totalPriceV2 {
amount
}
}
checkoutUserErrors {
field
message
}
}
}
You’ll pass in:
. Line items (variant IDs + quantity)
. Shipping address
. Email (required)
Option 2: Use the Order API with Tax Services (Only for Shopify Plus)
If you’re on Shopify Plus, you may be able to use custom tax services or Orders API with tax overrides — but for most stores, Checkout API is the only reliable pre-payment tax calculator.
Why not to rely on DraftOrder for tax estimates
. DraftOrder was designed for internal/admin use (e.g., invoices or phone orders), not real-time tax quotes.
. Its tax calculation behavior is limited and inconsistent across store setups (e.g., US vs. EU vs. Canada).
Your Best Workflow (Recommended)
-
Use Storefront checkoutCreate mutation with full shipping address
-
Get the accurate totalTax and totalPrice
-
Pass that totalPrice to your 3rd-party payment gateway
-
After payment, use the Order API to create an order with financial_status: paid and the externally processed payment details
Thank you 