Logo
Home

Automating tax calculations with the Sales Tax API

Managing sales tax can be complex, and getting it wrong costs time, money and credibility. That’s why QuickBooks Online’s Sales Tax API, launched as part of the Premium APIs suite, empowers developers to integrate automated sales tax calculations directly into their apps.

Whether you’re building invoicing tools, e-commerce platforms or enterprise-grade workflows, the Sales Tax API provides accuracy and regulatory peace of mind by embedding QuickBooks’ trusted Automated Sales Tax engine into your own experiences.

Click here to learn more about partner tiers and how to upgrade.

In this post, we’ll cover

  • Why the Sales Tax API matters
  • How the API works
  • Example workflows for calculating sales tax with GraphQL
  • Sample code and app references
  • Best practices and key limitations

Why the Sales Tax API matters

QuickBooks Online’s Automated Sales Tax (AST) engine dynamically calculates accurate sales tax based on:

  • location
  • product taxability
  • jurisdiction logic

The Sales Tax API exposes this capability so your app can confidently compute taxes during invoice creation or checkout processes. It ensures:

  • automatic compliance with tax rules
  • reduced manual overrides
  • accurate, jurisdiction-level breakdowns
  • consistent tax outcomes across systems

How the API works

1. Authorisation & scope

To call the Sales Tax API, your app must request the following OAuth scope:

indirect-tax.tax-calculation.quickbooks

  • Production GraphQL: https://qb.api.intuit.com/graphql
  • Sandbox GraphQL: https://qb-sandbox.api.intuit.com/graphql

Required headers:

  • Authorization: Bearer <access_token>
  • Content-Type: application/json
2. API workflows
  • GraphQL tax calculations: Request precise tax amounts for transaction lines.
  • REST-based AST: Allow QuickBooks to auto-calculate tax during REST invoice creation.

Workflow example: Calculating sales tax via GraphQL

Step 1: Build the GraphQL tax calculation query.

query {
  indirectTaxCalculationById(
    input: {
      line: [
        { amount: 100.00, taxCode: "TAXABLE" },
        { amount: 50.00, taxCode: "NON_TAXABLE" }
      ],
      customerRef: { value: "123" },
      txnDate: "2025-08-25"
    }
  ) {
    taxCalculation {
      totalTax
      breakdown {
        jurisdiction
        amount
      }
    }
  }
}

This response includes both total tax and jurisdiction-level breakdowns.

Step 2: Apply the calculated tax or proceed with REST-driven AST when creating the final invoice.

Sample app reference

Explore the official Intuit Developer sample repos for hands-on examples:

  • OAuth configuration & required scopes
  • Queries such as indirectTaxCalculationById
  • Parsing breakdowns and feeding results into transactions

Browse sample repos

Limitations & considerations

  • Partner access: Available to Silver, Gold and Platinum partners.
  • Jurisdiction differences: AST behaviour differs between US and non-US regions.
  • Setup required: Tax agencies and rates may need configuration in QuickBooks.

Best practices

  • Use GraphQL for accurate UI or pre-transaction estimates.
  • Use REST AST for standard QuickBooks invoice flows.
  • Test in sandbox using the GraphQL endpoint.
  • Request only the required indirect-tax scope.
  • Handle GraphQL rate limits gracefully.
  • Ensure tax setup is complete before calculating.

The final note

The Sales Tax API brings QuickBooks Online’s reliable, compliant sales tax engine directly into your app. Whether building invoicing, checkout or enterprise workflows, you’ll ensure accuracy while reducing manual overhead. Combining GraphQL for detailed calculations with REST AST for transactional flows gives you flexibility and power.

Getting started by partner tier

  • Builder: Click here to upgrade
  • Silver: Submit a request (product: Partner Program, category: API usage)
  • Gold & Platinum: Enable required scopes in the Permissions tab

Additional resources


Posted

in

,

by