Skip to content
Client Stock Margin

Create Client Long Margin Ratio

Creates a long-position stock margin-ratio record for a specified client, defining the client's margin ratios for a given security.

Request parameters

  • Required: aaid, counter_id. Usually provide im_factor, mm_factor, fm_factor, mcm_factor and expire_at together.
  • See the field notes for each field's format, value range, and business meaning.

Business notes

The margin ratios include the initial (im_factor), maintenance (mm_factor), force-liquidation (fm_factor), and margin-call (mcm_factor) tiers, with an optional expiry date (expire_at). Once created, the record becomes the client's effective margin configuration for that security.

Risk warning

This operation directly produces a live margin-configuration change, affecting the client's financing capacity, maintenance margin, and force-liquidation determination. Verify the target client, security, and every margin ratio before calling.

Result

On success, the margin record is created; the resulting state and returned data follow the 200 response definition.

POSThttps://b-api.lbkrs.com/risk/v1/account_stock_margin_ratio/create

Authorization

AuthorizationstringheaderRequired

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

Permission

credit_management.option_stock_margin_ratio_query

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

Request body application/json

aaidintegerrequired

Internal securities account ID aaid (numeric), not the account number account_no.

counter_idstringrequired

Security code in the form {type}/{market}/{code}, e.g. ST/US/AAPL.

im_factornumber

Initial margin rate as a fraction between 0 and 1, e.g. 0.5 = 50%.

mm_factornumber

Maintenance margin rate, a fraction between 0 and 1.

fm_factornumber

Forced-liquidation margin rate, a fraction between 0 and 1.

mcm_factornumber

Margin Call rate, a fraction between 0 and 1.

expire_atinteger

Expiry time as a Unix timestamp in seconds.

Responses

HTTP 200OK
Standard response envelopecodemessagedata
dataobjectdata structure
ticket_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