# Offer optional fees at checkout

> Add fees shoppers can choose at checkout, such as shipping protection or priority processing, and refund them.

Source: https://www.coritan.com/docs/organizations/commerce/fees/

In the dashboard:

- /dashboard/organizations/…/commerce/fees: https://www.coritan.com/dashboard/organizations

**Fees** holds the optional charges your store offers at checkout, such as shipping protection or priority processing. The shopper sees each fee the cart is offered with a checkbox, and pays for the ones they keep ticked. A fee is your sale, like the goods.

## Before you begin

- Only owners and admins see **Fees**.
- A fixed fee has an amount in each of the store's currencies you want to offer it in. Choose the currencies under **Store** in [Settings](/docs/organizations/commerce/settings/#store).
- Your storefront shows the fees. A storefront built on the Store API reads them from the cart, as [Offer store fees](/docs/organizations/storefront/store-api/#offer-store-fees) shows.

## Create a fee

1. In the [dashboard](https://www.coritan.com/dashboard/organizations), open the organization, then **Commerce**, then **Fees**.
2. Select **New fee…**.
3. Enter the **Name** shoppers see, such as `Shipping protection`.
4. Enter the **Code**, such as `shipping_protection`. It takes lowercase letters, digits and `_`, up to 40 characters, and your storefront uses it to turn the fee on and off.
5. Optionally, enter a **Description**, a sentence the storefront can show beside the fee.
6. Choose the **Amount**:
   - **Fixed amount**: enter the amount in each currency, such as `4.99`. A cart in a currency with no amount is not offered the fee.
   - **Percentage**: enter the **Percentage** of what the cart's items come to after discounts, above 0 and up to 100.
7. Choose the **Tax category**. The fee is taxed at the shopper's address like a product in that category. **Standard** suits most fees.
8. Optionally, enter a **Position**. Lower numbers are listed first at checkout.
9. Tick **On by default** to add the fee to every cart it is offered to, so the shopper unticks it to leave it out. Leave it unticked for a fee the shopper opts in to.
10. Tick **Only when something ships** for a fee about delivery, such as shipping protection. A cart of gift cards or other goods that do not ship is then not offered it.
11. Leave **Turn it on now** ticked, or untick it to save the fee turned off.
12. Select **Create fee**.

## How fees work at checkout

- A cart is offered every fee that is turned on and has an amount in the cart's currency, once it holds an item.
- A fee is never discounted. It does not count toward a promotion's minimum spend or toward free shipping.
- Gift cards can pay for fees.
- When the shopper ticks or unticks a fee, the choice sticks, even for a fee that is on by default.
- The order keeps a copy of each fee the shopper paid, with its tax. Changing or deleting the fee later does not change orders already placed.

On the order, each fee is listed under the shipping in **Items**, and the invoice has a line for each fee. Your balance counts fees as sales, and the platform fee applies to them as it does to the goods.

## Refund a fee

1. Open the order, then select **Refund…**.
2. Under **By item**, tick each fee to refund. When you refund every item and the shipping, the fees are ticked too, and you can untick any you keep.
3. Select the refund button, type the amount to confirm, and select it again.

A refund of an amount spreads over what is left on the items, the shipping and the fees. Cancelling an order refunds its fees. A return never refunds a fee, so refund one from the order when you want to.

## Change, turn off or delete a fee

Filter the list with **All**, **Active** and **Turned off**. Each action is in the menu on the fee's row.

**Edit fee…**
: Change anything, then select **Save fee**. Carts use the change from then on.

**Turn off…**
: Select **Turn off fee** to confirm. Carts stop being offered the fee, and orders that paid it keep it. **Turn on** offers it again.

**Delete fee…**
: Type its code, then select **Delete fee**. Carts stop being offered it, the choices shoppers made about it are forgotten, and its code becomes free for a new fee. Orders that paid it keep their copy.

> [!CAUTION]
> Deleting a fee cannot be undone. Turn it off instead to keep it for later.

## Result

- A fee that is turned on is offered to carts from then on, and the orders that pay it list it with their totals.
- A refunded fee shows what was refunded on the order and on the credit note.

## Troubleshooting

**Fees** is missing
: Only owners and admins see it.

The dialog says another fee has this code
: Codes are unique in the store. Choose another code, or delete the other fee.

A shopper is not offered a fee
: Check that the fee is turned on, has an amount in the cart's currency, and, with **Only when something ships**, that the cart holds something that ships.

## Related

- [Handle your store's orders](/docs/organizations/commerce/orders/)
- [Create promotions and issue gift cards](/docs/organizations/commerce/discounts/)
- [Build a checkout with the Store API](/docs/organizations/storefront/store-api/)

## With the API

Fees are under `https://api.coritan.com/api/v1/orgs/{org_slug}/commerce/fees`. A storefront lists a cart's fees, and turns them on and off, with the Store API.

```bash
curl -X POST "https://api.coritan.com/api/v1/orgs/acme/commerce/fees" \
  -H "Authorization: Bearer $CORITAN_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"code": "shipping_protection", "label": "Shipping protection", "amounts": {"EUR": 499}, "default_on": true, "requires_shipping": true}'
```

## API

- `GET /api/v1/orgs/{org_slug}/commerce/fees`: List fees (https://www.coritan.com/docs/api/reference/organizations/commerce/commerce/#op-get-api-v1-orgs-org-slug-commerce-fees)
- `POST /api/v1/orgs/{org_slug}/commerce/fees`: A fee, active unless status says otherwise (https://www.coritan.com/docs/api/reference/organizations/commerce/commerce/#op-post-api-v1-orgs-org-slug-commerce-fees)
- `GET /api/v1/orgs/{org_slug}/commerce/fees/{fee_id}`: Get fee (https://www.coritan.com/docs/api/reference/organizations/commerce/commerce/#op-get-api-v1-orgs-org-slug-commerce-fees-fee-id)
- `PATCH /api/v1/orgs/{org_slug}/commerce/fees/{fee_id}`: Change what the body names (https://www.coritan.com/docs/api/reference/organizations/commerce/commerce/#op-patch-api-v1-orgs-org-slug-commerce-fees-fee-id)
- `DELETE /api/v1/orgs/{org_slug}/commerce/fees/{fee_id}`: The fee and the choices carts made about it (https://www.coritan.com/docs/api/reference/organizations/commerce/commerce/#op-delete-api-v1-orgs-org-slug-commerce-fees-fee-id)
