# Creates a new bookkeeping rule for the specified client. The rule defines how transactions are processed and mapped to generate vouchers based on the client's requirements. Endpoint: POST /api/v1/clients/{clientId}/bookkeeping/transaction-rules Version: 1 Security: , , , ## Path parameters: - `clientId` (string, required) ## Request fields (application/json): - `displayName` (string) Sets the display name for the bookkeeping rule. - `bookkeepingSettingId` (string) Specifies the ID of the settings to link to. If no settings exist, create them before proceeding. - `autoUpdate` (boolean) Sets if the voucher is automatically updated in the erp-system. - `isFeeRule` (boolean) True if the rule is a fee rule, false otherwise. - `minOptionalMatches` (integer) Gets or sets the minimum number of filters that must match for the bookkeeping rule to apply. This property works in combination with the 'at least FilterCriteria' logic to determine applicability. - `transactionPostingMode` (string) Enum: "CombineIntoSingleVoucher", "PostAsSeparateVouchers", "MultiLinedVoucher", "MultiLinedVoucherWithUnmatched" - `filters` (array) Gets or sets the collection of filters applied to the bookkeeping rule. These filters are used to determine the conditions under which the rule is applied. - `filters.field` (string) Enum: "Amount", "Currency", "ReferenceNumber", "ArchiveReference", "Description", "InvoiceNumber", "StructuredReference", "AdditionalText", "DebtorAddress", "BookedAmount", "AccountCurrency", "ChargeCurrency", "ChargeAmount", "BankTransactionCode", "AccountNumber", "DebtorAccountNumber", "DebtorName", "BankInformation" - `filters.operation` (string) Enum: "ExactText", "ContainsText", "StartsWithText", "EndsWithText", "ExactAmount", "FromZeroToAmount", "BelowAmount", "AboveAmount" - `filters.importance` (string) Enum: "Required", "Optional" - `filters.value` (string, required) Gets or sets the value used in the filtering operation. Example: "\n For example, if the filter is \"Field = AccountNumber, Operation = Equals, Value = '1234',\" \n the filter will match all records where the AccountNumber is '1234'.\n " - `fieldMappings` (array) Defines a set of dynamic mappings that extract values from transaction fields and apply them to batch line fields. - `fieldMappings.targetField` (string) Enum: "InvoiceNumber", "Description" - `fieldMappings.value` (string) - `units` (array) Gets or sets the collection of units associated with the bookkeeping rule. - `units.unitOptionValueId` (string, required) Gets or sets the option value associated with the unit. - `units.unitValueId` (string, required) Gets or sets the unit value associated with the unit. ## Response 200 fields (application/json): - `links` (object) - `clientId` (string) - `ruleId` (string) ## Response 403 fields (application/json): - `type` (string,null) - `title` (string,null) - `status` (integer,null) - `detail` (string,null) - `instance` (string,null) ## Response 404 fields (application/json): - `type` (string,null) - `title` (string,null) - `status` (integer,null) - `detail` (string,null) - `instance` (string,null)