SolariumSolariumDocs
Browse The Docs

Docs/Guides/Category Rules

POST

Create a Category Rule

Create an auto-categorization rule. The vendorPattern is matched case-insensitively against merchant names. Use SQL ILIKE patterns (% for wildcard).

Parameters

organizationIdUUID!required

Organization ID

vendorPatternString!required

ILIKE pattern to match vendor names (e.g. "%SHOPIFY%", "%CANADA POST%")

categoryIdUUID!required

Account ID to auto-assign when pattern matches

Request
mutation {
  createCategoryRule(
    organizationId: "a1b2c3d4-..."
    vendorPattern: "%PETRO-CANADA%"
    categoryId: "vehicle-expense-uuid"
  ) {
    categoryRule {
      id
      vendorPattern
      account { id name }
    }
    success
    error
  }
}
Response
{
  "data": {
    "createCategoryRule": {
      "categoryRule": {
        "id": "r9a8b7c6-...",
        "vendorPattern": "%PETRO-CANADA%",
        "account": {
          "id": "vehicle-expense-uuid",
          "name": "Vehicle Expenses"
        }
      },
      "success": true,
      "error": null
    }
  }
}