You can add taxes on the cart, cart fees, cart fulfillment, items, item fees, item fulfillment, and fulfillment fees through a single request. To ensure that fees are subject to tax, the fees should be marked as taxable.
You can apply taxes at multiple levels, including individual items, fulfillment, or fees. The tax resource maintains a consistent structure across all levels.
The following code sample provides an example of tax object structure in request payload:
For accurate tax calculation, address information is required. While items, fulfillment, and their fees already have associated addresses from the fulfillment information, the cart fee requires a separate field for the address to be provided.
The following code sample provides an example tax object structure in a request payload with the destinationAddress and originAddress:
Applying sales taxes on items, fulfillments and the service charge
Use the replace tax data endpoint to create sales taxes on items and fulfillments, and service charge which are also taxable as in the following example: