> ## Documentation Index
> Fetch the complete documentation index at: https://developer.tryfinch.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Rules

> List all rules of a connection account.



## OpenAPI

````yaml get /employer/pay-statement-item/rule
openapi: 3.1.0
info:
  title: API Reference
  version: '2020-09-17'
  contact: {}
  description: >-
    The Finch HRIS API provides a unified way to connect to a multitide of HRIS
    systems. The API requires an access token issued by Finch.


    By default, Organization and Payroll requests use Finch's [Data
    Syncs](/developer-resources/Data-Syncs). If a request is made before the
    initial sync has completed, Finch will request data live from the provider.
    The latency on live requests may range from seconds to minutes depending on
    the provider and batch size.

    For automated integrations, Deductions requests (both read and write) are
    always made live to the provider. Latencies may range from seconds to
    minutes depending on the provider and batch size.



    Employer products are specified by the product parameter, a space-separated
    list of products that your application requests from an employer
    authenticating through Finch Connect. Valid product names are—

    - `company`: Read basic company data


    - `directory`: Read company directory and organization structure


    - `individual`: Read individual data, excluding income and employment data


    - `employment`: Read individual employment and income data


    - `payment`: Read payroll and contractor related payments by the company


    - `pay_statement`: Read detailed pay statements for each individual


    - `benefits`: Create and manage deductions and contributions and enrollment
    for an employer


    [![Open in
    Postman](https://run.pstmn.io/button.svg)](https://god.gw.postman.com/run-collection/21027137-08db0929-883d-4094-a9ce-dbf5a9bee4a4?action=collection%2Ffork&collection-url=entityId%3D21027137-08db0929-883d-4094-a9ce-dbf5a9bee4a4%26entityType%3Dcollection%26workspaceId%3D1edf19bc-e0a8-41e9-ac55-481a4b50790b)
servers:
  - url: https://api.tryfinch.com
    description: ''
security: []
tags:
  - name: Organization
  - name: Payroll
  - name: Deductions
  - name: Management
  - name: Sandbox
paths:
  /employer/pay-statement-item/rule:
    get:
      tags:
        - Payroll
      summary: Get Rules
      description: List all rules of a connection account.
      operationId: get-rules
      parameters:
        - name: entity_ids
          in: query
          required: false
          description: The entity IDs to retrieve rules for.
          schema:
            type: array
            items:
              type: string
              format: uuid
            minItems: 1
            maxItems: 1
            example:
              - 550e8400-e29b-41d4-a716-446655440000
          style: form
          explode: true
        - $ref: '#/components/parameters/API-Version'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetRulesResponse'
              examples:
                Success:
                  value:
                    - id: 5d0b10a1-a09a-430f-81f1-20be735dc5e9
                      priority: 1
                      effective_start_date: '2025-01-01'
                      effective_end_date: '2025-12-31'
                      conditions:
                        - field: name
                          operator: equals
                          value: Salary
                      attributes:
                        metadata:
                          myLabel: My Value
                      entity_type: pay_statement_item
                      created_at: '2025-01-01T10:00:00Z'
                      updated_at: '2025-01-01T10:00:00Z'
                    - id: e8b90071-0c11-471c-86e8-e303ef2f6782
                      priority: 1
                      conditions:
                        - field: name
                          operator: equals
                          value: Medical Insurance
                      attributes:
                        metadata:
                          myLabel2: My Value 2
                      entity_type: pay_statement_item
                      created_at: '2025-01-10T10:00:00Z'
                      updated_at: '2025-02-05T08:45:00Z'
      security:
        - bearerAuth: []
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Finch from '@tryfinch/finch-api';


            const client = new Finch({
              accessToken: 'My Access Token',
            });


            // Automatically fetches more pages as needed.

            for await (const ruleListResponse of
            client.hris.company.payStatementItem.rules.list()) {
              console.log(ruleListResponse.id);
            }
        - lang: Python
          source: |-
            from finch import Finch

            client = Finch(
                access_token="My Access Token",
            )
            page = client.hris.company.pay_statement_item.rules.list()
            page = page.responses[0]
            print(page.id)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/Finch-API/finch-api-go\"\n\t\"github.com/Finch-API/finch-api-go/option\"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken(\"My Access Token\"),\n\t)\n\tpage, err := client.HRIS.Company.PayStatementItem.Rules.List(context.TODO(), finchgo.HRISCompanyPayStatementItemRuleListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", page)\n}\n"
        - lang: Java
          source: >-
            package com.tryfinch.api.example;


            import com.tryfinch.api.client.FinchClient;

            import com.tryfinch.api.client.okhttp.FinchOkHttpClient;

            import
            com.tryfinch.api.models.HrisCompanyPayStatementItemRuleListPage;

            import
            com.tryfinch.api.models.HrisCompanyPayStatementItemRuleListParams;


            public final class Main {
                private Main() {}

                public static void main(String[] args) {
                    FinchClient client = FinchOkHttpClient.builder()
                        .fromEnv()
                        .accessToken("My Access Token")
                        .build();

                    HrisCompanyPayStatementItemRuleListPage page = client.hris().company().payStatementItem().rules().list();
                }
            }
        - lang: Kotlin
          source: >-
            package com.tryfinch.api.example


            import com.tryfinch.api.client.FinchClient

            import com.tryfinch.api.client.okhttp.FinchOkHttpClient

            import
            com.tryfinch.api.models.HrisCompanyPayStatementItemRuleListPage

            import
            com.tryfinch.api.models.HrisCompanyPayStatementItemRuleListParams


            fun main() {
                val client: FinchClient = FinchOkHttpClient.builder()
                    .fromEnv()
                    .accessToken("My Access Token")
                    .build()

                val page: HrisCompanyPayStatementItemRuleListPage = client.hris().company().payStatementItem().rules().list()
            }
        - lang: Ruby
          source: |-
            require "finch_api"

            finch = FinchAPI::Client.new(access_token: "My Access Token")

            page = finch.hris.company.pay_statement_item.rules.list

            puts(page)
