Skip to content
Longport Whale
Fee Logic Setups

Add Charging Scene

Submitted from the "Add" subpage of the Fee Logic Setups page; enums come from the billing_biz_type_all / billing_basis_type / billing_item_direction / billing_granularity / billing_fee_cutoff_method references and the billingItemName endpoint.

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

Business Type. Enum from ref billing_biz_type_all; determines subsequent options (such as billing method / billing target).

name_idstringrequired

Fee Name ID. From the names list returned by the billingItemName({biz_type}) endpoint, queried in a cascade based on the current biz_type.

basis_objectobjectrequired

Basis Object (structured). The value of the BasisObject form component { basis_type, basis }: basis_type comes from ref billing_basis_type (e.g. market / currency / billing item), and basis is the concrete value (market uses global_market, currency uses global_currency_filter_by_account_channel, billing item is plain text).

basis_typestringrequired

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

basisstringrequired

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

directionstringrequired

Fee Direction. The enum comes from ref billing_item_direction; the options are filtered by the bizMap corresponding to biz_type.

divisorstringrequired

Divisor. Dropdown options generated by filtering bizMap's allow_options for the given biz_type.

metric_typestringrequired

Metric Type. Enum from ref billing_metric_type, filtered by the bizMap corresponding to biz_type.

metric_type_bill_amount_item_idsarray<string>

Secondary Bill Amount Item IDs. Required only when metric_type = calculation based on existing scenarios (BillingMetricType.CalculationBasedOnExistingScenarios); comes from the multi-select result of the templateId=billing_item_for_secondary_item table.

granularitystringrequired

Granularity. Values come from ref billing_granularity, filtered by biz_type via bizMap.

benchmark_ratestring

Benchmark Rate Formula. Shown only when the bizMap for the given biz_type has a benchmark_rate config; a plain number with up to 10 decimal places.

cutoff_objectobjectrequired

Cutoff Object (structured). { cutoff_method, cutoff_digits }; the cutoff_method enum comes from ref billing_fee_cutoff_method.

cutoff_methodstringrequired

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

cutoff_digitsstringrequired

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

Responses

HTTP 200No confirmable field definitions are available for the response yet.
Standard response envelopecodemessagedata
dataobjectdata structure

No nested fields

Whale Docs