# Fee

## The `Fees` Object

{% tabs %}
{% tab title="Attributes" %}

| Attributes                | Type                                                                    | Description                                                                                                                                                 |
| ------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `portalId`                | `string`                                                                | Id for a portal (Ex. Amazon, Flipkart) for which fees is created                                                                                            |
| `feeId`                   | `string`                                                                | Unique Id for fee created or Unique Id for already present fee                                                                                              |
| `feeName`                 | `string`                                                                | Name of the created fees                                                                                                                                    |
| `actualName`              | `string`                                                                | Receivable fee Name from portal                                                                                                                             |
| `isInclusiveTax`          | `string`                                                                | <p>Fees is tax inclusive or not</p><p>Refer <a href="/pages/-M0wJCsKvmqu9h_7dZAJ#enum-isinclusivetax"><code>Enum: 1, 0</code></a></p>                       |
| `inclusiveTaxPercentage`  | `string`                                                                | Percentage of tax applicable on a fee                                                                                                                       |
| `chargedFee`              | `string`                                                                | <p>Event at which fee is charged.</p><p>Refer <a href="/pages/-M1_VwY2maGw3-JlHDxn#enum-chargedfee"><code>Enum: cancelled, shipped, returned</code></a></p> |
| `chargedFeeCases`         | `string`                                                                | <p>Specific fee is charged when an item is returned. <br>It can be customer, courier or both. </p>                                                          |
| `courierReturnedFee`      | `string`                                                                | Whether fees is totally, partially or not courier returned                                                                                                  |
| `courierReturnedPercent`  | `string`                                                                | Percentage for partial courier returned fee                                                                                                                 |
| `customerReturnedFee`     | `string`                                                                | Whether fees is totally, partially or not customer returned                                                                                                 |
| `customerReturnedPercent` | `string`                                                                | Percentage for partial customer returned fee                                                                                                                |
| `validityPeriod`          | `string`                                                                | Validity period for fees                                                                                                                                    |
| `validFrom`               | `string`                                                                | Date from which fees will be activated                                                                                                                      |
| `validTo`                 | `string`                                                                | Date at which fees will be expired                                                                                                                          |
| `feeRuleStatus`           | `string`                                                                | <p>Action to be considered for fee rules</p><p>Refer <a href="/pages/-M1_VwY2maGw3-JlHDxn#enum-feerulestatus"><code>Enum: HIGHER, LOWER, SUM</code></a></p> |
| `fee`                     | [`array[String]`](/eshopbox-developers/payment/fees-1.md#fee-fee-event) | <p>Detail of when is the fee charged</p><p>Also see: <strong>The fee Object</strong></p>                                                                    |
| `feeRules`                | [`object`](/eshopbox-developers/payment/fees-1.md#feerules)             | <p>Details of fee rules</p><p>Also see: <strong>The feeRules Object</strong></p>                                                                            |

{% endtab %}

{% tab title="Sample Object" %}

```
{
    "portalId": 4,
    "feeId": "",
    "feeName": "testFeeSnapdeal",
    "actualName": "testFee",
    "isInclusiveTax": "1",
    "inclusiveTaxPercentage": "4",
    "chargedFee": "shipped",
    "chargedFeeCases": "",
    "courierReturnedFee": "Partial",
    "courierReturnedPercent": "20",
    "customerReturnedFee": "Partial",
    "customerReturnedPercent": "10",
    "validityPeriod": "definite",
    "validFrom": "2020-03-02",
    "validTo": "2020-03-17",
    "feeRulesStatus": "lower",
    "fee": [
        {
            "eventType": "shipped",
            "eventSubType": "",
            "feeCharged": "CHARGED_FEE"
        },
        {
            "eventType": "returned",
            "eventSubType": "courier",
            "feeCharged": "REVERSED_FEE",
            "partialPercentageValue": "20"
        },
        {
            "eventType": "returned",
            "eventSubType": "customer",
            "feeCharged": "REVERSED_FEE",
            "partialPercentageValue": "10"
        }
    ],
    "feeRules": [
        {
            "details": {
                "feeRulesStatus": "lower",
                "category": [
                    323,
                    324,
                    325
                ],
                "brand": [
                    148,
                    150,
                    194
                ],
                "paymentMethod": "COD",
                "shippingZone": "Local"
            },
            "feeRanges": [
                {
                    "rangeType": "product selling price",
                    "rangeTypeUnit": "INR",
                    "minRange": "20",
                    "maxRange": "40"
                },
                {
                    "rangeType": "weight range",
                    "rangeTypeUnit": "kg",
                    "minRange": "2",
                    "maxRange": "5"
                }
            ],
            "feeValues": [
                {
                    "type": "fixed",
                    "partitionRangeType": null,
                    "value": "700",
                    "applicableOn": "Per Order Item",
                    "partitionRange": null
                },
                {
                    "type": "variable",
                    "partitionRangeType": "kg",
                    "value": "10",
                    "applicableOn": "Per Order",
                    "partitionRange": "20"
                },
                {
                    "type": "percentage",
                    "partitionRangeType": null,
                    "value": "24",
                    "applicableOn": "Per Shipment",
                    "partitionRange": null
                }
            ]
        }
    ]
}
```

{% endtab %}
{% endtabs %}

### Enum: feeRuleStatus

| Attributes | Description                                                                         |
| ---------- | ----------------------------------------------------------------------------------- |
| `HIGHER`   | Out of all the THEN condition defined for fees, greatest amount will be considered. |
| `LOWER`    | Out of all the THEN condition defined for fees, lowest amount will be considered.   |
| `SUM`      | Sum of all the THEN condition defined for fees is considered.                       |

### fee (fee event)

| Attributes                     | Type     | Description                                |
| ------------------------------ | -------- | ------------------------------------------ |
| `fee[].eventType`              | `string` | Event for which the is fee charged         |
| `fee[].eventSubType`           | `string` | Event sub type for when is the fee charged |
| `fee[].feeCharged`             | `string` | Type of fee charged                        |
| `fee[].partialPercentageValue` | `string` | percentage value charged for the fees      |

### feeRules

| Attributes           | Type                                                                | Description                                                                                             |
| -------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
| `feeRules.details`   | [`object`](/eshopbox-developers/payment/fees-1.md#details)          | <p>Details of fee rules</p><p>Also see: <strong>The details Object</strong></p>                         |
| `feeRules.feeRanges` | [array`[object]`](/eshopbox-developers/payment/fees-1.md#feeranges) | <p>Details of fee rules containing ranges</p><p>Also see: <strong>The feeRanges Object</strong></p>     |
| `feeRules.feeValues` | [`array[object]`](/eshopbox-developers/payment/fees-1.md#feevalues) | <p>Details of action to be taken on fee rules</p><p>Also see: <strong>The feeValues Object</strong></p> |

### details

| Attributes                          | Type     | Description                                                                          |
| ----------------------------------- | -------- | ------------------------------------------------------------------------------------ |
| `feeRules[].details.feeRulesStatus` | `string` | <p>Action to be considered for rules</p><p><code>Enum: HIGHER, LOWER, SUM</code></p> |
| `feeRules[].details.category`       | `array`  | Array of categories in fee rule                                                      |
| `feeRules[].details.brand`          | `array`  | Array of brands in fee rule                                                          |
| `feeRules[].details.paymentMethod`  | `string` | Mode of Payment (COD, PREPAID)                                                       |
| `feeRules[].details.shippingZone`   | `string` | Zone where product is shipped                                                        |

### feeRanges

| Attributes                             | Type     | Description                           |
| -------------------------------------- | -------- | ------------------------------------- |
| `feeRules[].feeRanges[].rangeType`     | `string` | product selling price or weight range |
| `feeRules[].feeRanges[].rangeTypeUnit` | `string` | Unit for range type                   |
| `feeRules[].feeRanges[].minRange`      | `string` | Minimum value for range type          |
| `feeRules[].feeRanges[].maxRange`      | `string` | Maximum value for range type          |

### feeValues

| Attributes                                  | Type     | Description                                                                                                                                                                                                                                           |
| ------------------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `feeRules[].feeValues[].type`               | `string` | <p>Rule considered for fees<br>Refer <a href="/pages/-M1_VwY2maGw3-JlHDxn#enum-type"><code>Enum: FIXED, VARIABLE, PERCENTAGE</code></a></p>                                                                                                           |
| `feeRules[].feeValues[].partitionRangeType` | `string` | Unit in case of variable type                                                                                                                                                                                                                         |
| `feeRules[].feeValues[].value`              | `string` | Value for fee rule type                                                                                                                                                                                                                               |
| `feeRules[].feeValues[].applicableOn`       | `string` | <p>Fee rule applicable on conditions<br>Refer<a href="/pages/-M1_VwY2maGw3-JlHDxn#enum-applicableon"><code>Enum: PER ORDER, PER ORDER ITEM</code></a></p><p><a href="/pages/-M1_VwY2maGw3-JlHDxn#enum-applicableon"><code>PER SHIPMENT</code></a></p> |
| `feeRules[].feeValues[].partitionRange`     | `string` | Value for partition range type                                                                                                                                                                                                                        |

### Enum: type

| Attributes   | Description                                              |
| ------------ | -------------------------------------------------------- |
| `FIXED`      | Fixed value of fee is charged                            |
| `VARIABLE`   | Fee charged is varied according to conditions            |
| `PERCENTAGE` | Fee is charged in percent value for different conditions |

### Enum: applicableOn

| Attributes       | Description                              |
| ---------------- | ---------------------------------------- |
| `PER ORDER`      | Fee rule to be considered per order      |
| `PER ORDER ITEM` | Fee rule to be considered per order item |
| `PER SHIPMENT`   | Fee rule to be considered per shipment   |

### Enum: isInclusiveTax

| Attributes | Description              |
| ---------- | ------------------------ |
| `1`        | Fee is tax inclusive     |
| `0`        | Fee is not tax inclusive |

### Enum: chargedFee

| Attributes  | Description                             |
| ----------- | --------------------------------------- |
| `cancelled` | Fee is charged when order is cancelled. |
| `returned`  | Fee is charged when order is returned.  |
| `shipped`   | Fee is charged when order is shipped.   |


---

# 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://eshop.gitbook.io/eshopbox-developers/payment/fees-1.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.
