Skip to content
Rate Setups(Package-based)

Add Billing Package

Creates a billing package that combines billing scenarios, rate tiers, caps/floors, and personalized fees into a package assignable to an organization or customer (v2).

Request parameters

  • Required: name (package name), org_package_type (package type), fees (fee items)
  • Optional: org_id (organization ID), market_rule_ids (market rule IDs)
  • Metering, cap/floor and rate-band fields belong to each fees item (see fees); rates needs at least one band.
  • See the field descriptions for the format, value range, and business meaning of each field.

Business notes

A package is assembled step by step from multiple fee items and rate configurations; the values of some enum fields must stay consistent with the field configuration returned by GET /billing/item_fields.

Risk warning

This operation changes live billing configuration and may affect how customers are actually charged. Verify the target record and parameters before calling.

Result

On success, the operation completes; the resulting state and returned data follow the 200 response definition.

POSThttps://b-api.lbkrs.com/v2/billing/billing_package

Authorization

AuthorizationstringheaderRequired

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

Permission

lb_hk_charging.lb_hk_billingpackage_update

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

Request body application/json

namestringrequired

This field is required.

org_idnumber

Org ID associated with this request. Optional.

feesarray<object>required

Fee items; each is an object (fields below).

Child attributes
billing_item_idstringrequired

Billing item (fee scenario) ID.

currencystringrequired

Currency code, e.g. HKD.

maxstring

Fee cap (numeric string).

minstring

Fee floor (numeric string).

thresholdstring

Threshold (numeric string).

calculation_methodinteger

Calculation method code.

fee_rate_typeinteger

Fee rate type code.

metric_typeinteger

Metering method code.

metric_cycle_typeinteger

Metering cycle type code.

granularityinteger

Metering granularity code.

cutoff_methodinteger

Rounding (cut-off) method code.

cutoff_digitsinteger

Number of digits kept when cutting off.

max_metric_typeinteger

Cap metering method code; 0 means no cap.

max_metric_ratestring

Cap rate.

min_metric_typeinteger

Floor metering method code; 0 means no floor.

min_metric_ratestring

Floor rate.

metric_type_bill_amount_item_idsarray<string>

Secondary billing item IDs.

special_feesarray<object>

Custom fee list; pass an empty array when none.

ratesarray<object>required

Rate bands, at least one; missing or invalid bands return Abnormal rate range configuration.

Child attributes
gtstring

Lower bound of the band (exclusive).

ltestring

Upper bound of the band (inclusive); 0 means no upper bound.

fee_ratestring

Fee rate for the band.

minstring

Minimum fee for the band.

org_package_typestringrequired

Organization/package type. Options come from a backend data dictionary.

market_rule_idsarray<string>

Array of associated market-rule IDs. Options come from a backend data dictionary.

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