v1

latestOpenAPI 3.0.02026-07-2422987517.5 KB
Transaction rule

Create a transaction rule

Creates a transaction rule. Requires the transactions_rules_manage permission. The company_id and user_id are taken from the authenticated context and company-id header.

post/v1/transaction/rules

Headers

company-idstring uuid required

UUID of the company on whose behalf the request is made. Required for every Accounting endpoint. See The company-id header for details on how to obtain a value for this header and the error responses to expect when it is missing or invalid.

Request body

namestring required
enabledboolean
hiddenboolean
constraintsobject

Match expression evaluated against transactions.

Example request

{
  "name": "Categorizar AWS como Infraestructura",
  "constraints": {
    "$or": [
      {
        "merchant_id": "8e668a4e-8485-4248-86cc-a7a2201cf8c3"
      }
    ]
  }
}

Response

Rule created

idstring uuid required
company_idstring uuid required
user_idstring

The user who created the rule.

namestring required
constraintsobject

Match expression evaluated against transactions (MongoDB-style operators, e.g. $or with per-merchant clauses).

enabledboolean
hiddenboolean
created_atstring date-time
updated_atstring date-time

Example response

{
  "id": "a1b2c3d4-e5f6-4a5b-8c9d-0e1f2a3b4c5d",
  "company_id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "Categorizar AWS como Infraestructura",
  "constraints": {
    "$or": [
      {
        "merchant_id": "8e668a4e-8485-4248-86cc-a7a2201cf8c3"
      }
    ]
  },
  "enabled": true,
  "custom_column_change_effects": [
    {
      "type": "Transaction::CustomColumnChangeEffect"
    }
  ]
}