Invoice Mode allows you to group multiple line items into a single invoice. The AFC Tax Engine applies any caps, thresholds, tax brackets, and tiers per invoice as a whole when in Invoice Mode (invm set to true). When Invoice Mode is turned off (invm set to false), the line items (itms) in the invoice (inv) are considered unrelated and independent, meaning caps, thresholds, tax brackets, and tiers are applied individually to each line item (itms).
Communications 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.
Total Charge (tchg) displays the summarized charge amounts applied to the tax item from Invoice processing (invm set to true). Each entry in the summarized tax results (sum) has an individual total charge as it applies to the calculation of that specific summarized tax type and jurisdiction.
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.