Skip to content
Fee Logic Setups

Add Charging Scene

Creates a billing scenario (billing item). The configuration takes effect only after approval. Most field options depend on biz_type; use the per-business-type rules returned by GET /billing/item_fields as the source of truth for allowed values and defaults. Load name_id options from GET /billing/billing_item_name for the selected biz_type.

Request parameters

  • Required: biz_type (Business Type), name_id (Fee Name ID), basis_object (Basis Object (structured)), basis_type (Basis Type), basis (Basis Value), direction (Fee Direction), divisor (Divisor), metric_type (Metric Type), granularity (Granularity), cutoff_object (Cutoff Object (structured)), cutoff_method (Cutoff Method), cutoff_digits (Cutoff Digits)
  • Optional: metric_type_bill_amount_item_ids (Secondary Bill Amount Item IDs), benchmark_rate (Benchmark Rate Formula)
  • See each field for its format, allowed values, default behavior, and business meaning.

Result

On success, the endpoint completes the described business operation. See the 200 response schema for returned data.

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

Authorization

AuthorizationstringheaderRequired

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

Request body application/json

biz_typestringrequired

Value from the billing_business_type_all reference data. It determines dependent options such as billing method and billing party.

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

name_idstringrequired

Load options from the names list returned by GET /billing/billing_item_name?biz_type=<biz_type> for the selected biz_type.

basis_objectobjectrequired

Structured object in the form { basis_type, basis }. See x-enum-details for the basis_type values (market, currency, or instrument). For basis, use global_market reference data for markets, tenant_currencies_by_channel reference data for currencies, or free text for instruments.

Allowed values:

  • 1 - Market
  • 2 - Currency
  • 3 - Counter ID

1 · Market2 · Currency3 · Counter ID

basis_typestringrequired

A top-level field expanded from basis_object.basis_type on submit, matching the value inside basis_object.

basisstringrequired

A top-level field expanded from basis_object.basis at submission time.

directionstringrequired

Value from the billing_item_direction reference data. The allowed values are determined by the field rules returned by GET /billing/item_fields for the selected biz_type.

Allowed values:

  • 1 - Match Trade Buy/Transfer Out/No Direction
  • 2 - Match Trade Sell/Transfer In
  • 3 - Match All

1 · Match Trade Buy/Transfer Out/No Direction2 · Match Trade Sell/Transfer In3 · Match All

divisorstringrequired

Dropdown options are filtered by biz_type. The allowed values are determined by the field rules returned by GET /billing/item_fields for that business type.

metric_typestringrequired

Value from the billing_metric_type reference data. The allowed values are determined by the field rules returned by GET /billing/item_fields for the selected biz_type.

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

metric_type_bill_amount_item_idsarray<string>

Required only when metric_type is set to secondary billing based on existing scenarios. Select one or more existing billing-scenario IDs as the calculation basis for the secondary item. Load the options from POST /v1/datasets/billing_item_for_secondary_item.

granularitystringrequired

Value from the billing_granularity reference data. The allowed values are determined by the field rules returned by GET /billing/item_fields for the selected biz_type.

Allowed values:

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

1 · Contract2 · Order3 · Trade Done4 · Ems Order

benchmark_ratestring

Show and submit this field only when the selected biz_type supports benchmark-rate configuration. The allowed values follow GET /billing/item_fields; enter a numeric value with up to 10 decimal places.

cutoff_objectobjectrequired

Structured object in the form { cutoff_method, cutoff_digits }. See x-enum-details for the cutoff_method values.

Allowed values:

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

1 · Round2 · Round Up3 · Round Down

cutoff_methodstringrequired

A top-level field expanded from cutoff_object.cutoff_method on submission.

cutoff_digitsstringrequired

A top-level field expanded from cutoff_object.cutoff_digits at submission time.

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