Skip to content
Rate Setups(Package-based)

Add Billing Package

Add Billing Package.

Request parameters

  • Required: name (Package Name), category (Package Category), org_id (Org ID), fee_rate_type (Fee Rate Type), metric_cycle_type (Metric Cycle Type), metric_type (Metric Type), granularity (Granularity), cutoff_method (Cutoff Method), cutoff_digits (Cutoff Digits)
  • Optional: maket_rule_ids (Market Rule IDs), fees (Fees), rates (Rates), max_metric_type (Max Metric Type), max_metric_rate (Max Metric Rate), min_metric_type (Min Metric Type), min_metric_rate (Min Metric Rate), metric_type_bill_amount_item_ids (Secondary Bill Amount Item IDs), special_fees (Special Fees), conditions (Trigger Conditions)
  • 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/v2/billing/billing_package

Authorization

AuthorizationstringheaderRequired

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

Request body application/json

namestringrequired

Specifies Package Name. This field is required.

categorystringrequired

Corresponds to the ORG_PACKAGE_TYPE and similar category enums in the first step of the form wizard.

Allowed values:

  • 1 - General
  • 2 - FD Biz

1 · General2 · FD Biz

org_idnumberrequired

Org ID associated with this request.

maket_rule_idsarray<string>

The field name is spelled as in the API (maket_rule_ids, not market_rule_ids); elements are rule IDs (number).

feesarray<string>

Each array item has the form { billing_item_id, currency, max, min, threshold }. billing_item_id identifies the billing scenario, currency is a currency code, and max, min, and threshold are numeric strings.

ratesarray<string>

Array elements { gt, lte, fee_rate, min }: configure the fee rate fee_rate and minimum charge min per interval (greater than gt, less than or equal to lte).

fee_rate_typenumberrequired

An enum value whose exact meaning was not confirmed in the client; it cascades according to the structure returned by billingItemFields.

Allowed values:

  • 1 - Fixed Rate
  • 2 - Single-Step Tiered Rate
  • 3 - Monthly Tiered Rate
  • 4 - Floating Rate
  • 5 - Floating Rate Single-Tier

1 · Fixed Rate2 · Single-Step Tiered Rate3 · Monthly Tiered Rate4 · Floating Rate5 · Floating Rate Single-Tier

metric_cycle_typenumberrequired

Specifies Metric Cycle Type. This field is required.

max_metric_typenumber

Specifies Max Metric Type.

max_metric_ratestring

Specifies Max Metric Rate.

min_metric_typenumber

Specifies Min Metric Type.

min_metric_ratestring

Specifies Min Metric Rate.

metric_typenumberrequired

Uses the same metric_type enum as the billing scenario, sourced from the billing_metric_type reference data.

Allowed values:

  • 1 - Transaction Quantity(Fractional support)
  • 2 - Transaction Amount/Other 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 Amount/Other 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

granularitynumberrequired

The enum is the same as ref billing_granularity.

Allowed values:

  • 1 - Contract
  • 2 - Order
  • 3 - Trade Done
  • 4 - Ems Order

1 · Contract2 · Order3 · Trade Done4 · Ems Order

cutoff_methodnumberrequired

Enum is the same as the billing_fee_cutoff_method reference.

Allowed values:

  • 0 - Follow the scene
  • 1 - Round (round half up)
  • 2 - Round up
  • 3 - Round down

0 · Follow the scene1 · Round (round half up)2 · Round up3 · Round down

cutoff_digitsnumberrequired

Specifies Cutoff Digits. This field is required.

metric_type_bill_amount_item_idsarray<string>

Each item is a number and follows the same rules as the field with the same name in the billing scenario.

special_feesarray<string>

Array elements { max, min, threshold, max_metric_type, max_metric_rate, min_metric_type, name, rate, metric_type, granularity, cutoff_method, cutoff_digits }, used to add special rate items to the package.

conditionsarray<string>

Array element { field, value }:

  • field: Condition field number (integer) identifying which business dimension the condition applies to. For example, 3 denotes the account/counter condition.
  • value: The selected value for the condition, as a string.

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