# Fee

To try a test and directly interact with the API endpoint click "Test It" and use an embedded API client to send requests with custom headers and variables, then see the live response; essentially letting you test this API directly within this page. When testing please use our Demo URL: `https://demo-payments.frontstream.com/api/fee`

## Calculates Fees based on Amount and Transaction Source Grouping

> 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.

```json
{"openapi":"3.0.1","info":{"title":"The Payment API","version":"v1"},"paths":{"/api/fee":{"get":{"tags":["Fees"],"summary":"Calculates Fees based on Amount and Transaction Source Grouping","description":"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.","parameters":[{"name":"ProcessorGuid","in":"query","description":"optional - Identifies Processor being used by an API Partner","schema":{"type":"string"}},{"name":"CharityId","in":"query","description":"optional - Valid CharityId from Charity Search","schema":{"type":"string"}},{"name":"OrganizationGuid","in":"query","description":"internal use - Valid Panorama Organization Guid","schema":{"type":"string"}},{"name":"IntegrationSourceGuid","in":"query","description":"internal use - Identifies integrated Product","schema":{"type":"string"}},{"name":"TokenGuid","in":"query","description":"Payment API Token GUID. Card Type of Token will be used in Fee Calculation. If using TokenGuid then do not set CreditCardTypeId parameter","schema":{"type":"string"}},{"name":"Amount","in":"query","description":"required - transaction amount","required":true,"schema":{"maxLength":7,"type":"string"}},{"name":"TransactionSourceGroupId","in":"query","description":"required - API Partners should set to 10 if API Partner fees configured - possible values -\r\n        1 - Donation Fee,\r\n        2 - Peer-to-Peer Fee,\r\n        3 - Auction Performance Fee,\r\n        4 - Ticket Fee,\r\n        5 - Registration Fee,\r\n        6 - Quick Sales Fee,\r\n        7 - Online Store Fee,\r\n        8 - Campaign Fee,\r\n        9 - 0% Auction Performance Fee,\r\n        10 - ApiPartnerFee,\r\n        11 - ExpressPayrollFee;\r\n        12 - PaymentNoFee;","required":true,"schema":{"type":"string"}},{"name":"PayFee","in":"query","description":"required - cover the fees flag for the transaction. Indicates if the donor intends to cover the processing fees for the donation","required":true,"schema":{"type":"boolean"}},{"name":"CommissionRateOverride","in":"query","description":"optional - The percentage value that you want to set for your commission on the transaction. Minimum value that will be used is the FrontStream Commission Rate as set in your contract, maximum value is the maximum commission rate set in your contract. Passing values outside of the min/max range will not result in a validation error, but will instead default to the min/max value (i.e. if your maximum commission rate in your contract is 10%, and you pass \"15.0\" for this value, the Payment API will simply use 10%). Not including this field or passing null also defaults to using the maximum commission rate from your contract.","schema":{"type":"number","format":"double"}},{"name":"CardProcessingFeeOverride","in":"query","description":"optional - Overrides the default percentage processing fee","schema":{"type":"number","format":"double"}},{"name":"Tip","in":"query","description":"optional - An amount taken up front for the API Partner if Donor decides to apply a tip. Added to the total amount to charge on the donor’s card . Card fee calculations are performed using this value; all commission and credit card fees still apply as normal.","schema":{"maxLength":7,"type":"string"}},{"name":"Tax","in":"query","description":"optional - A tax amount taken up front. Added to the total amount to charge on the donor’s card. Card fee calculations are performed using this value; all commission and credit card fees still apply as normal.","schema":{"maxLength":7,"type":"string"}},{"name":"CreditCardTypeId","in":"query","description":"Used for API Partner's per card type fee calculation based on contract, For example - $0.30 per transaction for Visa, MasterCard and Discover cards and $0.50 per transaction for American Express.\r\npossible values -\r\n        1 - AMEX,\r\n        2 - MC,\r\n        3 - VISA,\r\n        4 - DISCOVER,\r\n        5 - DINERSCLUB,\r\n        7 - MAESTRO;","schema":{"type":"string"}},{"name":"AccessToken","in":"header","description":"access token","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Returns the calculated fees","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeeResponse"}}}},"400":{"description":"If fees calculation throws exception","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/BrokenRule"}}}}},"404":{"description":"If the fees are not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}},"components":{"schemas":{"FeeResponse":{"type":"object","properties":{"TransactionSourceGroupId":{"type":"string","nullable":true},"PaymentAmount":{"type":"number","description":"This is the amount charged to the donor. Will be equal to the sum of the Amount parameters if payFee=false, but if payFee=true, then this will be the amount that will be charged to the donor in order to have the net post-disbursement donation be equal to the Amount parameters.","format":"double","nullable":true},"CardFeeRate":{"type":"number","description":"example 2.5% - applied to EVERY donation. This is the FrontStream card processing fee. The percentage of the PaymentAmount that will be taken for credit card fees. Expressed as a human-readable percentage rather than a decimal value, it is intended to be able to be displayed directly on a page without needing to be converted.","format":"double","nullable":true},"CardFeeAmount":{"type":"number","description":"This is the amount that is owed to the gateway for the example 2.5% that FrontStream collects from the transaction.\r\n 2.5% of transaction amount if donor is not paying the fee, otherwise 2.5% of the transaction + card fee.","format":"double","nullable":true},"CardTypeFeeAmount":{"type":"number","description":"A per transaction fee configured by card type (VI, MC, DI, AMEX, etc.) per API Partner's Contract other wise 0 (zero)","format":"double","nullable":true},"TotalCommissionRate":{"type":"number","description":"The Total percentage of Commissions that FrontStream takes from a given transaction.\r\nThis rate = Partner CommissionRate + FS CommissionRate","format":"double","nullable":true},"TotalCommissionAmount":{"type":"number","description":"The product of the transaction times the Total commission rate.","format":"double","nullable":true},"PartnerCommissionRate":{"type":"number","description":"The Partner Commission percentage taken on behalf of the Partner from a given transaction.","format":"double","nullable":true},"PartnerCommissionAmount":{"type":"number","description":"The product of the transaction times the Partner commission rate.","format":"double","nullable":true},"FsCommissionRate":{"type":"number","description":"The FrontStream Commission percentage that FrontStream takes from a given transaction.","format":"double","nullable":true},"FsCommissionAmount":{"type":"number","description":"The product of the transaction times the FrontStream commission rate.","format":"double","nullable":true},"TotalFees":{"type":"number","description":"The sum of all fees applied to a transaction amount. (TotalCommission + CardFee + FlatFee + CardFeeOnFee)","format":"double","nullable":true},"MaxOverridePartnerCommissionRate":{"type":"number","description":"The derived minimum partner override rate and maximum partner override rate\r\n\r\nMaxOverridePartnerCommissionRate = TotalFees = (PartnerCommission rate) + (Card Fee Rate) + (Fs Commission Rate)\r\nMinOverridePartnerCommissionRate = (Card Fee rate) + (Fs Commission rate)","format":"double"},"MinOverridePartnerCommissionRate":{"type":"number","format":"double"},"PerTransFee":{"type":"number","description":"The flat amount that will be taken from the PaymentAmount for any Per-Transaction Fees as configured in your contract.","format":"double","nullable":true},"Tip":{"type":"number","description":"The flat amount that will be paid out to the API Partner if Donor decides to add a tip regardless of payFee true or false.","format":"double"},"CardFeeOnFeeAmount":{"type":"number","format":"double","nullable":true},"Tax":{"type":"number","format":"double","nullable":true}},"additionalProperties":false,"description":""},"BrokenRule":{"type":"object","properties":{"ErrorCode":{"type":"integer","format":"int32"},"Message":{"type":"string","nullable":true},"LoggerMessage":{"type":"string","nullable":true}},"additionalProperties":false},"ProblemDetails":{"type":"object","properties":{"type":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"status":{"type":"integer","format":"int32","nullable":true},"detail":{"type":"string","nullable":true},"instance":{"type":"string","nullable":true}},"additionalProperties":{}}}}}
```

