# Typical AvaTax for Accounts Payable workflow

Source: https://developer.avalara.com/avatax-for-ap/gnl9432952962056/

# Typical AvaTax for Accounts Payable workflow

![](https://knowledge-be.avalara.com/bundle/qls6870097770673_qls6870097770673/page/vhl0352398913151.image?_LANG=enus)

1.  After a quote is entered onto your site, call the [CreateTransaction API](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Transactions/CreateTransaction/) with `type` set to `PurchaseOrder`. This will get you a tax calculation based on the shipping and destination addresses, but it won't record a permanent transaction. No cleanup is required for abandoned carts.

2.  Review the invoice entry, then call [CreateTransaction](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Transactions/CreateTransaction/) again with `type` set to `PurchaseInvoice`. Set the `taxOverride` `type` to `VendorChargedTax`, and set `commit` to `false`. This won't record a permanent transaction.

3.  In the response, review the use tax accrual (if any) and the AP status field. Based on your review, determine whether to accrue use tax in the ERP or accrue use tax in the Avalara Portal.

## Accrue use tax in the ERP

1.  Call [CreateTransaction](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Transactions/CreateTransaction/) again with `type` set to `PurchaseInvoice`. Set the `taxOverride` `type` to `VendorChargedTax`, and set `commit` to `true`

2.  In the response, review the document `status`, `totalTax` (for the accrual amount), `totalTaxCalculated` (for the Avalara-calculated tax), `VarianceCalculatedForDocument`, `apStatusCode`, and `apStatusCode`.

3.  Complete any additional GL entries/invoice tax amount adjustments as needed.

## Accrue use tax in the Avalara Portal

**Path 1:**

-   Download the transactions accrued in the Avalara Portal.

-   Review the document `status`, `totalTax` (for the accrual amount), `totalTaxCalculated` (for the Avalara-calculated tax), `VarianceCalculatedForDocument`, `apStatusCode`, and `apStatusCode`.

-   Review your policy for posting to the General Ledger, then post the transaction.

**Path2:**

-   Asynchronously fetch the document from Avalara.

-   Review the document `status`, `totalTax` (for the accrual amount), `totalTaxCalculated` (for the Avalara-calculated tax), `VarianceCalculatedForDocument`, `apStatusCode`, and `apStatusCode`.

-   Post adjustment for GL entries for use tax accrual in the ERP.

Be sure to review the next section, [AP statuses and recommended actions](/avatax-for-ap/lbj2195849100018/), for information on any actions to take as a result of a transaction.