Create OTC Order Rule by Node ID
Create a new OTC order rule for a specific node.
Request
POST /v2/admin/otc-order-rules/nodes/{node_id}
Parameters
| Name | Type | In | Description |
|---|---|---|---|
node_id | string | path | The ID of the node |
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
side | integer | Yes | Offer side to match. See Side enum below |
rule_type | integer | Yes | Rule evaluation type. See RuleType enum below |
match_action | integer | No | Action to take when rule matches. See MatchAction enum below. Defaults to Accept (1) if not provided |
consume_on_match | boolean | Yes | If true, consume the rule after a match |
status | integer | Yes | Activation status. See RuleStatus enum below |
priority | integer | Yes | Priority value; lower can be treated as higher precedence |
name | string | Yes | Rule name |
token_id | string | No | Target token ID (optional) |
above_percent | number | No | Accept if offer is up to +X% above reference price (RuleType=Percent) |
below_percent | number | No | Accept if offer is down to -X% below reference price (RuleType=Percent) |
above_amount | number | No | Accept if unit price is at most reference + amount (RuleType=Absolute) |
below_amount | number | No | Accept if unit price is at least reference - amount (RuleType=Absolute) |
min_offer_quantity | integer | No | Minimum acceptable offer quantity |
max_offer_quantity | integer | No | Maximum acceptable offer quantity |
valid_from | string (ISO 8601) | No | Start timestamp for rule validity |
valid_until | string (ISO 8601) | No | End timestamp for rule validity |
Enums
| RuleType | Value | Meaning |
|---|---|---|
| Unconditional | 1 | Auto-accept any incoming OTC offer |
| Percent | 2 | Accept if offer within percent thresholds of reference price |
| Absolute | 3 | Accept if unit price within absolute min/max thresholds |
| RuleStatus | Value | Meaning |
|---|---|---|
| Inactive | 1 | Rule disabled |
| Active | 2 | Rule enabled |
| Side | Value | Meaning |
|---|---|---|
| Both | 1 | Match both buy and sell offers |
| Buy | 2 | Match buy-side offers |
| Sell | 3 | Match sell-side offers |
| MatchAction | Value | Meaning |
|---|---|---|
| Accept | 1 | Accept the matched offer |
| Reject | 2 | Reject the matched offer |
Headers
| Name | Type | Description |
|---|---|---|
Content-Type | string | application/json |
Authorization | string | Bearer token for authentication |
Example
curl --location '\{\{baseUrl\}\}/v2/admin/otc-order-rules/nodes/6901350deb7ed8c1c38de4e9' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...' \
--data '{
"side": 1,
"rule_type": 2,
"consume_on_match": true,
"status": 2,
"priority": 1,
"name": "Example Rule",
"token_id": "6909ddb65b25a8f90960506a",
"above_percent": 11,
"below_percent": 23,
"min_offer_quantity": 1,
"max_offer_quantity": 4
}'
Response
{
"id": "69110fc4afcb084457294dbc",
"node_id": "6901350deb7ed8c1c38de4e9",
"token_id": "6909ddb65b25a8f90960506a",
"side": 1,
"rule_type": 2,
"match_action": 1,
"above_percent": 11,
"below_percent": 23,
"min_offer_quantity": 1,
"max_offer_quantity": 4,
"consume_on_match": true,
"priority": 1,
"status": 2,
"name": "Example Rule",
"created_by": "000000000000000000000000",
"created_at": "2025-11-10T01:03:48.892979+03:00",
"updated_at": "2025-11-10T01:03:48.892979+03:00",
"is_api": true
}
Response Fields
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier of the rule |
node_id | string | Node ID |
token_id | string | Token ID (if provided) |
side | integer | Side value (see enum) |
rule_type | integer | Rule type (see enum) |
match_action | integer | Match action (see enum) |
above_percent | number | Upper percent threshold (if set) |
below_percent | number | Lower percent threshold (if set) |
min_offer_quantity | integer | Minimum quantity (if set) |
max_offer_quantity | integer | Maximum quantity (if set) |
consume_on_match | boolean | Whether the rule is consumed on match |
priority | integer | Priority value |
status | integer | Status (see enum) |
name | string | Rule name |
created_by | string | Creator ID |
created_at | string | ISO 8601 timestamp when created |
updated_at | string | ISO 8601 timestamp when updated |
is_api | boolean | Whether created by API |
Status Codes
| Code | Description |
|---|---|
| 201 | Created |
| 400 | Bad Request - Validation error |
| 401 | Unauthorized - Missing or invalid token |
| 404 | Not Found - Node ID does not exist |
| 500 | Internal Server Error |