Skip to content
Agent Billing

Add Billing Company Fee

Add Billing Company Fee.

Request parameters

  • Required: custodian_id (Custodian/Company ID), billing_item_id (Billing Item ID), threshold (Threshold), fee_rate_type (Fee Rate Type), calculation_method (Calculation Method), rates (Rate Rules), currency (Currency), min (Minimum Fee), max (Maximum Fee), granularity (Granularity), cutoff_method (Cutoff Method), cutoff_digits (Cutoff Digits)
  • Optional: billing_item (Billing Item Snapshot), metric_type (Metric Type), fixed_rates (Fixed Rates), max_metric (Max Metric Config), max_metric_type (Max Metric Type), max_metric_rate (Max Metric Rate), min_metric (Min Metric Config), min_metric_type (Min Metric Type), min_metric_rate (Min Metric Rate), metric_cycle_type (Metric Cycle Type), special_fees (Special Fee Conditions), audit_frontend_resource (Frontend Audit Snapshot)
  • See each field for its format, allowed values, and business meaning.

Result

On success, the endpoint completes the operation. See the 200 response schema for returned data and subsequent state information.

POSThttps://b-api.longbridge.xyz/billing/company_fee

Authorization

AuthorizationstringheaderRequired

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

Request body application/json

custodian_idstringrequired

Custodian; value comes from the clear_custodian_broker_no_all dynamic enum, not fixed.

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

billing_item_idstringrequired

The billing item ID, selected via the billing item selector.

billing_itemobject

The billing-item object, containing fields such as id/name_loc, submitted together with the selected billing scenario.

metric_typestring

The measurement type, filtered by the selected billing item.

Allowed values:

  • 1 - Transaction Quantity(Fractional support)
  • 2 - Transaction Amount
  • 3 - Single Billing By Corresponding granularity
  • 4 - Options Quantity
  • 5 - Upstream
  • 6 - Number Of Billing Contracts
  • 7 - Number Of Orders
  • 8 - Number Of Transactions
  • 9 - Value Of Positions
  • 10 - Calculation Based On Existing Scenarios
  • 11 - Market Value Of Securities Lending
  • 13 - Transaction Quantity Of Board Lot (Transfer Warehouse)
  • 14 - Market Value (Transfer Warehouse)
  • 15 - Number of Ems Orders

1 · Transaction Quantity(Fractional support)2 · Transaction Amount3 · Single Billing By Corresponding granularity4 · Options Quantity5 · Upstream6 · Number Of Billing Contracts7 · Number Of Orders8 · Number Of Transactions9 · Value Of Positions10 · Calculation Based On Existing Scenarios11 · Market Value Of Securities Lending13 · Transaction Quantity Of Board Lot (Transfer Warehouse)14 · Market Value (Transfer Warehouse)15 · Number of Ems Orders

thresholdstringrequired

The measurement threshold; required when metric_type is not "charge by number of contracts". A numeric string with at most 10 decimal places.

fee_rate_typestringrequired

Rate type.

Agent billing does not support monthly-tiered type 3.

Allowed values:

  • 1 - Flat Rate
  • 2 - Tiered Rate Per Txn
  • 3 - Monthly Tiered Rate
  • 4 - Float Rate
  • 5 - Float Rate (Per Txn)

1 · Flat Rate2 · Tiered Rate Per Txn3 · Monthly Tiered Rate4 · Float Rate5 · Float Rate (Per Txn)

calculation_methodstringrequired

The calculation method, derived from fee_rate_type: floating types (2, 7) are "2", and all others are "1".

fixed_ratesarray<string>

Used for fixed rates. Each item has the form { fee_rate }; the value must be non-negative and may have up to 10 decimal places.

ratesarray<string>required

The final rate structure submitted, generated from fixed_rates/single_rates/float_rates/month_rates according to fee_rate_type; each element contains fields such as gt/lte/fee_rate.

currencystringrequired

Currency; values come from the global_currency_filter_by_account_channel dynamic enum, such as USD/HKD/CNH.

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

minstringrequired

Specifies Minimum Fee. This field is required.

maxstringrequired

A numeric string, default 999999999.

max_metricobject

Maximum-ratio limit object { max_metric_type, max_metric_rate }, shown only under specific measurement-type / business-type combinations.

max_metric_typestring

Specifies Max Metric Type.

Allowed values:

  • 0 - Disabled
  • 1 - Enabled

0 · Disabled1 · Enabled

max_metric_ratestring

The rate value when the maximum ratio limit is enabled; multiplied by 100 for display and divided by 100 to restore it upon submission.

granularitystringrequired

Billing granularity, shown only in scenarios such as filled quantity / filled amount.

Allowed values:

  • 1 - Contract
  • 2 - Order
  • 3 - Trade_done
  • 4 - Ems_order

1 · Contract2 · Order3 · Trade_done4 · Ems_order

min_metricobject

The minimum ratio limit object { min_metric_type, min_metric_rate }.

min_metric_typestring

Expanded from min_metric.min_metric_type.

min_metric_ratestring

Expanded from min_metric.min_metric_rate.

cutoff_methodstringrequired

Rounding method.

Allowed values:

  • 1 - Round
  • 2 - Round Up
  • 3 - Round Down

1 · Round2 · Round Up3 · Round Down

cutoff_digitsstringrequired

The number of rounding digits. Disabled when the rounding method is "Follow Scenario".

Allowed values: 0, 1, 2, 3

0 · 01 · 12 · 23 · 3

metric_cycle_typenumber

Measurement-period type. Use 4 for monthly tiers and 0 otherwise. Broker billing always uses 0.

special_feesarray<string>

An array of differentiated rate conditions, filtered by business type (in the agent scenario, conditions whose business type includes 11 are filtered out).

audit_frontend_resourceobject

A frontend form snapshot attached upon submission for backend audit tracing; in the add scenario it is fixed as an add operation.

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