Skip to main content

Update OTC Order Rule by ID

Update an existing OTC order rule by its ID.

Request

PUT /v2/admin/otc-order-rules/{id}

Parameters

NameTypeInDescription
idstringpathThe ID of the rule to update

Request Body

NameTypeRequiredDescription
sideintegerNoOffer side to match. See Side enum below
rule_typeintegerNoRule evaluation type. See RuleType enum below
match_actionintegerNoAction to take when rule matches. See MatchAction enum below
consume_on_matchbooleanNoIf true, consume the rule after a match
statusintegerNoActivation status. See RuleStatus enum below
priorityintegerNoPriority value; lower can be treated as higher precedence
namestringNoRule 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 --request PUT '\{\{baseUrl\}\}/v2/admin/otc-order-rules/6910a6ab5f635dd4dc251581' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...' \
--data '{
"side": 1,
"rule_type": 2,
"consume_on_match": true,
"status": 2,
"priority": 3,
"name": "Example Rule",
"token_id": "6909ddb65b25a8f90960506a",
"above_percent": 11,
"below_percent": 23,
"min_offer_quantity": 1,
"max_offer_quantity": 4
}'

Response

{
"id": "6910a6ab5f635dd4dc251581",
"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": 3,
"status": 2,
"valid_from": "2025-11-12T01:04:12Z",
"valid_until": "2025-11-19T01:04:24Z",
"name": "Example Rule",
"created_by": "665b372f3a72d7d0791596ba",
"created_at": "2025-11-09T14:35:23.19Z",
"updated_at": "2025-11-10T12:04:47.951493+03:00",
"is_api": false
}

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)
valid_fromstringISO 8601 start of validity (if set)
valid_untilstringISO 8601 end of validity (if set)
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
200OK
400Bad Request - Validation error
401Unauthorized - Missing or invalid token
404Not Found - Rule ID does not exist
500Internal Server Error