Skip to content
Accounting Merge Rule

Edit Account Merge Rule

Creates or edits an accounting entry merge rule; add and edit reuse the same endpoint.

Request parameters

  • Required: id (rule ID; '0' to create, or the real ID to edit), business_name, original_currency, convert_currency, account_merge_rule_infos (merge-mode configuration list).
  • Optional: payee_booking_types (credit/receipt business types), payment_booking_types (debit/payment business types), audit_frontend_resource (audit context).
  • Candidate values for original_currency and convert_currency vary by business; call GET /v1/datasets/refs/tenant_currencies_by_channel to obtain the currently available values.
  • See the field definitions for format, value ranges, defaults, and business meaning.

Risk warning

This operation changes a real entry merge rule and affects entry merging and accounting aggregation results. Confirm the target record and parameters before calling.

Result

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

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

Authorization

AuthorizationstringheaderRequired

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

Permission

book.account_merge_rule_edit

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

Request body application/json

idstringrequired

Send '0' on create; send the real id on edit.

business_namestringrequired

This field is required.

original_currencystringrequired

Values come from the tenant_currencies_by_channel dynamic enumeration and are not fixed.

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.

convert_currencystringrequired

Values come from the tenant_currencies_by_channel dynamic enumeration and are not fixed.

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.

payee_booking_typesarray<string>

Element structure {source_id: string, booking_type_id: string}; the client expands multiple booking_type_id values under the same source_id into multiple rows; submitted only when the "credit account" toggle is checked.

payment_booking_typesarray<string>

Element structure {source_id: string, booking_type_id: string}; submitted only when the "Debit account" toggle is checked.

account_merge_rule_infosarray<string>required

Each element's structure: debit_subject_codes (string, comma-joined account codes or ALL); credit_subject_codes (string, same as above); loan_consolidation_type (enum: respective = merge debit and credit separately / reduction = net debit against credit); debit_merge_rule (enum 0-5: 0 = summarize by account / 1 = show details / 2 = summarize by account and memo / 3 = summarize by account and broker / 4 = total debit minus total credit / 5 = total credit minus total debit); debit_name (string, custom name); credit_merge_rule (same enum as debit_merge_rule); credit_name (string).

Values
respective
Credit consolidation
reduction
Consolidation of loan deductions
audit_frontend_resourceobject

Used only for audit-log diff display (the pre-edit record snapshot); not a business field and usually ignored by the backend.

Responses

HTTP 200The request was processed successfully. The response data does not contain additional business fields.
Standard response envelopecodemessagedata
dataobjectdata structure
idstring
idsarray<object>
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