## Calculates Fees based on an array of Transaction Line items - Amount and Transaction Source Groupings

> 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.

```json
{"openapi":"3.0.1","info":{"title":"The Payment API","version":"v1"},"paths":{"/api/fees":{"post":{"tags":["Fees"],"summary":"Calculates Fees based on an array of Transaction Line items - Amount and Transaction Source Groupings","description":"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.","parameters":[{"name":"AccessToken","in":"header","description":"access token","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json-patch+json":{"schema":{"$ref":"#/components/schemas/FeeListRequest"}},"application/json":{"schema":{"$ref":"#/components/schemas/FeeListRequest"}},"text/json":{"schema":{"$ref":"#/components/schemas/FeeListRequest"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/FeeListRequest"}}}},"responses":{"200":{"description":"Returns the calculated fees","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeeListResponse"}}}},"400":{"description":"If fees calculation throws exception","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/BrokenRule"}}}}},"404":{"description":"If the fees are not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}},"components":{"schemas":{"FeeListRequest":{"required":["Transactions"],"type":"object","properties":{"ProcessorGuid":{"type":"string","description":"optional - Identifies Processor being used by an API Partner","nullable":true},"CharityId":{"type":"string","description":"optional - Valid CharityId Guid from Charity Search","nullable":true},"OrganizationGuid":{"type":"string","description":"internal use - Valid Panorama Organization Guid","nullable":true},"IntegrationSourceGuid":{"type":"string","description":"internal use - Identifies integrated Product","nullable":true},"TokenGuid":{"type":"string","description":"Payment API Token GUID. Card Type of Token will be used in Fee Calculation. If using TokenGuid then do not set CreditCardTypeId parameter","nullable":true},"Transactions":{"type":"array","items":{"$ref":"#/components/schemas/PaymentTransTypeRequest"},"description":"required - 1 to n transactions to break down transaction line items"}},"additionalProperties":false},"PaymentTransTypeRequest":{"required":["Amount","TransactionSourceGroupId"],"type":"object","properties":{"TransactionSourceGroupId":{"type":"string","description":"required - For Direct Merchant (For Profit) Api Partners should set to PaymentNoFee (12), other values are for Non Profit transactions - possible values -\r\n        1 - Donation Fee,\r\n        2 - Peer-to-Peer Fee,\r\n        3 - Auction Performance Fee,\r\n        4 - Ticket Fee,\r\n        5 - Registration Fee,\r\n        6 - Quick Sales Fee,\r\n        7 - Online Store Fee,\r\n        8 - Campaign Fee,\r\n        9 - 0% Auction Performance Fee,\r\n        10 - ApiPartnerFee,\r\n        11 - ExpressPayrollFee;\r\n        12 - PaymentNoFee;\r\n        13 - EventDonationFee;\r\n        14 - SponsorshipFee\r\n        15 - MembershipFee"},"Amount":{"maxLength":7,"type":"string","description":"required - Amount of line item without the fees included, Payment api will calculate fees for you"},"PayFee":{"type":"boolean","description":"optional - cover the fees flag for the transaction. Indicates if the donor intends to cover the processing fees for the donation (primary used for Non Profit transactions like a donation)"},"CommissionRateOverride":{"maxLength":7,"type":"string","description":"optional (max: 7) - The percentage value that you want to set for your commission on the transaction. Minimum value that will be used is the FrontStream Commission Rate as set in your contract, maximum value is the maximum commission rate set in your contract. Passing values outside of the min/max range will not result in a validation error, but will instead default to the min/max value (i.e. if your maximum commission rate in your contract is 10%, and you pass \"15.0\" for this value, the Payment API will simply use 10%). Not including this field or passing null also defaults to using the maximum commission rate from your contract.","nullable":true},"CardProcessingFeeOverride":{"maxLength":7,"type":"string","description":"optional (max: 7) - Overrides the default percentage processing fee","nullable":true},"ExternalLineId":{"maxLength":100,"type":"string","description":"optional (max: 100) - use this to track individual line item IDs if necessary.","nullable":true},"Tip":{"maxLength":7,"type":"string","description":"optional (max: 7) - An amount taken up front for the API Partner if Donor decides to apply a tip. Added to the total amount to charge on the donor’s card . Card fee calculations are performed using this value; all commission and credit card fees still apply as normal.","nullable":true},"Tax":{"maxLength":7,"type":"string","description":"optional (max: 7) - A tax amount taken up front. Added to the total amount to charge on the donor’s card. Card fee calculations are performed using this value; all commission and credit card fees still apply as normal.","nullable":true}},"additionalProperties":false,"description":""},"FeeListResponse":{"type":"object","properties":{"TotalPaymentAmount":{"type":"number","description":"The total payment amount processed toward the cardholder's account.","format":"double"},"TotalFeesAmount":{"type":"number","description":"The calculated total fees amount of the list of transactions.","format":"double"},"TotalTaxAmount":{"type":"number","description":"The calculated total tax amount of the list of transactions.","format":"double"},"TransactionFees":{"type":"array","items":{"$ref":"#/components/schemas/FeeResponse"},"description":"List of Transaction Fee Responses","nullable":true}},"additionalProperties":false},"FeeResponse":{"type":"object","properties":{"TransactionSourceGroupId":{"type":"string","nullable":true},"PaymentAmount":{"type":"number","description":"This is the amount charged to the donor. Will be equal to the sum of the Amount parameters if payFee=false, but if payFee=true, then this will be the amount that will be charged to the donor in order to have the net post-disbursement donation be equal to the Amount parameters.","format":"double","nullable":true},"CardFeeRate":{"type":"number","description":"example 2.5% - applied to EVERY donation. This is the FrontStream card processing fee. The percentage of the PaymentAmount that will be taken for credit card fees. Expressed as a human-readable percentage rather than a decimal value, it is intended to be able to be displayed directly on a page without needing to be converted.","format":"double","nullable":true},"CardFeeAmount":{"type":"number","description":"This is the amount that is owed to the gateway for the example 2.5% that FrontStream collects from the transaction.\r\n 2.5% of transaction amount if donor is not paying the fee, otherwise 2.5% of the transaction + card fee.","format":"double","nullable":true},"CardTypeFeeAmount":{"type":"number","description":"A per transaction fee configured by card type (VI, MC, DI, AMEX, etc.) per API Partner's Contract other wise 0 (zero)","format":"double","nullable":true},"TotalCommissionRate":{"type":"number","description":"The Total percentage of Commissions that FrontStream takes from a given transaction.\r\nThis rate = Partner CommissionRate + FS CommissionRate","format":"double","nullable":true},"TotalCommissionAmount":{"type":"number","description":"The product of the transaction times the Total commission rate.","format":"double","nullable":true},"PartnerCommissionRate":{"type":"number","description":"The Partner Commission percentage taken on behalf of the Partner from a given transaction.","format":"double","nullable":true},"PartnerCommissionAmount":{"type":"number","description":"The product of the transaction times the Partner commission rate.","format":"double","nullable":true},"FsCommissionRate":{"type":"number","description":"The FrontStream Commission percentage that FrontStream takes from a given transaction.","format":"double","nullable":true},"FsCommissionAmount":{"type":"number","description":"The product of the transaction times the FrontStream commission rate.","format":"double","nullable":true},"TotalFees":{"type":"number","description":"The sum of all fees applied to a transaction amount. (TotalCommission + CardFee + FlatFee + CardFeeOnFee)","format":"double","nullable":true},"MaxOverridePartnerCommissionRate":{"type":"number","description":"The derived minimum partner override rate and maximum partner override rate\r\n\r\nMaxOverridePartnerCommissionRate = TotalFees = (PartnerCommission rate) + (Card Fee Rate) + (Fs Commission Rate)\r\nMinOverridePartnerCommissionRate = (Card Fee rate) + (Fs Commission rate)","format":"double"},"MinOverridePartnerCommissionRate":{"type":"number","format":"double"},"PerTransFee":{"type":"number","description":"The flat amount that will be taken from the PaymentAmount for any Per-Transaction Fees as configured in your contract.","format":"double","nullable":true},"Tip":{"type":"number","description":"The flat amount that will be paid out to the API Partner if Donor decides to add a tip regardless of payFee true or false.","format":"double"},"CardFeeOnFeeAmount":{"type":"number","format":"double","nullable":true},"Tax":{"type":"number","format":"double","nullable":true}},"additionalProperties":false,"description":""},"BrokenRule":{"type":"object","properties":{"ErrorCode":{"type":"integer","format":"int32"},"Message":{"type":"string","nullable":true},"LoggerMessage":{"type":"string","nullable":true}},"additionalProperties":false},"ProblemDetails":{"type":"object","properties":{"type":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"status":{"type":"integer","format":"int32","nullable":true},"detail":{"type":"string","nullable":true},"instance":{"type":"string","nullable":true}},"additionalProperties":{}}}}}
```
