Update Bank Rule
PATCH /banking/bank-rules/{id}
Group: Banking › Bank Rules · Operation ID: updateBankRule
Update a bank rule, addressed by the :id path segment. Header fields patch; criteria, bankAccountIds and actionObject replace the whole stored collection when present. Returns an empty response. Every request must carry the Api-Version header.
Updates one bank rule, addressed by the id in the path. The response is empty; read the record back with GET banking/bank-rules/{id} to see its stored state.
Header fields patch; collections replace. An omitted rule, action, status, priority or description is left unchanged. But criteria, bankAccountIds and actionObject are whole-collection replacements when present — the underlying handler deletes and recreates them, so a criterion left out of the array is deleted. Omit the array entirely to keep what is stored.
Deactivate a rule with {"status": "inactive"} rather than deleting it; that keeps its history and stops it being run.
The same guards as create apply to whatever the patch carries: account/entity consistency, action/account agreement, criterion well-formedness and name uniqueness. All run before the first write, so a rejected request changes nothing.
Open in the interactive reference
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
Api-Version |
header | "v1" |
yes | The API version this request targets, named by its public identifier. Required on every request; omitting it, or naming a version this company does not have, is answered with 400. This document describes version v1. |
Idempotency-Key |
header | string | no | An opaque caller-chosen string (1-255 characters) that makes this request safe to retry. Repeating the same key with an identical request body replays the original response instead of re-executing - but only once that original request succeeded; a failed attempt re-executes on retry. Repeating the key with a different body is answered with 422. A key still in flight is answered with 409 - as is a key whose original request was interrupted before it finished, for a few minutes afterwards, until that attempt is presumed dead. A completed response stays replayable for 24 hours. The key is scoped to the caller, not to the action: reusing it for a different action is answered with 409 or 422 rather than treated independently. On read actions this header is ignored. On write actions that cannot offer the guarantee it is answered with 400 IDEMPOTENCY_NOT_SUPPORTED rather than silently ignored. |
id |
path | string | yes | Id of the bank rule to update (a UUID); bound from the :id path segment. |
Request body
Required, application/json: updateBankRuleInput.
| Field | Type | Required | Description |
|---|---|---|---|
rule |
string | no | New name for the rule. Must stay unique across the tenant. Omit to leave unchanged. |
action |
string, one of "createBankEntry", "createCreditCardEntry" |
no | New action. Only these two are implemented. Omit to leave unchanged. |
status |
string, one of "active", "inactive" |
no | New status. Set 'inactive' to retire a rule rather than deleting it. Omit to leave unchanged. |
priority |
number | no | New evaluation order; lower runs first. Omit to leave unchanged. |
description |
string | no | New free-text note. Omit to leave unchanged. |
bankAccountIds |
array of string | no | [fk: BankAccountApi.bankAccounts.id] REPLACES the whole set of watched bank accounts when present. At least one id, all belonging to one legal entity and consistently credit card or not. Omit to keep the stored set. |
criteria |
array of object | no | REPLACES the whole set of criteria when present — a criterion left out of this array is deleted. At least one is required when the array is given. Omit to keep the stored set. |
criteria[].criteria |
string, one of "amount", "description", "payeePayor" |
yes | Which field of the transaction is tested. |
criteria[].operator |
string | yes | How the field is compared. Numeric operators apply only to 'amount'; text operators only to 'description' and 'payeePayor'. |
criteria[].logicalOperator |
string, one of "and", "or" |
no | How this criterion joins the next. |
criteria[].value |
string | yes | The value compared against. Must parse as a number when criteria is 'amount'. |
actionObject |
object | no | REPLACES the stored action object when present. Omit to keep it unchanged. |
actionObject.accountId |
string | no | [fk: AccountApi.accounts.id] Account the created entry line books to, given as its id (a UUID). |
actionObject.name |
string | no | Name stamped on the created entry. |
actionObject.description |
string | no | Description stamped on the created entry and its line. |
actionObject.billableExpense |
string, one of "yes", "no" |
no | Whether the created credit card entry line is a billable expense. |
actionObject.businessUnitId |
string | no | [fk: BusinessUnitApi.businessUnits.id] Business unit stamped on the created line, given as its id (a UUID). |
actionObject.departmentId |
string | no | [fk: DepartmentApi.departments.id] Department stamped on the created line, given as its id (a UUID). |
actionObject.customerId |
string | no | [fk: CustomerApi.customers.id] Customer stamped on the created line, given as its id (a UUID). |
actionObject.vendorId |
string | no | [fk: VendorApi.vendors.id] Vendor stamped on the created line, given as its id (a UUID). |
actionObject.intercompanyPartnerId |
string | no | [fk: BusinessPartnerApi.businessPartners.id] Intercompany partner, given as its id (a UUID). |
actionObject.valueAllocationTags |
array of string | no | Value-allocation tag codes stamped on the created line. |
Example:
{
"rule": "<rule>",
"action": "createBankEntry",
"status": "inactive",
"priority": 20,
"description": "<description>",
"bankAccountIds": [
"<bankAccountIds>"
],
"criteria": [
{
"criteria": "amount",
"operator": "<operator>",
"logicalOperator": "and",
"value": "<value>"
}
],
"actionObject": {
"accountId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"name": "<name>",
"description": "<description>",
"billableExpense": "yes",
"businessUnitId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"departmentId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"customerId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"vendorId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"intercompanyPartnerId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"valueAllocationTags": [
"<valueAllocationTags>"
]
}
}
Response
200 Success
Response headers
Idempotency-Replayed— Present andtrueonly when this response replays a previously stored one for the same Idempotency-Key, rather than reflecting a live execution. Absent on a live response - never sent asfalse.
Errors
| Code | Status |
|---|---|
NOT_FOUND |
400 |
REFERENCE_NOT_FOUND |
400 |
ACCOUNTS_REQUIRED |
400 |
CRITERIA_REQUIRED |
400 |
ACCOUNTS_SPAN_ENTITIES |
400 |
MIXED_ACCOUNT_TYPES |
400 |
ACTION_ACCOUNT_TYPE_MISMATCH |
400 |
RULE_ACTION_NOT_SUPPORTED |
400 |
DUPLICATE_RULE_NAME |
400 |
INVALID_CRITERIA |
400 |
ACCOUNT_NOT_POSTABLE |
400 |
IDEMPOTENCY_KEY_CONFLICT |
409 |
IDEMPOTENCY_PAYLOAD_MISMATCH |
422 |
Statuses
400— Invalid request or business failure. Codes: NOT_FOUND, REFERENCE_NOT_FOUND, ACCOUNTS_REQUIRED, CRITERIA_REQUIRED, ACCOUNTS_SPAN_ENTITIES, MIXED_ACCOUNT_TYPES, ACTION_ACCOUNT_TYPE_MISMATCH, RULE_ACTION_NOT_SUPPORTED, DUPLICATE_RULE_NAME, INVALID_CRITERIA, ACCOUNT_NOT_POSTABLE401— Missing or invalid access token403— Not authorized404— Not found409— The Idempotency-Key is still being processed by another request.422— The Idempotency-Key was already used with a different request payload.429— Too many requests500— Internal server error