Skip to content
Client Contract

Edit Exchange Contract V2

Edit an existing customer contract; the contract ID is passed as path parameter id. The field structure mirrors that of contract creation.

Request parameters

  • Required: id (contract ID, path parameter), trade_date, counter_id, direction, currency, aaid, settlement_channel, open_close, position, trade_dones (fill detail list), audit_frontend_resource (audit context)
  • The admin console submits the full contract when editing: every field of contract creation plus audit_frontend_resource. Each trade_dones item is an object.
  • See each field's description for format, value range, and business meaning.

Business notes

audit_frontend_resource is caller-provided and records the audit context of this operation.

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.

PUThttps://b-api.lbkrs.com/v2/billing/exchange_contract/{id}

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.

Parameters

idstringRequired

Included in the path.

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

Settlement sub-position.

stagestring

Trading stage.

order_sourcestring

Order channel or agent.

custodian_idstring

Custodian ID associated with this request.

expected_equity_settlement_datestring

Expected securities settlement date.

expected_balance_settlement_datestring

Expected cash settlement date.

currency_setlstring

Settlement currency.

trade_to_setl_exchange_ratestring

Exchange rate from the trade currency to the settlement currency.

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

Submit Trade Done List as a JSON array. This field is required. Each item is a fill object, not a string.

Child attributes
order_seqstring

Front-office order number.

quantitystring

Quantity.

amountstring

Amount.

per_valuestring

Par value per share.

ibond_intereststring

Accrued interest.

pricestring

Price.

ems_order_idstring

EMS order ID of the fill.

audit_frontend_resourceobjectrequired

Audit context submitted by the caller. The admin console sends $behavior (operation description), $action (edit), and no. This field is required.

Child attributes
$behaviorstring
$actionstring
nostring

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