Skip to main content
The full order flow: cart, checkout, payment and shipment.

1. Quote tax at checkout

Call POST /calculations when the order is created, and again whenever it changes: a new address, a coupon, an added or removed item.
  • Send one line per item. Each line has quantity, unit_price, a tax code in product.tax_attributes, the buyer’s address in customer.address and the warehouse address in fulfillment.address.
  • Send shipping as its own line with the tax code ANCILLARY.SHIPPING. Each state’s rules decide whether it is taxed.
  • Send discounts on the lines they apply to, as discount_amount. See Discounts.
  • Send the full street address. A ZIP code alone works, but it is less precise where a ZIP code crosses tax jurisdiction lines.
  • A line with no tax code uses your account’s default product tax code, or TANGIBLE_PERSONAL_PROPERTY if your account has none.
Request
The response gives the tax on each line, broken down by jurisdiction, and the order’s total tax in tax_amount. Here the hoodies are taxed at Los Angeles’s 10.25% and shipping isn’t taxed, so tax_amount is "820.000000" ($8.20).
Tax is only calculated in jurisdictions where you are registered. Elsewhere a line comes back with 0 tax. Until your registrations are set up in Taxwire, every quote returns 0, so keep that in mind when testing.

2. Charge the buyer

Payment needs no Taxwire call. Charge the tax_amount from the last quote, and keep the lines, discounts and tax you charged with the order. If anything changed since the last quote, quote again first. tax_amount can include a fraction of the currency’s smallest unit, for example "1293.75" cents. Round the order’s tax_amount once. Rounding each line and adding them up can be off by one unit.

3. Record the sale when it ships

Record the sale when it takes place for tax. For goods shipped to the buyer, that is usually when they ship, not when the buyer pays. If you’re unsure for your products or states, ask us. Send the shipped lines to POST /transactions, with the same body as the quote plus: tax_amount is the tax Taxwire reports on your returns, so send what you actually charged. Without it, Taxwire reports the tax it calculates. The response is the saved transaction. Save its id with your order: refunds point to it as parent_transaction_id.