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.

Prerequisites

The following prerequisites must be completed sequentially to configure a fee.

  1. Create a cart.
  2. Create a fulfillment to apply the fulfillment fee.
  3. Create an item to add the item fee.

Fee Initialization

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:

The resource is displayed as a collection of fees for the associated resource as multiple fees can be applied to a single resource.

The following code sample provides the structure of a fee object in a collection:

Examples

Adding shipping fees, including shipping fee tax

The following steps outline how a fulfillment fee is configured:

  1. Create fulfillment fee.

  2. Add tax for the fulfillment fee using the replace tax date endpoint.

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:

Adding a platform fee at the cart level

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: