Skip to main content

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

NameTypeInDescription
node_idstringpathThe ID of the node

Request Body

NameTypeRequiredDescription
sideintegerYesOffer side to match. See Side enum below
rule_typeintegerYesRule evaluation type. See RuleType enum below
match_actionintegerNoAction to take when rule matches. See MatchAction enum below. Defaults to Accept (1) if not provided
consume_on_matchbooleanYesIf true, consume the rule after a match
statusintegerYesActivation status. See RuleStatus enum below
priorityintegerYesPriority value; lower can be treated as higher precedence
namestringYesRule name
token_idstringNoTarget token ID (optional)
above_percentnumberNoAccept if offer is up to +X% above reference price (RuleType=Percent)
below_percentnumberNoAccept if offer is down to -X% below reference price (RuleType=Percent)
above_amountnumberNoAccept if unit price is at most reference + amount (RuleType=Absolute)
below_amountnumberNoAccept if unit price is at least reference - amount (RuleType=Absolute)
min_offer_quantityintegerNoMinimum acceptable offer quantity
max_offer_quantityintegerNoMaximum acceptable offer quantity
valid_fromstring (ISO 8601)NoStart timestamp for rule validity
valid_untilstring (ISO 8601)NoEnd timestamp for rule validity

Enums

RuleTypeValueMeaning
Unconditional1Auto-accept any incoming OTC offer
Percent2Accept if offer within percent thresholds of reference price
Absolute3Accept if unit price within absolute min/max thresholds
RuleStatusValueMeaning
Inactive1Rule disabled
Active2Rule enabled
SideValueMeaning
Both1Match both buy and sell offers
Buy2Match buy-side offers
Sell3Match sell-side offers
MatchActionValueMeaning
Accept1Accept the matched offer
Reject2Reject the matched offer

Headers

NameTypeDescription
Content-Typestringapplication/json
AuthorizationstringBearer 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

FieldTypeDescription
idstringUnique identifier of the rule
node_idstringNode ID
token_idstringToken ID (if provided)
sideintegerSide value (see enum)
rule_typeintegerRule type (see enum)
match_actionintegerMatch action (see enum)
above_percentnumberUpper percent threshold (if set)
below_percentnumberLower percent threshold (if set)
min_offer_quantityintegerMinimum quantity (if set)
max_offer_quantityintegerMaximum quantity (if set)
consume_on_matchbooleanWhether the rule is consumed on match
priorityintegerPriority value
statusintegerStatus (see enum)
namestringRule name
created_bystringCreator ID
created_atstringISO 8601 timestamp when created
updated_atstringISO 8601 timestamp when updated
is_apibooleanWhether created by API

Status Codes

CodeDescription
201Created
400Bad Request - Validation error
401Unauthorized - Missing or invalid token
404Not Found - Node ID does not exist
500Internal Server Error