# Fees

On this page:

* [Introduction](#introduction)
* [Fee APIs](#fee-apis)
* [Fee configuration for individual channel](#fee-configuration-for-individual-channel)
* [Advanced fees](#advanced-fees)

### Introduction

The fee generally refers to a stream of revenue generating from your customers. Which means that when the cardholder performs a transaction an associated fee with the card product will be charged.

At nCore platform you can link different fees on the card product based on transaction types (e.g. purchase, withdrawal, and etc.). The transaction will be authorized only if there are sufficient funds available in the account which means it is real time fee evaluation. Real time fee evaluation requires that the account has sufficient funds available to cover both the transaction amount and the fee to authorize the transaction.

What does it mean to have **sufficient funds**?

There are typically three types of amounts involved in an authorization, which are:

* ***Transaction amount (TA)**  is the amount requested in the authorization*
* ***Acquirer fee (AF)** is the fee that is charged by the acquirer (optional)*
* ***Issuer fee (IF)**  issuer fee is the fee that you configure and link to the card product (optional)*

*In order to authorize the transaction the account should have sufficient funds to cover the three amounts, otherwise the authorization will be declined. That is **funds in account ≥*** ***TA + AF + IF***.

Following are the fee types offered in nCore.

| **S No.** | **Fee Type**   | **Fee Description**                                                                   |
| --------- | -------------- | ------------------------------------------------------------------------------------- |
| 1         | Flat fee       | A fixed amount that the cardholder pays regardless of the transaction amount          |
| 2         | Percentage fee | A percentage applied on the transaction amount that the cardholder pays               |
| 3         | Range fee      | Transaction amount based fee slabs where each slab has a flat fee or a percentage fee |

### Fee APIs

#### Create a fee

You can create a fee as required by sending a **POST** request to **/fees** endpoint as given below.&#x20;

<details>

<summary><a href="https://nymcard.com/docs/api#tag/Fees/paths/~1v1~1fees/post">POST /fees</a></summary>

**`{`**\
`    `**`"description": "Withdrawal Fee",`**\
`    `**`"type": "FLAT",`**\
`    `**`"currency": “USD”,`**\
`    `**`"amount": 2.5,`**\
`    `**`"transaction_type": "WITHDRAWALS",`**\
`    `**`"transaction_origin": "DOMESTIC"`**\
\&#xNAN;**`}`**

</details>

#### Retrieve a fee

nCore offers two retrieval options for fees.

**Retrieve all fees**

You can retrieve all existing fees by sending a **GET** request to **/fees** endpoint as shown below.

> [**GET /fees**](https://nymcard.com/docs/api#tag/Fees/paths/~1v1~1fees/get)

**Retrieve a specific fee**

You can retrieve a specific fee by sending a **GET** request to **/fees/{fee\_id}** endpoint as shown below.

> [**GET /fees/{fee\_id}**](https://nymcard.com/docs/api#tag/Fees/paths/~1v1~1fees~1{fee_id}/get)

#### Update a fee

You can update a specific fee as required. Send a **PUT** request to **/fees/{fee\_id}** endpoint.

<details>

<summary><a href="https://nymcard.com/docs/api#tag/Fees/paths/~1v1~1fees~1{fee_id}/put">PUT <strong>/fees/{fee_id}</strong></a></summary>

**`{`**\
`    `**`"description": "Withdrawal Fee",`**\
`    `**`"active": true,`**\
`    `**`"type": "RANGE",`**\
`    `**`"currency": "USD",`**\
`    `**`"range": [`**\
`    `**`{`**\
`        `**`"greater_than": 0,`**\
`        `**`"less_than_equal_to": 1000,`**\
`        `**`"percentage": 3`**\
`    `**`},`**

&#x20;   **`{`**\
`        `**`"greater_than": 1000,`**\
`        `**`"less_than_equal_to": 2000,`**\
`        `**`"percentage": 2`**\
`    `**`}`**

&#x20;   **`]`**\
\&#xNAN;**`}`**

</details>

#### Link a fee with a card product

You can link a fee with a card product by sending a **POST** request to **/cardproducts/{id}/fees:link** endpoint as given below.&#x20;

> [**POST /cardproducts/{id}fees:link**](https://nymcard.com/docs/api#tag/Card-Products/paths/~1v1~1cardproducts~1{id}~1fees:link/post)

#### Unlink a fee from a card product

You can unlink a fee from a card product as per your requirement by sending a **POST** request to **/cardproducts/{id}/fees:unlink** endpoint. Noted that fee will not charge for a specific card product after unlinking it.

> [**POST /cardproducts/{id}/fees:unlink**](https://nymcard.com/docs/api#operation/unlinkFees)

#### Retrieve linked fees

You can retrieve all fees which are linked with your card product. Send a **GET** request to /**cardproducts/{id}/fees** endpoint as shown below.

> [**GET /cardproducts/{id}/fees**](https://nymcard.com/docs/api#operation/getFees)

### Fee configuration for individual channel

We introduce new ‘source\_channel’ parameter , which is added to the [Fees](https://nymcard.com/docs/api#tag/Fees) APIs. Possible values are ‘MPGS’, ‘DAPI’ or ‘ANY’ (default). It gives an opportunity to choose an appropriate channel, so that fee for every channel can be applied accordingly. This parameter is currently applicable for ‘transaction\_type’ = ‘TRANSFERS’ only.&#x20;

Also we implemented ability to post fee on recipient account instead of sender account, so you can charge the transfer funds fee to recipient instead of sender.

If there is a fee plan (with ‘source\_channel’ = ‘DAPI’, ‘MPGS’ or ‘ANY’) linked to the recipient card product and ‘source\_channel’ in the transfer request received is either ‘MPGS’ or ‘DAPI’, then fee is being deducted from the recipient account. Below you can find a table which describes different scenarios:

<figure><img src="https://3730541649-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftelq9krTgSM8OvsHep7r%2Fuploads%2FcZ4syv7baBE9HveE7sDS%2Ffee.png?alt=media&#x26;token=11b2a299-c5b7-43ea-ba5d-92044fd327fe" alt=""><figcaption></figcaption></figure>

### Advanced fees

We have added ability for system to allow fees configuration along with the dynamic conditions so that fees can be applied based on the configured conditions.

Below you can find **possible condition types**:

* "MCC"&#x20;
* "MERCHANT\_ID"&#x20;
* "ACQUIRER\_COUNTRY"&#x20;
* "KYC\_LEVEL"
* "TRANSFER\_TYPE"&#x20;
* "IS\_FORIEGN\_CURRENCY\_FEE"
* "SCHEME\_SCOPE" (has such enums as VISA, MASTERCARD, MERCURY, UNIONPAY)
* "PURCHASE\_TYPE" (has such enums as PURCHASE and ECOMMERCE)
* "API\_CHANNEL" (has such enums as API, MPGS, DAPI, LEAN)
* "TRANSACTION\_ORIGIN" (has such enums as DOMESTIC, FOREIGN and ANY)

Following new endpoints are implemented to maintain advanced fees:

* [Create advanced fees](https://nymcard.com/docs/api#tag/Advanced-Fees/paths/~1v1~1advancedfees/post) – `POST v1/advancedfees`
* [Update advanced fees](https://nymcard.com/docs/api#tag/Advanced-Fees/paths/~1v1~1advancedfees~1%7Bfee_id%7D/put) – `PUT v1/advancedfees/{id}`
* [Get all advanced fees](https://nymcard.com/docs/api#tag/Advanced-Fees/paths/~1v1~1advancedfees/get) – `GET v1/advancedfees`
* [Get specific advanced fee](https://nymcard.com/docs/api#tag/Advanced-Fees/paths/~1v1~1advancedfees~1%7Bfee_id%7D/get) – `GET v1/advancedfees/{id}`
* [Link advanced fee to card product](https://nymcard.com/docs/api#tag/Card-Products/operation/linkAdvancedFees)  - `POST v1/cardproducts/{id}/advancedfees:link`&#x20;
* [Unlink advanced fee from card product](https://nymcard.com/docs/api#tag/Card-Products/operation/unlinkAdvancedFees) - `POST v1/cardproducts/{id}/advancedfees:link`&#x20;
* [Get list of advanced fees related to the card product](https://nymcard.com/docs/api#tag/Card-Products/operation/getCardProductAdvancedFees) - `GET v1/cardproducts/{id}/advancedfees`&#x20;

Besides, we have added new parameter “`is_forex_fee`" in advanced fees. This parameter  works in combination with transaction type same as `PURCHASE_FOREIGN_CURRENCY` in fees.
