How to build a tax app
This section gives instructions on building a tax app to calculate external taxes for Litium.
Note: This guide uses incomplete sample code to get you started. Each section in the guide introduces code fragments, and it is recommended that you read each section in the order presented.
Important! - code is only for demonstrating concepts, it is not complete and does not handle all scenarios.
Getting started
To get started, you should follow the general instructions in the app development guide on building an app for Litium. After following the above general guidelines, you should have an app that can be registered with Litium.
Then proceed as below to add functionality specific to tax calculations.
Tax calculation requests
As described in the Litium Connect Tax API business processes docmentation, the tax app need to implement two web API endpoints:
HTTP POST: <appurl>/api/tax/calculateSalesOrder
HTTP POST: <appurl>/api/tax/calculateShipment
For the objects that would be received and responses that should be made, class diagrams are available in the Connect Tax API documentation.
Follow the sections below to implement the above web API endpoints.
This section presents guidelines on implementing the endpoint to calculate sales order tax, and explains how you would start on converting data from Litium to call a third-party tax web API.
This section explain how to get the tax code for a product.
The CustomerInfo object has the CustomerSubType which shows whether the customer is a company, a non-profit or a government body in case the CustomerType is an organization. CustomerSubType property is a string, that can be set to a value to communicate with the tax app of the expected customer subtype. This section shows how to populate it.
This section describes how to pass tax exemption details to the tax app from Litium.
Orders may contain discounts, such as shipping fee discounts, fee discounts, product discounts and order level discounts. This section explains how to handle them when constructing data that need to be sent to external tax calculation service.
Calculated tax obtained from the tax calculation provider need to be provided in the response object to Litium. This section explains how.