Skip to content
Client Contract

Create Exchange Contract V2

Create a new customer stock trade contract (clearing/settlement contract).

Request parameters

  • Required: trade_date (trade date), counter_id (instrument), direction (side), currency (trade currency), aaid (securities account), settlement_channel (settlement channel), open_close (open/close), position (position direction), trade_dones (fill detail list)
  • Remaining fields are optional, such as settlement sub-position, trade stage, order source, custodian, expected settlement dates, settlement currency, FX rate, and issue price.
  • See each field's description for format, value range, and business meaning.

Business notes

Each fill in trade_dones links to its order via order_seq. Once created, the contract enters the clearing and settlement flow.

Risk warning

This operation may change real funds, positions, or trade status. Confirm the target record and parameters before calling.

Result

On success, the operation completes; the resulting state and returned data follow the 200 response definition.

POSThttps://b-api.lbkrs.com/v2/billing/exchange_contract

Authorization

AuthorizationstringheaderRequired

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

Permission

lb_hk_clearing.contract_manage_edit

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

Request body application/json

trade_datestringrequired

Trading date associated with this request. Use the date format defined by the API. This field is required.

counter_idstringrequired

Counter ID associated with this request. Format is {type}/{market}/{code}, for example, stock ST/HK/700 or ST/US/AAPL, and option OP/US/AAPL270319C320000.

directionstringrequired

Direction of this business operation. This field is required.

currencystringrequired

This field is required.

aaidstringrequired

Specifies A/C No.. This field is required.

Pass the internal numeric ID of the customer's securities account (aaid), not the securities account number account_no (such as H00000000) or the customer ID member_id. One customer can have multiple aaid values.

settlement_channelstringrequired

This field is required.

settlement_accountstring
stagestring
order_sourcestring
custodian_idstring

Custodian ID associated with this request.

expected_equity_settlement_datestring
expected_balance_settlement_datestring
currency_setlstring
trade_to_setl_exchange_ratestring
otcr_flagstring

otcr_flag.

Allowed values: 1 Report, 0 Do not report

Values
1
Yes (report OTCR)
0
No
open_closestringrequired

Specifies Open/Close. This field is required.

Values
OPEN
Open
CLOSE
Close
positionstringrequired

Specifies Position. This field is required.

Values
LONG
Long
SHORT
Short
biz_typestring

Identifies the business scenario to which this request applies.

issue_pricestring

Used when the instrument type is BOND.

trade_donesarray<object>required

Each item contains order_seq (front-office order number) / quantity / amount / per_value (par value per share) / ibond_interest (accrued interest) / price.

Child attributes
order_seqstring

Front-office order number.

quantitystring

Quantity.

amountstring

Amount.

per_valuestring

Par value per share.

ibond_intereststring

Accrued interest.

pricestring

Price.

Responses

HTTP 200The request was processed successfully. The response data does not contain additional business fields.
Standard response envelopecodemessagedata
dataobjectdata structure

No nested fields

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