verification
use it
# add to stunt.yaml
services:
avalara:
adapter: embedded:avalara-style
# then
$ stunt upThe embedded: source extracts this adapter from the binary — no git clone, fully offline.
how to mock the Avalara AvaTax REST API locally
Install stunt, paste the service block above into stunt.yaml, run stunt up — then point your client at localhost instead of Avalara AvaTax REST API. It works offline, keeps state across requests and restarts, and every response is synthetic: the route shapes, status codes, pagination, and webhook delivery follow the real Avalara AvaTax REST API 2 surface — the data is fake, the behavior is real.
backing stores
transactionscompanies
api surface (8)
generated from the adapter manifest — exactly what boots, nothing more
8 routes
POST/v2/tax/calculate
POST/v2/transactions/create
GET/v2/transactions
GET/v2/transactions/{id}
POST/v2/transactions/{id}/void
GET/v2/companies
GET/v2/definitions/nexuses
GET/v2/definitions/taxcodes
VM-verified behaviors (19)
- ✓every v2 endpoint demands a credential: a bare call is a 401 AuthenticationRequired envelope
- ✓any Bearer or any HTTP Basic credential opens the gate
- ✓a non-Basic/Non-Bearer scheme does not count as a credential
- ✓the effective rate keys off the address state (CA 0.095) with a State/County/City/Special breakdown
- ✓the summary aggregates the taxable base per jurisdiction
- ✓per-line tax rounds to cents: two lines aggregate, line 2 keeps its own tax
- ✓SDK decimal strings ("100.00") price identically to JSON numbers
- ✓the shipFrom/shipTo form keys off shipTo (NY 0.0875)
- ✓unknown or missing addresses fall back to the synthetic 0.0825 default
- ✓create prices the document, mints id/code/companyId and applies AvaTax defaults
- ✓an omitted date defaults to the clock's today, and advances with it
- ✓read round-trips by id; unknown ids are 404 NotFound
- ✓the list supports OData $filter and $orderBy with @recordsetCount
- ✓$top/$skip pages through an @odata.nextLink that round-trips
- ✓void flips status to Cancelled and the record reads back cancelled
- ✓re-void is idempotent
- ✓the companies catalog lists DEFAULT and STORE1 with default locations
- ✓nexus $filter literals are typed: id eq 1001 matches ints, hasNexus eq true matches bools
- ✓the taxcode catalog is filterable by taxCode
Not implemented (5)
- No company CRUD — GET /v2/companies list only
- No address validation (/v2/addresses/resolve)
- No createoradjust, settle, or per-line transaction operations
- No customers, certificates, or exemption endpoints
- No jurisdiction lookups — definitions serve nexuses and taxcodes only
Differs from the real API (3)
- Tax is a deterministic split — State 50%, County 25%, City 20%, Special 5% of the rate
- Void returns a minimal {id, status} envelope; real AvaTax returns the full TransactionModel
- Re-void is idempotent 200; real AvaTax rejects voiding a Cancelled document
want more of the Avalara AvaTax REST API surface? adapters are YAML + Starlark — the authoring guide covers adding routes, fixtures, and state machines. Open an issue for anything big first, or just file a PR — merged routes ship in the next release.