> For the complete documentation index, see [llms.txt](https://eshop.gitbook.io/eshopbox-developers/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://eshop.gitbook.io/eshopbox-developers/payment/transaction-rules/create-a-transaction-rule.md).

# Create a Transaction Rule

## Create Transaction Rule

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

#### Headers

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

#### Request Body

| Name               | Type    | Description                                                                                                    |
| ------------------ | ------- | -------------------------------------------------------------------------------------------------------------- |
| ruleName           | string  | Name for a transaction rule                                                                                    |
| channelId          | string  | <p>Unique Id for a sales channel,<br>It is a combination of portal, seller account and fulfillment module.</p> |
| feeId              | array   | Fee ids for which transaction rule is created                                                                  |
| dueDays            | number  | Number of days in which payment will be due                                                                    |
| settlementType     | string  | <p>Frequency at which payment will be received,<br><code>Enum: WEEKLY, MONTHLY, DAILY</code></p>               |
| settlementDates    | string  | <p>Date of month at which payment is to be done iff <br><code>settlementType</code> is MONTHLY</p>             |
| settlementWeekdays | string  | <p>Day of week at which settlement is to be done iff<br><code>settlementType</code> is WEEKLY</p>              |
| transactionRuleId  | string  | Rule Id for a particular channel                                                                               |
| status             | boolean | <p>Active or Inactive status of a transaction rule,<br>Reconciliation is not done for Inactive status</p>      |
| portalId           | string  | Unique Id for a portal (Ex. Amazon, Flipkart)                                                                  |
| transactionId      | number  | Unique Id for any transaction rule                                                                             |

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

```
{
    "status": "success"
}
```

{% endtab %}
{% endtabs %}

&#x20;

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

```scheme
curl -X POST https://workspace.myeshopbox.com/payments/api/v1/transactionRules \
-H "Content-Type: application/json" \
-H "Authorization: Bearer XXXX" \
-d $'{
    "ruleName": "TR2",
    "channelId": "12",
    "feeId": [
        "1",
        "3",
        "5"
    ],
    "dueDays": "7",
    "settlementType": "weekly",
    "settlementDates": "",
    "settlementWeekdays": "Thursday",
    "transactionRuleId": "",
    "status": "",
    "portalId": 2,
    "transactionId": 3
}'

```

{% endtab %}
{% endtabs %}
