---
title: AvaTax App Architecture
slug: developer/app-store/apps/avatax/architecture
sidebar:
  label: Architecture
  order: 2
seo:
  title: AvaTax App Architecture
  description: AvaTax App Architecture
lastModified: '2026-02-23'
---

## Webhook events

The AvaTax App uses the following webhook events for tax reporting and calculations:

- [`OrderCalculateTaxes`](/api-reference/taxes/objects/calculate-taxes)
- [`CheckoutCalculateTaxes`](/api-reference/taxes/objects/calculate-taxes)
- [`OrderConfirmed`](/api-reference/orders/objects/order-confirmed)

## Calculating taxes

Calculating taxes using external tax providers happens through a synchronous [`CalculateTaxes`](/api-reference/taxes/objects/calculate-taxes) webhook event. A [synchronous webhook](/developer/extending/webhooks/synchronous-events/overview) awaits a response from the app before continuing.

While the app is waiting for the values of the calculated taxes, the sequence of actions is as follows:

```mermaid
sequenceDiagram
    CalculateTaxes->>+App: Send webhook payload
    App-->>-AppMetadata: Fetch app configuration from metadata
    AppMetadata-->>+App: Return configuration
    App-->>+TaxProvider: Use configuration & webhook payload to create transaction
    TaxProvider-->>-App: Return created transaction
    App-->>-CalculateTaxes: Transform the transaction and return as webhook response
```

During tax calculation, the transactions on the AvaTax side are not recorded. They will not appear in the tax provider's dashboard.

## Recording transactions

Once the order is finalized, we want to send a transaction to the tax provider for tax reporting. This is done through [asynchronous webhook](/developer/extending/webhooks/asynchronous-events) events that fire on different order lifecycle actions.

```mermaid
sequenceDiagram
    OrderConfirmed->>+App: Send webhook payload
    App-->>-AppMetadata: Fetch app configuration from metadata
    AppMetadata-->>+App: Return configuration
    App-->>+TaxProvider: Use configuration & webhook payload to create transaction
    TaxProvider-->>-App: Return created transaction
```

Committing transactions will happen during the transaction creation based on the provider configuration.

For example, the transaction is committed on `OrderConfirmed` if the `isAutocommit` flag is set to `true` in the configuration.

## Canceling transactions

```mermaid
sequenceDiagram
    OrderCancelled->>+App: Send webhook payload
    App-->>-AppMetadata: Fetch app configuration & transaction id from metadata
    AppMetadata-->>+App: Return configuration & transaction id
    App-->>+TaxProvider: Use configuration & webhook payload to cancel/void transaction
    TaxProvider-->>-App: Return
```
