# Create a fee

## Save Fee Rule

<mark style="color:green;">`POST`</mark> `https://workspace.myeshopbox.com/payments/api/v1/fee`

#### Headers

| Name          | Type   | Description                                  |
| ------------- | ------ | -------------------------------------------- |
| Authorization | string | The Bearer token to grant access to the API. |

#### Request Body

| Name                   | Type   | Description                                                           |
| ---------------------- | ------ | --------------------------------------------------------------------- |
| isInclusiveTax         | string | <p>Fees is Tax inclusive or not.<br>Refer <code>Enum: 1, 0</code></p> |
| portalId               | string | Unique Id for a portal (Ex. Amazon, Flipkart)                         |
| 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                                       |
| inclusiveTaxPercentage | string | Percentage of tax applicable on a fee                                 |
| validFrom              | string | Date from which fees will be activated :`linkFees`                    |
| validTo                | string | Date at which fees will be expired                                    |
| fee                    | array  | Detail of when is the fee charged                                     |
| feeRules               | object | Detail of fee rules                                                   |

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

```
{
 "accountId": "28",
 "version": "1.0",
 "portalId": "1",
 "feeId": "179",
 "feeName": "flipkartFees",
 "isInclusiveTax": "1",
 "inclusiveTaxPercentage": 3.0,
 "fee": [
  {
   "eventType": "cancelled",
   "eventSubType": "",
   "partialPercentageValue": 0.0,
   "feeCharged": "CHARGED_FEE"
  }
 ],
 "validFrom": "2020-03-01T00:00:00.000Z",
 "validTo": "2020-03-26T00:00:00.000Z",
 "feeRules": [
  {
   "details": {
    "feeRulesStatus": "lower",
    "paymentMethod": "Prepaid",
    "shippingZone": "Regional"
   },
   "feeRanges": [
    {
     "rangeType": "product selling price",
     "rangeTypeUnit": "INR",
     "minRange": 23.0,
     "maxRange": 45.0
    }
   ],
   "feeValues": [
    {
     "type": "variable",
     "value": 2.0,
     "applicableOn": "Per Shipment",
     "partitionRange": 4.0,
     "partitionRangeType": "kg"
    },
    {
     "type": "fixed",
     "value": 3.0,
     "applicableOn": "Per Order Item"
    }
   ]
  }
 ],
 "feeRuleConditionId": "5e733f75a675f200013f6181",
 "feePortalId": "1210",
 "actualName": "acb"
}
```

{% endtab %}
{% endtabs %}

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

```scheme
curl -X POST https://workspace.myeshopbox.com/payments/api/v1/fee \
-H "Content-Type: application/json" \
-H "Authorization: Bearer XXXX" \
-d $'{
    "portalId": 2,
    "feeId": "1",
    "feeName": "",
    "isInclusiveTax": "0",
    "inclusiveTaxPercentage": "11",
    "chargedFee": "cancelled",
    "chargedFeeCases": "",
    "courierReturnedFee": "",
    "courierReturnedPercent": "",
    "customerReturnedFee": "",
    "customerReturnedPercent": "",
    "fee": [
        {
            "eventType": "cancelled",
            "eventSubType": "",
            "feeCharged": "CHARGED_FEE"
        }
    ],
    "feeRules": [
        {
            "details": {},
            "feeRanges": [
                {
                    "rangeType": "product selling price",
                    "rangeTypeUnit": "INR",
                    "minRange": 0,
                    "maxRange": 100
                }
            ],
            "feeValues": [
                {
                    "type": "fixed",
                    "partitionRangeType": null,
                    "value": 12,
                    "applicableOn": "Per Order",
                    "partitionRange": null
                }
            ]
        }
    ],
    "validFrom": "2019-09-01T00:00:00.000Z",
    "feePortalId": "145",
    "validityPeriod": "definite",
    "ruleId": "5d7f2b78ad0cf200017cebbb"
}'

```

{% endtab %}
{% endtabs %}


---

# 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/configuring-a-fee.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.
