After the user has added products to the cart, you can apply taxes to each of the cart line items and shipping charges for the entire order.

  • Tax and shipping can be calculated for the Quotes (Estimated tax / Shipping amount), but will be more generally used with E-Commerce orders with Pay Now scenario as the actual tax and shipping amount.

After the user has added the products to the cart, the sequence of actions is as follows:

  • Customer specifies the Ship-to location.
  • Once the ship to account or location is specified at the header (line item level in case of multiple ship-to locations)level, invoke the APIs to calculate Shipping as well as tax.
  • Once the shipping and tax charges are calculated, the total price, shipping, and tax amount is displayed for a customer to review.
  • Customer will then specify Payment option and Place the order.


Tax Calculation Workflow:

  • Create Tax callback class.
  • Implement tax interface ITaxCallback2 in the callback class to call the tax engine to calculate the total tax for the cart (Quote / Order) and breakup for each line item. 

  • Invoke computeTaxforCart API to which we just pass the “CartId”. The API will create the tax breakup line items as well as the total tax line for the entire cart.


Shipping Callback Workflow:

  • Create Shipping callback class.

  • Implement shipping interface IShippingCallback in the callback class to call the shipping engine to calculate the total shipping charges for the cart (Quote / Order).

  • Invoke computeShippingForCart to which we just pass the “CartId”. The API will create the shipping charges for the entire cart.