The fees feature in Carts API allows you to add, update, or remove additional fees beyond the resource price, such as gifting fees, platform fees, and service fees. These fees can be applied at various levels, including the cart, individual items, or fulfillment, providing flexibility in customizing the total cost structure. Optionally, the fees may be taxable.
You can apply fees at multiple levels, including the cart, individual items, or fulfillment. The fee resource maintains a consistent structure across all levels. Taxes on fees is controlled by the taxable attribute in the request payload, which defaults to true. This means fees are taxed unless specifically set to false.
The following code sample provides the structure of a fee object:
Applying a gifting fee to items that are gift-wrapped
Use the create item fees endpoint to apply the gifting fees to the items that are gift wrapped.
The following curl example provides how the request is structured when creating an item fee:
Use the create cart fees endpoint to add a platform fee at the cart level.
The following curl example provides how the request is structured when creating fee at the cart level: