Invoice Mode allows you to group multiple line items into a single invoice. The AFC Tax Engine applies any tax brackets or limits per invoice rather than per line item when in Invoice Mode.
REST v2 provides the ability to process up to 10,000 LineItems within an invoice in Invoice Mode. Tax calculation results are summarized by jurisdiction and tax type. Optionally, the individual taxes for each line item can also be returned in the output using the Return Detail flag (dtl), but be advised that the response size may be up to a couple megabytes and may take additional time to process depending on the number of transactions in the Invoice.
While the maximum number of LineItems is 10,000, it is recommended to keep the number of LineItems around 1,000 per invoice for optimal performance.
It is recommended to increase the timeout of your web API calls to 10 minutes although response times are expected to be much shorter even or the largest batches.
Invoice Mode Example
In this example, the three line items are processed together as one invoice because Invoice Mode (invm) is set to true. Also note that the tax calculation output is returned at both the line item detail level (dtl = true) and summary level (sum = true).
Detailed taxes (txs) per line and summarized taxes (summ) for the entire invoice are returned.
This example demonstrates the output results for the same multi-line CalcTaxes request, but InvoiceMode (invm) set to false. Note that the three LineItems are processed and results are returned individually. No Summary-level tax results are provided in the CalcTaxes Response even though the Return Summary flag (summ) in the request is set to true. See Displaying Tax Results for more information.
Detailed taxes (txs) for each line item are returned. However, no summarized taxes (summ) are returned since the line items are treated as individual requests not part of a larger invoice.