Skip to content
Market

Manage Clearing Markets

Creates, edits, and deletes clearing markets through a single endpoint, distinguished by action_in (1 = add, 2 = delete, 3 = modify).

Request parameters

  • Required: action_in (operation type), market (must be a market that already exists in the POST /v1/datasets/clearing_markets list), and time_zone_name (IANA time zone name of the market, such as Asia/Tokyo; the backend requires it for add and modify).
  • id: required for modify (3) and delete (2); use the id of the clearing_markets row. Omit it when adding (1), and pick a market whose row has otc_flag 99 (disabled).
  • When otc_flag is 0 (normal day-end process), also send busin_flow_id. When otc_flag is not 99, the admin console also submits currency, overnight_flag, balance_back_n, equity_back_n, custodian_id, sub_position_no, main_flag, and use_public_stock_info.
  • Optional: market, currency, overnight_flag, custodian_id, sub_position_no, balance_back_n (cash settlement T+n), equity_back_n (securities settlement T+n), main_flag, otc_flag, use_public_stock_info, busin_flow_id (end-of-day flow ID), allow_manual_order (whether manual orders are allowed, 0/1).
  • See the field definitions for format, value ranges, defaults, and business meaning.

Business notes

  • time_zone_name is required: pass the market's IANA time zone name (such as Asia/Hong_Kong); the backend does not derive it from the market.
  • When modifying an existing market, pass the market's current values.

Risk warning

This operation changes real clearing-market configuration and affects settlement cycles and the end-of-day clearing process. Confirm the target record and parameters before calling.

Result

On success the add, edit, or delete completes. Refer to the 200 response definition for returned data.

POSThttps://b-api.lbkrs.com/clearing/markets

Authorization

AuthorizationstringheaderRequired

Send the Broker ACCESS_TOKEN as Authorization: Bearer <token>.

Permission

lb_hk_clearing.clearing_markets

The Broker ACCESS_TOKEN must be granted the permission above, or the call will be rejected.

Request body application/json

action_instringrequired

Specifies the action to perform.

Allowed values: 1 Add, 2 Delete, 3 Modify

Values
1
Add
2
Delete
3
Modify
idinteger

Required for modify (3) and delete (2); use the id of a row returned by POST /v1/datasets/clearing_markets. Omit it when adding (1).

marketstringrequired

Must be a market that already exists in the POST /v1/datasets/clearing_markets list; when adding, pick a market whose row has otc_flag 99 (disabled).

Call GET /v1/datasets/refs/clearing_markets to retrieve the current data dictionary, and use the returned entry's key as this field's value.

currencystring

Settlement currency of the market.

Values
USD
USD
HKD
HKD
SGD
SGD
CNY
CNY
AUD
AUD
JPY
JPY
GBP
GBP
EUR
EUR
CNH
CNH
overnight_flaginteger

Whether this is an overnight market.

Allowed values: 0 Non-overnight, 1 Overnight

Values
0
No
1
Yes
custodian_idinteger

Values come from the clearing_custodians dynamic enumeration.

Call GET /v1/datasets/refs/clearing_custodians to retrieve the current data dictionary, and use the returned entry's key as this field's value.

sub_position_nostring

Values come from the custodian_sub_positions dynamic enumeration.

Call GET /v1/datasets/refs/custodian_sub_positions to retrieve the current data dictionary, and use the returned entry's key as this field's value.Pass key=<custodian_id> to filter sub-positions by custodian.

balance_back_ninteger

Number of days the balance is carried back (T+N).

Values
0
0
1
1
2
2
3
3
equity_back_ninteger

Number of days equity is carried back (T+N).

Values
0
0
1
1
2
2
3
3
main_flaginteger

Whether this is the base (main) market for clearing.

Allowed values: 0 No, 1 Yes

Values
0
No
1
Yes
otc_flaginteger

OTC day-end processing mode for the market.

Allowed values: 0 Normal day-end process, 1 Simplified day-end process for OTC, 2 Non-day-end process, 99 Disabled

Values
0
Normal Day-End Tasks
1
Simplified Day-End Tasks For OTC
2
Non-Day-End Process
99
Disabled
use_public_stock_infointeger

Whether the market depends on the public stock information library.

Allowed values: 0 Does not depend on the public stock information library, 1 Depends on the public stock information library

Values
0
Independent On Public Stock Information
1
Dependent On Public Stock Information
busin_flow_idinteger

Day-end flow ID. Required when otc_flag is 0 (normal day-end process); take id from a row of POST /v1/datasets/clearing_busin_flows. Omit it otherwise.

time_zone_namestringrequired

IANA time zone name of the market, such as Asia/Tokyo, Asia/Hong_Kong, or America/New_York. Required by the backend for add (1) and modify (3); without it the call returns 800001 (InvalidField=Time Zone Name). POST /v1/datasets/clearing_markets does not currently return this field.

allow_manual_orderinteger

Whether manual orders are allowed for the market: 0 = no, 1 = yes.

Values
0
1

Responses

HTTP 200The request was processed successfully. The response data does not contain additional business fields.
Standard response envelopecodemessagedata
dataobjectdata structure
idstring
HTTP 400Bad request. Check the business error code in code and the error details in message.
Standard response envelopecodemessagedata
dataobjectdata structure

No nested fields

HTTP 401The user is not authenticated, or the login session has expired.
Standard response envelopecodemessagedata
dataobjectdata structure

No nested fields

HTTP 403The current account is not authorized to use this feature. Grant the required permission to the account in User Permission.
Standard response envelopecodemessagedata
dataobjectdata structure

No nested fields

HTTP 408The request timed out. Check the business error code in code and the error details in message.
Standard response envelopecodemessagedata
dataobjectdata structure

No nested fields

Whale Docs