> ## Documentation Index
> Fetch the complete documentation index at: https://docs.khaime.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Fee Breakdown

> Estimate the transaction fee and customer total for an amount.

## Intro

Returns the transaction fee for an amount, who pays it under your business's settings, and what the customer's total would be. It needs only an amount and currency, so you can show a fee estimate early in checkout — before the customer has entered their details.

## Context

This is the early-checkout estimate. Once the cart and customer details are complete, use [Preview Payment](/api-reference/commerce/cart-payment-preview) for the exact final payment. See [Prices, Fees and Totals](/api-reference/pricing-and-checkout-guide) for how they fit together.

The fee policy comes from the business that owns the API key. For a marketplace operator, that's the operator's setting, which its sub-merchants inherit.

## Hows

### Query parameters

<ParamField query="amount" type="integer" required>
  Order amount in the smallest currency unit (e.g. `1500` for \$15.00).
</ParamField>

<ParamField query="currency" type="string" required>
  3-letter ISO code of `amount`, e.g. `USD`.
</ParamField>

<ParamField query="customer_country" type="string">
  2-letter ISO code of the customer's country. Affects whether the local or international rate applies.
</ParamField>

### Response

<Note>
  Unlike most endpoints, amounts in this response are in **major units** (e.g. `11.54`), not the smallest currency unit.
</Note>

```json theme={null}
{
  "status": "success",
  "data": {
    "business_settings": {
      "business_name": "Visit Nigeria",
      "customer_pays_transaction_fee": true,
      "payment_gateway": "stripe",
      "currency": "GBP"
    },
    "order_summary": { "subtotal": 11.54, "currency": "GBP" },
    "fee_breakdown": {
      "transaction_fee": { "amount": 0.89, "gateway": "stripe", "paid_by": "customer" },
      "total_additional_fees": 0.89
    },
    "customer_totals": {
      "pays_subtotal": 11.54,
      "pays_additional_fees": 0.89,
      "pays_total": 12.43
    }
  }
}
```

| Field                                             | Show as                           |
| ------------------------------------------------- | --------------------------------- |
| `business_settings.customer_pays_transaction_fee` | Whether to show a fee line at all |
| `customer_totals.pays_additional_fees`            | "Transaction fee"                 |
| `customer_totals.pays_total`                      | Estimated total                   |

<RequestExample>
  ```bash cURL theme={null}
  curl "https://api.khaime.com/api/v1/fees/breakdown?amount=1154&currency=GBP&customer_country=GB" \
    -H "X-API-Key: pk_sandbox_your_key"
  ```
</RequestExample>

## Why nots

* **It's an estimate for an amount, not a cart.** It doesn't know about discounts, shipping, tax or conversion. Use [Preview Payment](/api-reference/commerce/cart-payment-preview) for the final figure.
* **It doesn't reserve a rate.** The charge is whatever the payment intent returns.
