You can communicate with a Tax Engine of your choice with the help of a Tax Callback class. For this, you should know the Request Fields that are sent to Callback and further to the Tax Engine. The following diagram gives an overview of how information is sent from the Product to the Tax Engine and received back after processing.
Tax input is a container that holds the following fields:
Item: Contains an Invoice Line Item or a Credit Memo Line Item.
Handback: A generic wrapper class that can be used to pass an additional field value. Set the value for this field to TaxInputRelatedObjects. This class contains the parent Invoice or Credit Memo based on whether the item contains an Invoice Line Item or a Credit Memo Line Item.
Tax Address: The address specified as the Shipping Address of the Ship-To account. If there is no Shipping Address mentioned in the Ship-To account, then the Billing Address of the Ship-To account is used.
- Tax Code: This value is taken from the product Price Line Item (PLI).
Taxable Amount: This is the amount to apply the tax to.
When communicating with a Tax Engine, you must note that:
The implementation of the Tax Callback must return a TaxResultHandback object in the Handback field of a Tax Result.
The implementation of the Tax Callback must determine a commit mode by checking if the status of the Invoice is Approved Pending.
You must register a Tax Callback class which is called for tax calculation on invoice generation.