Configuring Taxes
This feature in Carts API allows users to levy taxes on resources such as items, fulfillment, and fees. Fees are optionally taxable.
Prerequisites
The following prerequisites must be completed sequentially to configure a fulfillment.
- Create a cart.
- Create a fulfillment to add fulfillment taxes.
- Create an item to add item taxes.
- Create either item, fulfillment, or cart fees to add fee taxes.
Tax Initialization
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:
Tax resource
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
:
Tax fee resource with addresses
Examples
Applying sales taxes on items and fulfillments
Use the replace tax data endpoint to create sales taxes on items and fulfillments as in the following example:
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:
Was this page helpful?