Skip to content
Entry Rules

Create Or Modify Account Entries

Creates or edits an accounting entry rule, configuring a mapping from a business event to its debit/credit entries.

Request parameters

  • Required: id (entry rule ID; 0 to add, or the original/copy-source ID to edit), source_id (data source), name_types (entry-summary config), debit_feature (debit subject attribute), debit_subject_code (debit leaf-level subject code), debit_amount_type (debit amount type), credit_feature (credit subject attribute), credit_subject_code (credit leaf-level subject code), credit_amount_type (credit amount type).
  • Optional: payer/payee account and business types, channel, currency, org_id, trade_direction, nature_type, remark, debit/credit broker-display flags, audit_frontend_resource, and more; see the field definitions.
  • Candidate values for source_id, debit_feature, and credit_feature vary by business; use refs such as GET /v1/datasets/refs/book_entry_data_source to obtain the currently available values.
  • See the field definitions for format, value ranges, and business meaning.

Business notes

A non-0 id means edit; 0 means add. The debit and credit amount types are kept consistent.

Risk warning

This operation changes a real accounting entry rule and directly affects the accounting system's automatic bookkeeping results. Confirm the target record and parameters before calling.

Result

On success the accounting entry rule is created or updated. Refer to the 200 response definition for returned data.

POSThttps://b-api.lbkrs.com/book/create_or_modify_account_entries_v2

Authorization

AuthorizationstringheaderRequired

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

Permission

lb_hk_book.book_entries_edit

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

Request body application/json

idstringrequired

Pass 0 when adding; when editing, pass the original record id or the copy-source id.

source_idintegerrequired

The entry data source; values come from the book_entry_data_source dynamic enum; converted to a number before submission; determines the visibility and required status of subsequent subfields such as payer/payee.

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

payerboolean

A toggle controlling whether the payment_* series of fields are displayed/submitted; mutually exclusive with payee (only one of the two can be enabled, unless the data source allows both).

payment_account_type_idstring

The values come from the book_entry_account_types dynamic enum (which changes in tandem with source_id); whether it is required is determined by the data-source configuration.

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

payment_booking_type_idstring

Values come from the book_business_types_by_source dynamic enum (cascading with source_id); required under most data sources.

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

payment_channel_accountstring

Takes the aaid/origin_id after selecting from the member search.

payment_business_groupstring

Values come from the book_business_groups dynamic enum.

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

payee_account_type_idstring

Value comes from the book_entry_account_types dynamic enum (linked to source_id).

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

payee_booking_type_idstring

Value comes from the book_business_types_by_source dynamic enum (linked to source_id).

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

payee_channel_accountstring

Takes the aaid/origin_id after selecting from the member search.

channelstring

Text input; required for some data sources.

user_account_typeinteger

User account type. Converted to a number before submission.

Allowed values: 0 No match, 1 Cash, 2 Margin, 3 House

Values
0
Not Match
1
Cash
2
Margin
3
House
currencyarray<string>

Multi-select; elements are strings, with values from the tenant_currencies_by_channel dynamic enum.

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.

org_idinteger

Value comes from the book_brokers dynamic enum; converted to a number before submission.

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

trade_directionstring

Trade direction.

Values
SELL
SELL
BUY
BUY
nature_typestring

Nature type. Applies only when the data source is a bank.

Values
client
Client
house
House
bank_accountstring

The values come from the book_entry_bank_accounts dynamic enum; only displayed when the data source is a bank.

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

remarkstring

A text area, up to 100 characters.

amount_plus_or_minusstring

Whether the amount is positive or negative.

Values
PLUS
Positive amount
MINUS
Negative amount
name_typesarray<object>required

Journal-entry summary rules. The Admin console drops items whose name_type is 0 or whose value is empty.

Child attributes
name_typestringrequired

Summary part type.

Allowed values: 1 Fixed text, 2 Referenced field

Values
1
Fixed text
2
Referenced field
namestring

Fixed text. Used when name_type is 1.

name_field_typestring

Referenced field type. Used when name_type is 2; use a summary-field type available for the selected data source.

debit_featurestringrequired

The values come from the book_account_features dynamic enum (with an additional "All" option).

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

debit_subject_codestringrequired

Debit account, selected from a tree; before submission the leaf-level account code of the selected path is taken.

debit_amount_typestringrequired

Debit amount type. Selecting a value synchronizes the credit amount type accordingly.

Values
AMOUNT_ABS
The absolute value of the bill
AMOUNT_NEG
The opposite of the bill amount
AMOUNT_ORIGIN
Original bill amount
debit_display_brokerstring

Single-select with values yes/no; whether it is required is determined by the data source configuration; defaults to no.

Values
yes
Yes
no
No
credit_featurestringrequired

The values come from the book_account_features dynamic enum (with an additional "All" option).

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

credit_subject_codestringrequired

Credit account, selected from a tree; before submission the leaf-level account code of the selected path is taken.

credit_amount_typestringrequired

Credit amount type. Read-only and kept consistent with the debit amount type.

Values
AMOUNT_ABS
The absolute value of the bill
AMOUNT_NEG
The opposite of the bill amount
AMOUNT_ORIGIN
Original bill amount
credit_display_brokerstring

Single-select; value yes/no. Whether it is required reuses the judgment of the debit's displayed broker.

Values
yes
Show
no
Not Show
audit_frontend_resourceobject

An audit-trail field, not a business parameter; on add it marks the add action ($action=add), and on edit it carries the complete pre-edit input values and marks the edit action ($action=edit).

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