# Transaction lifecycle

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

# Transaction lifecycle

**Element type:** Required

**Endpoints/models used:** [CreateTransactionModel](https://developer.avalara.com/api-reference/avatax/rest/v2/models/CreateTransactionModel/)

Your integration and relevant document types must mirror your ERP system workflow for a transaction lifecycle when creating purchase orders and purchase invoices. For example, in a workflow, before payment has been processed and before the document is committed, the transaction quote should call the `purchaseOrder` doc type. After the order is turned into an invoice, then change the document type to `purchaseInvoice`.