Understanding Tax Estimates
Tax estimates provide real-time tax calculations without creating permanent transaction records. Each estimate:- Calculates tax based on current nexus status
- Applies product taxability rules
- Checks customer exemptions
- Determines tax rates by jurisdiction
- Returns detailed tax breakdowns
Tax estimates don’t sync transactions: The
/v1/tax/estimate endpoint calculates tax but doesn’t create transaction records. If you need compliance tracking, sync transactions separately using /v1/transactions after payment is confirmed.When to Calculate Tax
Calculate tax during your checkout or billing flow, after address entry but before payment processing. Common integration points include:- Shopping cart pages: When customers review their order
- Checkout flows: After shipping address is entered
- Subscription billing: When calculating tax for recurring charges
- Quote generation: When providing price estimates
Tax Estimate Request Structure
Tax estimates require transaction details that mirror what you’d send in a transaction sync request. The endpoint needs:Required Fields
external_id: Your unique identifier for this estimate (e.g., “EST-2025-001”)date: Transaction date (usually today or the order date)currency: Currency code (e.g., “USD”)addresses: At least one address (SHIP_TO determines tax jurisdiction)transaction_items: Array of line items with product references
Transaction Items
Each transaction item includes:external_id: Unique identifier for this line itemexternal_product_id: Reference to product created in Kintsugiquantity: Item quantityamount: Line item amount (subtotal before tax)date: Item date (usually matches transaction date)
Addresses
Include at least one address with:type: “SHIP_TO” (determines tax jurisdiction) or “BILLING”street_1,city,state,postal_code,country: Address components
SHIP_TO address determines which tax rates apply. If no SHIP_TO address is provided, Kintsugi uses the BILLING address.
Tax Estimate Response
The tax estimate response includes:total_tax_amount: Total tax for the transactiontaxable_amount: Total amount subject to taxtax_breakdown: Detailed breakdown by jurisdictionhas_active_registration: Whether you have active registration in the jurisdictionjurisdictions: List of jurisdictions where tax applies
Using Tax Amounts
Use the tax amounts from the estimate response to:- Display tax to customers during checkout
- Calculate final totals including tax
- Store tax amounts for later transaction sync
- Validate tax calculations before payment
Tax Calculation Workflow
Nexus and Tax Calculation
Tax estimates only calculate tax if you have active registration (nexus) in the customer’s jurisdiction. The response includeshas_active_registration to indicate whether tax was calculated.
When Tax is Calculated
Tax is calculated when:- You have active registration in the customer’s state/jurisdiction
- Products are taxable in that jurisdiction
- Customer doesn’t have valid exemptions
When Tax is Zero
Tax is zero when:- You don’t have active registration in the customer’s jurisdiction
- Products are exempt from tax in that jurisdiction
- Customer has valid exemptions applied
Tax estimates reflect current nexus: The estimate endpoint uses your current nexus status at the time of the request. If you gain nexus in a jurisdiction after an estimate, future estimates will include tax for that jurisdiction.
Customer Exemptions
When calculating tax for exempt customers, reference the customer record in your estimate request:Error Handling
Common errors when calculating tax:- Product not found: Ensure products exist before referencing them in estimate requests
- Invalid address: Validate addresses before calculating tax
- Missing required fields: Review API documentation for all required fields
- Rate limiting: Implement retry logic with exponential backoff for rate limit errors
Best Practices
Follow these practices for reliable tax calculations:Request Structure
- Use consistent external IDs: Use the same external_id format for estimates and transactions
- Validate addresses first: Use address validation before calculating tax
- Reference products correctly: Ensure external_product_id values match your product records
- Include complete data: Provide all required fields to ensure accurate calculations
Response Handling
- Store estimate data: Save estimate responses to include tax amounts in transaction sync
- Handle zero tax: Account for cases where tax is zero (no nexus, exemptions, etc.)
- Display breakdowns: Show customers detailed tax breakdowns by jurisdiction when available
- Validate amounts: Verify tax amounts are reasonable before displaying to customers
Performance
- Cache estimates: Cache tax estimates for short periods when cart contents don’t change
- Debounce requests: Wait for address entry to stabilize before calculating tax
- Handle errors gracefully: Display fallback tax amounts or zero tax if estimates fail
- Monitor rate limits: Track API usage to avoid rate limiting
Integration Patterns
Different checkout flows require different tax calculation approaches.E-Commerce Checkout
For e-commerce platforms, calculate tax after address entry:- Customer adds items to cart
- Customer enters shipping address
- Validate address using address validation API
- Calculate tax using
/v1/tax/estimate - Display total with tax
- Process payment
- Sync transaction with tax amounts after payment
Subscription Billing
For subscription platforms, calculate tax during subscription creation:- Customer selects subscription plan
- Customer provides billing address
- Calculate tax for first billing cycle
- Store tax amount for recurring charges
- Recalculate tax if address changes or subscription renews
Multi-Step Checkout
For multi-step checkout flows:- Calculate tax after shipping address step
- Recalculate tax if customer changes address
- Recalculate tax if customer modifies cart
- Display updated totals after each recalculation
Tax Breakdown Details
Tax estimate responses include detailed breakdowns showing:- Jurisdiction-level taxes: State, county, city, and district taxes
- Tax rates: Percentage rates applied to taxable amounts
- Taxable amounts: Portions of the transaction subject to tax
- Tax amounts: Dollar amounts for each jurisdiction
- Show customers where tax is being applied
- Provide detailed receipts with tax information
- Debug tax calculation issues
- Validate tax amounts before payment
Next Steps
With tax calculations integrated:- Sync transactions: After payment, sync transactions with tax amounts from estimates. See the Syncing Transaction Records guide for details.
- Handle errors: Implement error handling for estimate failures. See the Error Handling guide for strategies.
- Optimize performance: Implement caching and request optimization to reduce API calls and improve checkout performance.