---
title: "Create Rule"
method: POST
path: "/employer/pay-statement-item/rule"
tags: ["Payroll"]
---

# Create Rule

`POST /employer/pay-statement-item/rule`

Custom rules can be created to associate specific attributes to pay statement items depending on the use case. For example, pay statement items that meet certain conditions can be labeled as a pre-tax 401k. This metadata can be retrieved where pay statement item information is available.

## Query parameters

- `entity_ids` string[]

## Headers

- `Finch-API-Version` string, date, required
- `Content-Type` string, required

## Request body

- CreateRuleRequest
  - `effective_start_date` string, nullable
  - `effective_end_date` string, nullable
  - `conditions` object[]
    - `field` string — The field to be checked in the rule.
    - `operator` 'equals' — The operator to be used in the rule.
    - `value` string — The value of the field to be checked in the rule.
  - `attributes` object — Specifies the fields to be applied when the condition is met.
    - `metadata` object — The metadata to be attached in the entity. It is a key-value pairs where the values can be of any type (string, number, boolean, object, array, etc.).
  - `entity_type` 'pay_statement_item' — The entity type to which the rule is applied.

## Response `201`

Successfully Created

- CreateRuleResponse
  - `id` string — Finch id (uuidv4) for the rule.
  - `priority` integer — The priority of the rule.
  - `created_at` string, date-time — The datetime when the rule was created.
  - `updated_at` string, date-time — The datetime when the rule was last updated.
  - `effective_start_date` string, nullable
  - `effective_end_date` string, nullable
  - `conditions` object[]
    - `field` string — The field to be checked in the rule.
    - `operator` 'equals' — The operator to be used in the rule.
    - `value` string — The value of the field to be checked in the rule.
  - `attributes` object — Specifies the fields to be applied when the condition is met.
    - `metadata` object — The metadata to be attached in the entity. It is a key-value pairs where the values can be of any type (string, number, boolean, object, array, etc.).
  - `entity_type` 'pay_statement_item' — The entity type to which the rule is applied.

## Other responses

- `400` — Malformed Request

## Changes

> 53 revisions in range; 1 could not be searched.

- **2025-10-27** `0105d239fcaf` — 1 info
  - added the new optional `query` request parameter `entity_ids`
- **2025-04-22** `46640c1b4688` — 1 info
  - the endpoint scheme security `bearerAuth` was added to the API
- **2025-02-26** `57fcc886b059` — 2 warning, 1 info
  - removed the request property `priority`
  - removed the optional property `allOf[#/components/schemas/CreateRuleRequest]/priority` from the response with the `201` status
  - added the optional property `allOf[subschema #1]/priority` to the response with the `201` status
- **2025-02-19** `8c0cecb28682` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/finch-api/apis/api-reference/changes/employer/pay-statement-item/rule/post.md)

---

[API](https://skmtc.dev/finch-api/apis/api-reference.md) · [All operations](https://skmtc.dev/finch-api/apis/api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/finch-api/api-reference/revisions/f1cca2cb0ef2/schema)
