Skip to content
Accounting Merge Rule

Edit Account Merge Rule

Configures an accounting-entry merge rule. Pass id as 0 when creating a rule and the actual id when editing; both operations use this endpoint.

Request parameters

  • Required: id (Rule ID), business_name (Business Name), original_currency (Original Currency), convert_currency (Convert Currency), account_merge_rule_infos (Account Merge Rule Info List)
  • Optional: payee_booking_types (Payee Booking Types), payment_booking_types (Payment Booking Types), audit_frontend_resource (Audit Context)
  • 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/book/edit_account_merge_rule_v2

Authorization

AuthorizationstringheaderRequired

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

Request body application/json

idstringrequired

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

business_namestringrequired

Specifies Business Name. 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).

respective · Credit consolidationreduction · 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

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