Avalara actions
Reference for the Avalara actions: the connection type, each action and what it does, its inputs and outputs, and the live catalog call.
The Avalara block calculates sales tax with AvaTax, reads a tax document back, and voids one a re-bill replaced. For the plain-language overview, see Avalara.
When to use it
Put an Avalara step before the step that charges or invoices the customer, so the charged amount includes tax. Use getTransaction to reuse a document an earlier attempt already created, and voidTransaction when an invoice is replaced.
Connection
| Item | Value |
|---|---|
| Block type | avalara |
| Connection | API key. In Integrations, Avalara asks for Account ID, License Key, Environment (Production or Sandbox) and an optional Company Code used as the step default |
| Account pin | config.connection. An unpinned step uses the default Avalara connection; a pinned connection that no longer resolves stops the run instead of falling back, because the default may be a different environment |
Actions
The action id is avalara.<action>. All three are in the Studio Action list.
| Action | What it does | Required config |
|---|---|---|
createTransaction | Create an AvaTax transaction and return document and line tax | documentCode, documentDate, customerCode, shipFrom, shipTo, lines |
getTransaction | Read a transaction by company, document code and type | documentCode |
voidTransaction | Void a transaction | documentCode |
Fields
| Field | Type | Used by | Meaning |
|---|---|---|---|
companyCode | string | All | AvaTax company code. Defaults to the code stored on the connection |
documentCode | string | All | Stable document code, for example the invoice number |
documentType | SalesInvoice (default), SalesOrder, ReturnInvoice | All | SalesOrder calculates only; ReturnInvoice is a credit with negative amounts |
documentDate | YYYY-MM-DD | Create | Required. AvaTax picks the rates and filing period from it |
customerCode | string | Create | AvaTax customer code |
currencyCode | string | Create | ISO 4217 code. Omitted means USD; a blank or malformed value fails the step |
shipFrom, shipTo | JSON | Create | { line1, city, region, postalCode, country } |
lines | JSON array | Create | [{ number, amount, quantity?, itemCode?, taxCode?, description?, discounted?, exemptionCode? }] |
referenceCode | string | Create | On a ReturnInvoice, the code of the invoice it credits |
exemptionNo | string | Create | Exemption certificate number |
entityUseCode | string | Create | AvaTax entity use code |
taxOverride | JSON | Create | { type: "TaxAmount", taxAmount, reason } to file a tax amount decided elsewhere. taxAmount is in currency units with at most two decimals |
discount | number | Create | Reserved. A non-zero discount fails the step |
commit | boolean | Create | Finalize the document for filing. Default false |
voidReasonCode | DocVoided (default), DocDeleted, PostFailed, AdjustmentCancelled, Unspecified | Void | AvaTax reason code |
Output
createTransaction returns transactionId, code, status, documentType, taxDate, currencyCode, totalAmount, totalTax, totalTaxCalculated, grandTotal, lineCount, linesTruncated, lines (up to 500, each with up to 32 jurisdiction details), summaryCount, summaryTruncated, summary (up to 100 rows) and messages.
grandTotalis in currency units (270.63 means $270.63). To charge it through a payment step that takes cents, write{{steps.<id>.grandTotal | multiply: 100}}.- Numeric line fields are
nullwhen AvaTax omits them, never0. The step fails if AvaTax omitstotalTax.
getTransaction returns { found: false, code, documentType } when there is no document, or found: true with transactionId, code, status, documentType, customerCode, totalAmount, totalTax, date, exemptionNo and lines.
voidTransaction returns transactionId, code, status and documentType as AvaTax confirmed them.
Replays and retries
- Before creating, Loopfour asks AvaTax whether a document with the same company, type and code exists. If one does, the step fails with "Nothing was submitted". Matching creates are also serialized across workers.
- Keep
documentCodestable for one invoice. Reusing the same code is what lets this check stop a duplicate; a new code for each attempt defeats it. - If a create fails after it was sent (for example a rate limit), the step does not retry, because AvaTax may have stored the document. Check the document in Avalara, or call
getTransaction, before you re-run. - Keep the step's error handling on
fail. Withcontinue, a later payment step could run with no tax amount. - When a re-bill replaces an invoice, void the old document with the same company code, document code and document type the create step used. Otherwise the old committed document stays in your filing.
Example
{
"id": "calc_tax",
"type": "action",
"name": "Calculate sales tax",
"action": "avalara.createTransaction",
"config": {
"operation": "createTransaction",
"connection": "<avalara-connection-id>",
"documentCode": "{{input.invoiceNumber}}",
"documentType": "SalesInvoice",
"documentDate": "2026-11-12",
"customerCode": "{{input.customerId}}",
"currencyCode": "USD",
"shipFrom": { "line1": "1 Market St", "city": "Philadelphia", "region": "PA", "postalCode": "19103", "country": "US" },
"shipTo": { "line1": "100 Main St", "city": "Seattle", "region": "WA", "postalCode": "98104", "country": "US" },
"lines": [{ "number": "1", "amount": 250.0, "quantity": 2, "itemCode": "WIDGET", "taxCode": "P0000000" }],
"commit": false
}
}A later Stripe step charges {{steps.calc_tax.grandTotal | multiply: 100}}.
Live catalog
GET /api/v1/blocks/avalara returns the fields and the three actions. See Block and action discovery.
Errors and limits
An Avalara connection is required. Select an account on this step.Document discounts are not supported until Avalara discount totals are verified.Avalara already has a transaction for document code "…" and type "…". Nothing was submitted: use the existing document or a new code.An Avalara transaction already exists for document code "…": AvaTax itself rejected the duplicate.lines must total a negative amount on a ReturnInvoice;taxOverride.taxAmount must be zero or less on a ReturnInvoice.
Attio actions
Reference for the Attio actions: the sign-in connection, each action id, the fields each executor reads, the record output and a complete example.
Box actions
Reference for the Box actions: the Box connection, each action id, the daily file sync, download and PDF limits, outputs and an example.
Loopfour