> 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 %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://eshop.gitbook.io/eshopbox-developers/payment/transaction-rules/create-a-transaction-rule.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