components:
  parameters:
    API-Version:
      name: Finch-API-Version
      in: header
      required: true
      schema:
        type: string
        default: '2020-09-17'
        format: date
        pattern: ([12]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01]))
      description: >-
        Header used to specify the version for a given API request. Current
        version is 2020-09-17.
  schemas:
    GetRulesResponse:
      type: object
      properties:
        responses:
          type: array
          items:
            $ref: '#/components/schemas/CreateRuleResponse'
    CreateRuleResponse:
      allOf:
        - type: object
          properties:
            id:
              type: string
              description: Finch id (uuidv4) for the rule.
              pattern: '[0-9a-f]{8}[-]?(?:[0-9a-f]{4}[-]?){3}[0-9a-f]{12}'
            priority:
              type: integer
              description: The priority of the rule.
            created_at:
              type: string
              format: date-time
              description: The datetime when the rule was created.
            updated_at:
              type: string
              format: date-time
              description: The datetime when the rule was last updated.
        - $ref: '#/components/schemas/CreateRuleRequest'
    CreateRuleRequest:
      type: object
      properties:
        effective_start_date:
          $ref: '#/components/schemas/Date'
          description: Specifies when the rule should begin applying based on the date.
        effective_end_date:
          $ref: '#/components/schemas/Date'
          description: >-
            Specifies when the rules should stop applying rules based on the
            date.
        conditions:
          type: array
          items:
            type: object
            properties:
              field:
                type: string
                description: The field to be checked in the rule.
              operator:
                type: string
                description: The operator to be used in the rule.
                enum:
                  - equals
              value:
                type: string
                description: The value of the field to be checked in the rule.
        attributes:
          type: object
          description: Specifies the fields to be applied when the condition is met.
          properties:
            metadata:
              type: object
              description: >-
                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.).
              additionalProperties: true
        entity_type:
          type: string
          description: The entity type to which the rule is applied.
          enum:
            - pay_statement_item
    Date:
      type: string
      title: Date
      nullable: true
      pattern: (\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01]))
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Please use your Access Token

````