# Learn how to cover Fees

**Payment API - Fee - API specification** calculates fees based on the transaction amount and source grouping, with various optional parameters affecting the fee calculation. Used in our Non-Profit space to help cover any fees on Donations giving the option for all of a donation to go to a Charity.

**Key Details:**

* **API Version:** v1
* **Endpoint:** [`/api/fee`](/welcome-to-our-payment-api/api-references/test-payment-api-features/fee.md#get-api-fee)
* **Method:** GET
* **Tags:** Fees
* **Summary:** Calculates fees based on amount and transaction source.
* **Required Parameters:**
  * **Amount:** Transaction amount (required).
  * **TransactionSourceGroupId:** Transaction type (10 = api partner fee).
  * **PayFee:** A flag indicating whether the transaction fee is covered.
* **Optional Parameters:**
  * **ProcessorGuid, CharityId, OrganizationGuid, IntegrationSourceGuid, TokenGuid**: Used to specify the processor, charity, and integration details.
  * **CommissionRateOverride:** Allows setting a custom commission rate (within contract limits).
  * **CardProcessingFeeOverride:** Overrides default card processing fees.
  * **Tip:** Donor's tip amount (if applicable).
  * **CreditCardTypeId:** Used for card-specific fee calculation. (possible values - 1 - AMEX, 2 - MC, 3 - VISA, 4 - DISCOVER, 5 - DINERSCLUB, 7 - MAESTRO

**Responses:**

* **200 (Success)**: Returns the calculated fees in JSON format.
* **400 (Bad Request):** If there's an exception in fee calculation.
* **404 (Not Found):** If the fees cannot be found.

**Components:**

* **FeeResponse:** Describes the calculated fee details (e.g., commission rates, card fees, total fees, and overrides).
* **BrokenRule:** Represents an error in fee calculation with an error code and message.
* **ProblemDetails:** Details for any error response, including status, title, and description.

The API enables fee calculations with flexibility to account for various factors such as commission overrides, card type fees, and tips.

### Calculate Fees

See how to cover and calculate your fees here:

{% content-ref url="/pages/GeKo3WqMep3ReP22cv4M" %}
[Fee](/welcome-to-our-payment-api/api-references/test-payment-api-features/fee.md)
{% endcontent-ref %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developers.frontstream.com/welcome-to-our-payment-api/api-references/learn-how-to-cover-fees.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
