# Fee Details

## The `Fee Details` Object

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

| Attributes               | Type                                                 | Description                                                                                                    |
| ------------------------ | ---------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
| `feeId`                  | `string`                                             | Unique Id for fee created or Unique Id for already present fee                                                 |
| `feesName`               | `string`                                             | Name of the created fees                                                                                       |
| `actualName`             | `string`                                             | Receivable fee Name from portal                                                                                |
| `portalId`               | `string`                                             | Id for a portal (Ex. Amazon, Flipkart) for which fees is created                                               |
| `portalName`             | `string`                                             | Portal Name for which fee is configured                                                                        |
| `feePortalId`            | `string`                                             | Unique Id for a fee on a particular portal                                                                     |
| `version`                | `string`                                             | Version of the fees created                                                                                    |
| `isInclusiveTax`         | `string`                                             | <p>Fees is tax inclusive or not</p><p>Refer<a href="#enum-isinclusivetax"><code>Enum: 0,1</code></a></p>       |
| `inclusiveTaxPercentage` | `string`                                             | Percentage of tax applicable on a fee                                                                          |
| `status`                 | `string`                                             | <p>Status of the fees<br>Refer<a href="#enum-status"><code>Enum: ACTIVE, EXPIRED, UPCOMING</code></a></p>      |
| `isEditable`             | `string`                                             | "YES" if fee is editable else "NO"                                                                             |
| `portalLogoUrl`          | `string`                                             | Portal Logo Url                                                                                                |
| `details`                | [`array[object]`](#a-details-object)                 | <p>An array of fee rules.</p><p>Also see: <strong>The details object</strong> below.</p>                       |
| `feeEventMappingDetail`  | [`array[object]`](#the-feeeventmappingdetail-object) | <p>An array of Fee Event Mapping.</p><p>Also see: <strong>The feeEventMappingDetail object</strong> below.</p> |
| `validFrom`              | `string`                                             | Datetime from which fees will be activated                                                                     |
| `validTo`                | `string`                                             | Datetime at which fees will be expired                                                                         |
| `createdOn`              | `string`                                             | The datetime, at which fees is created                                                                         |
| `updatedOn`              | `string`                                             | The datetime, at which fees is updated                                                                         |
| {% endtab %}             |                                                      |                                                                                                                |

{% tab title="Sample Object" %}

```
{
 "data": [
  {
   "portalId": "4",
   "portalName": "Snapdeal",
   "feesName": "testFeeSnapdeal",
   "validFrom": "2020-03-02T00:00:00.000Z",
   "validTo": "2020-03-17T00:00:00.000Z",
   "status": "active",
   "updatedOn": "2020-03-04T00:00:00.000Z",
   "feePortalId": "1167",
   "details": [
    {
     "_id": {
      "timestamp": 1583320826,
      "machineIdentifier": 11341042,
      "processIdentifier": 1,
      "counter": 13882030,
      "date": "2020-03-04T11:20:26.000Z",
      "timeSecond": 1583320826,
      "time": "1583320826000"
     },
     "category": "Womens Clothing Designer Jumpsuits & Rompers",
     "brand": "rock.it",
     "feeRulesStatus": "lower",
     "paymentMethod": "cod",
     "shippingZone": "local",
     "productsellingprice": {
      "unit": "INR",
      "min": 20.0,
      "max": 40.0
     },
     "weightrange": {
      "unit": "kg",
      "min": 2.0,
      "max": 5.0
     },
     "fixed": 700.0,
     "fixedApplicableOn": "Per Order Item",
     "variable": 10.0,
     "variableApplicableOn": "Per Order",
     "partitionRange": 20.0,
     "partitionRangeType": "kg",
     "percentage": 24.0,
     "percentageApplicableOn": "Per Shipment",
     "feeRuleConditionId": "5e5f8ef9ad0cf20001d3d2aa",
     "feePortalId": "1167",
     "version": "1.0",
     "feeId": "166",
     "portalId": "4",
     "ruleId": "5e5f8efaad0cf20001d3d2ae"
    },
    {
     "_id": {
      "timestamp": 1583320826,
      "machineIdentifier": 11341042,
      "processIdentifier": 1,
      "counter": 13882031,
      "date": "2020-03-04T11:20:26.000Z",
      "timeSecond": 1583320826,
      "time": "1583320826000"
     },
     "category": "Womens Clothing Designer Jumpsuits & Rompers",
     "brand": "cloak & decker",
     "feeRulesStatus": "lower",
     "paymentMethod": "cod",
     "shippingZone": "local",
     "productsellingprice": {
      "unit": "INR",
      "min": 20.0,
      "max": 40.0
     },
     "weightrange": {
      "unit": "kg",
      "min": 2.0,
      "max": 5.0
     },
     "fixed": 700.0,
     "fixedApplicableOn": "Per Order Item",
     "variable": 10.0,
     "variableApplicableOn": "Per Order",
     "partitionRange": 20.0,
     "partitionRangeType": "kg",
     "percentage": 24.0,
     "percentageApplicableOn": "Per Shipment",
     "feeRuleConditionId": "5e5f8ef9ad0cf20001d3d2aa",
     "feePortalId": "1167",
     "version": "1.0",
     "feeId": "166",
     "portalId": "4",
     "ruleId": "5e5f8efaad0cf20001d3d2af"
    },
    {
     "_id": {
      "timestamp": 1583320826,
      "machineIdentifier": 11341042,
      "processIdentifier": 1,
      "counter": 13882032,
      "date": "2020-03-04T11:20:26.000Z",
      "timeSecond": 1583320826,
      "time": "1583320826000"
     },
     "category": "Womens Clothing Designer Jumpsuits & Rompers",
     "brand": "C & D",
     "feeRulesStatus": "lower",
     "paymentMethod": "cod",
     "shippingZone": "local",
     "productsellingprice": {
      "unit": "INR",
      "min": 20.0,
      "max": 40.0
     },
     "weightrange": {
      "unit": "kg",
      "min": 2.0,
      "max": 5.0
     },
     "fixed": 700.0,
     "fixedApplicableOn": "Per Order Item",
     "variable": 10.0,
     "variableApplicableOn": "Per Order",
     "partitionRange": 20.0,
     "partitionRangeType": "kg",
     "percentage": 24.0,
     "percentageApplicableOn": "Per Shipment",
     "feeRuleConditionId": "5e5f8ef9ad0cf20001d3d2aa",
     "feePortalId": "1167",
     "version": "1.0",
     "feeId": "166",
     "portalId": "4",
     "ruleId": "5e5f8efaad0cf20001d3d2b0"
    },
    {
     "_id": {
      "timestamp": 1583320826,
      "machineIdentifier": 11341042,
      "processIdentifier": 1,
      "counter": 13882033,
      "date": "2020-03-04T11:20:26.000Z",
      "timeSecond": 1583320826,
      "time": "1583320826000"
     },
     "category": "Fashion Jewellery Designer Necklace & Sets",
     "brand": "rock.it",
     "feeRulesStatus": "lower",
     "paymentMethod": "cod",
     "shippingZone": "local",
     "productsellingprice": {
      "unit": "INR",
      "min": 20.0,
      "max": 40.0
     },
     "weightrange": {
      "unit": "kg",
      "min": 2.0,
      "max": 5.0
     },
     "fixed": 700.0,
     "fixedApplicableOn": "Per Order Item",
     "variable": 10.0,
     "variableApplicableOn": "Per Order",
     "partitionRange": 20.0,
     "partitionRangeType": "kg",
     "percentage": 24.0,
     "percentageApplicableOn": "Per Shipment",
     "feeRuleConditionId": "5e5f8ef9ad0cf20001d3d2aa",
     "feePortalId": "1167",
     "version": "1.0",
     "feeId": "166",
     "portalId": "4",
     "ruleId": "5e5f8efaad0cf20001d3d2b1"
    },
    {
     "_id": {
      "timestamp": 1583320826,
      "machineIdentifier": 11341042,
      "processIdentifier": 1,
      "counter": 13882034,
      "date": "2020-03-04T11:20:26.000Z",
      "timeSecond": 1583320826,
      "time": "1583320826000"
     },
     "category": "Fashion Jewellery Designer Necklace & Sets",
     "brand": "cloak & decker",
     "feeRulesStatus": "lower",
     "paymentMethod": "cod",
     "shippingZone": "local",
     "productsellingprice": {
      "unit": "INR",
      "min": 20.0,
      "max": 40.0
     },
     "weightrange": {
      "unit": "kg",
      "min": 2.0,
      "max": 5.0
     },
     "fixed": 700.0,
     "fixedApplicableOn": "Per Order Item",
     "variable": 10.0,
     "variableApplicableOn": "Per Order",
     "partitionRange": 20.0,
     "partitionRangeType": "kg",
     "percentage": 24.0,
     "percentageApplicableOn": "Per Shipment",
     "feeRuleConditionId": "5e5f8ef9ad0cf20001d3d2aa",
     "feePortalId": "1167",
     "version": "1.0",
     "feeId": "166",
     "portalId": "4",
     "ruleId": "5e5f8efaad0cf20001d3d2b2"
    }
   ],
   "version": "1.0",
   "feeEventMappingDetail": [
    {
     "id": "2077",
     "fee_portal_id": "1167",
     "category": "CHARGED_FEE",
     "event_type": "shipped",
     "event_sub_type": "",
     "partial_percentage_value": 0.0,
     "created_on": "2020-03-04T11:20:25.000Z",
     "updated_on": "2020-03-04T11:20:25.000Z"
    },
    {
     "id": "2078",
     "fee_portal_id": "1167",
     "category": "REVERSED_FEE",
     "event_type": "returned",
     "event_sub_type": "courier",
     "partial_percentage_value": 20.0,
     "created_on": "2020-03-04T11:20:25.000Z",
     "updated_on": "2020-03-04T11:20:25.000Z"
    },
    {
     "id": "2079",
     "fee_portal_id": "1167",
     "category": "REVERSED_FEE",
     "event_type": "returned",
     "event_sub_type": "customer",
     "partial_percentage_value": 10.0,
     "created_on": "2020-03-04T11:20:25.000Z",
     "updated_on": "2020-03-04T11:20:25.000Z"
    }
   ],
   "feePortalMappingDetail": null,
   "feeId": "166",
   "isDefault": "NO",
   "isEditable": "YES",
   "isInclusiveTax": "1",
   "inclusiveTaxPercentage": "4",
   "createdOn": null,
   "portalLogoUrl": null,
   "actualName": "testFee"
  }
 ],
 "total": "9",
 "page": 1,
 "per_page": 5
}
```

{% endtab %}
{% endtabs %}

### Enum: status

| Attributes | Description                                        |
| ---------- | -------------------------------------------------- |
| `ACTIVE`   | This is the applicable fee for the current period. |
| `EXPIRED`  | Fee for which validity has expired.                |
| `UPCOMING` | Fee which will be applicable from a future date.   |

### Enum: isInclusiveTax

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

### A `details` Object

| Attributes                         | Type                                        | Description                                                                                                                                                          |
| ---------------------------------- | ------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `details[]._id`                    | [`object`](#the-_id-object)                 | System details                                                                                                                                                       |
| `details[].brand`                  | `array`                                     | Brands for which rule is created.                                                                                                                                    |
| `details[].feeRuleStatus`          | `string`                                    | <p>Action to be considered for fee rules.</p><p> Refer<a href="#enum-feerulestatus"><code>Enum: HIGHER, LOWER, SUM</code></a></p>                                    |
| `details[].paymentMethod`          | `string`                                    | <p>Mode of payment </p><p>Refer<a href="#enum-paymentmethod"><code>Enum: PREPAID, COD</code></a></p>                                                                 |
| `details[].fixed`                  | `number`                                    | Fee value which is fixed for the rule and would not vary.                                                                                                            |
| `details[].fixedApplicableOn`      | `string`                                    | <p><code>fixed</code> value applicable on conditions</p><p>Refer<a href="#enum-applicableon"><code>Enum: Per Order, Per Order Item, Per Shipment</code></a></p>      |
| `details[]. feeRuleConditionId`    | `string`                                    | Fee Rule Condition Id                                                                                                                                                |
| `details[].feePortalId`            | `string`                                    | Unique Id for a fee on particular portal                                                                                                                             |
| `details[].version`                | `string`                                    | Fee Version for fees                                                                                                                                                 |
| `details[].feeId`                  | `string`                                    | Unique Id for Fee                                                                                                                                                    |
| `details[].portalid`               | `string`                                    | portal for which fee is configured                                                                                                                                   |
| `details[].category`               | `array`                                     | Categories for which rule is created.                                                                                                                                |
| `details[].ruleId`                 | `string`                                    | Mongo rule for particular Id                                                                                                                                         |
| `details[].percentage`             | `number`                                    | Percentage value to be considered for the rule.                                                                                                                      |
| `details[].percentageApplicableOn` | `string`                                    | <p><code>percentage</code> value applicable on conditions</p><p>Refer<a href="#enum-applicableon"><code>Enum: Per Order, Per Order Item, Per Shipment</code></a></p> |
| `details[].productsellingprice`    | [`object`](#the-productsellingprice-object) | <p>array of product selling price</p><p>Also see: <strong>The productsellingprice object</strong></p>                                                                |
| `details[].weightrange`            | [`object`](#the-weightrange-object)         | <p>array of weight range</p><p>Also see: <strong>The weightrange object</strong></p>                                                                                 |
| `details[].variable`               | `number`                                    | Fee value which will vary with different conditions.                                                                                                                 |
| `details[]. variableApplicableOn`  | `string`                                    | <p><code>variable</code> value applicable on con</p><p>Refer<a href="#enum-applicableon"><code>Enum: Per Order, Per Order Item, Per Shipment</code></a></p>          |
| `details[].partitionRange`         | `string`                                    | Change in Variable value added as per defined units.                                                                                                                 |
| `details[].partitionRangeType`     | `string`                                    | Partition Range Unit                                                                                                                                                 |
| `details[].shippingZone`           | `string`                                    | Zone to which order is shipped                                                                                                                                       |

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

### 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: paymentMethod

| Attributes | Description                             |
| ---------- | --------------------------------------- |
| `PREPAID`  | Payment is done before shipment         |
| `COD`      | Payment is done at the time of delivery |

### The `productsellingprice` object

| Attributes                 | Type     | Description                |
| -------------------------- | -------- | -------------------------- |
| `productsellingprice.unit` | `string` | currency(INR)              |
| `productsellingprice .max` | `number` | Maximum value of PSP range |
| `productsellingprice.min`  | `number` | Minimum value of PSP range |

### The `weightrange` object

| Attributes         | Type     | Description                   |
| ------------------ | -------- | ----------------------------- |
| `weightrange.unit` | `string` | unit of weight(kg)            |
| `weightrange.max`  | `number` | Maximum value of weight range |
| `weightrange.min`  | `number` | Minimum value of weight range |

### The `_id` object

| Attributes              | Type     | Description                   |
| ----------------------- | -------- | ----------------------------- |
| `_id.timestamp`         | `number` | Timestamp of fees creation    |
| `_id.machineIdentifier` | `number` | Machine Identifier            |
| `_id.processIdentifier` | `number` | Process identifier            |
| `_id.counter`           | `number` | Counter                       |
| `_id.time`              | `string` | Time of fees creation         |
| `_id.date`              | `string` | Date of fees creation         |
| `_id.timeSecond`        | `number` | Time second for fees creation |

### The `feeEventMappingDetail` object

| Attribute                                           | Type     | Description                                                                                                                   |
| --------------------------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------- |
| `feeEventMappingDetail [].id`                       | `string` | Unique Id for each rule                                                                                                       |
| `feeEventMappingDetail [].fee_portal_id`            | `string` | Unique Id for a fee on particular portal                                                                                      |
| `feeEventMappingDetail [].category`                 | `string` | Type of fee charged                                                                                                           |
| `feeEventMappingDetail [].event_type`               | `string` | <p>Detail of when fee is charged</p><p>Refer<a href="#enum-eventtype"><code>Enum: RETURNED, SHIPPED, CANCELLED</code></a></p> |
| `feeEventMappingDetail [].event_sub_type`           | `string` | "CUSTOMER" or "COURIER" in case of "RETURNED" event type.                                                                     |
| `feeEventMappingDetail [].partial_percentage_value` | `number` | Percentage of fee to be charged                                                                                               |
| `feeEventMappingDetail [].created_on`               | `string` | The time, on which fee is created                                                                                             |
| `feeEventMappingDetail [].updated_on`               | `string` | The time, on which fee is updated                                                                                             |

### Enum: eventType

| Attributes  | Description                                   |
| ----------- | --------------------------------------------- |
| `RETURNED`  | Fee is applicable when the order is returned  |
| `SHIPPED`   | Fee is applicable when the order is shipped   |
| `CANCELLED` | Fee is applicable when the order is cancelled |
