import Finch from '@tryfinch/finch-api';
const client = new Finch({
accessToken: 'My Access Token',
});
const rule = await client.hris.payStatementItem.rules.create();
console.log(rule.id);from finch import Finch
client = Finch(
access_token="My Access Token",
)
rule = client.hris.pay_statement_item.rules.create()
print(rule.id)package main
import (
"context"
"fmt"
"github.com/Finch-API/finch-api-go"
"github.com/Finch-API/finch-api-go/option"
)
func main() {
client := finchgo.NewClient(
option.WithAccessToken("My Access Token"),
)
rule, err := client.HRIS.PayStatementItem.Rules.New(context.TODO(), finchgo.HRISPayStatementItemRuleNewParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", rule.ID)
}
package com.tryfinch.api.example;
import com.tryfinch.api.client.FinchClient;
import com.tryfinch.api.client.okhttp.FinchOkHttpClient;
import com.tryfinch.api.models.HrisPayStatementItemRuleCreateParams;
import com.tryfinch.api.models.RuleCreateResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
FinchClient client = FinchOkHttpClient.builder()
.fromEnv()
.accessToken("My Access Token")
.build();
RuleCreateResponse rule = client.hris().payStatementItem().rules().create();
}
}package com.tryfinch.api.example
import com.tryfinch.api.client.FinchClient
import com.tryfinch.api.client.okhttp.FinchOkHttpClient
import com.tryfinch.api.models.HrisPayStatementItemRuleCreateParams
import com.tryfinch.api.models.RuleCreateResponse
fun main() {
val client: FinchClient = FinchOkHttpClient.builder()
.fromEnv()
.accessToken("My Access Token")
.build()
val rule: RuleCreateResponse = client.hris().payStatementItem().rules().create()
}require "finch_api"
finch = FinchAPI::Client.new(access_token: "My Access Token")
rule = finch.hris.pay_statement_item.rules.create
puts(rule)curl --request POST \
--url https://api.tryfinch.com/employer/pay-statement-item/rule \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: <content-type>' \
--header 'Finch-API-Version: <finch-api-version>' \
--data '
{
"effective_start_date": "<string>",
"effective_end_date": "<string>",
"conditions": [
{
"field": "<string>",
"operator": "equals",
"value": "<string>"
}
],
"attributes": {
"metadata": {}
},
"entity_type": "pay_statement_item"
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tryfinch.com/employer/pay-statement-item/rule",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'effective_start_date' => '<string>',
'effective_end_date' => '<string>',
'conditions' => [
[
'field' => '<string>',
'operator' => 'equals',
'value' => '<string>'
]
],
'attributes' => [
'metadata' => [
]
],
'entity_type' => 'pay_statement_item'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: <content-type>",
"Finch-API-Version: <finch-api-version>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"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"
}{
"code": 400,
"name": "invalid_request_error",
"finch_code": "invalid_request",
"message": "Validation error: Array must contain at least 1 element(s) at \"conditions\""
}Create 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.
import Finch from '@tryfinch/finch-api';
const client = new Finch({
accessToken: 'My Access Token',
});
const rule = await client.hris.payStatementItem.rules.create();
console.log(rule.id);from finch import Finch
client = Finch(
access_token="My Access Token",
)
rule = client.hris.pay_statement_item.rules.create()
print(rule.id)package main
import (
"context"
"fmt"
"github.com/Finch-API/finch-api-go"
"github.com/Finch-API/finch-api-go/option"
)
func main() {
client := finchgo.NewClient(
option.WithAccessToken("My Access Token"),
)
rule, err := client.HRIS.PayStatementItem.Rules.New(context.TODO(), finchgo.HRISPayStatementItemRuleNewParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", rule.ID)
}
package com.tryfinch.api.example;
import com.tryfinch.api.client.FinchClient;
import com.tryfinch.api.client.okhttp.FinchOkHttpClient;
import com.tryfinch.api.models.HrisPayStatementItemRuleCreateParams;
import com.tryfinch.api.models.RuleCreateResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
FinchClient client = FinchOkHttpClient.builder()
.fromEnv()
.accessToken("My Access Token")
.build();
RuleCreateResponse rule = client.hris().payStatementItem().rules().create();
}
}package com.tryfinch.api.example
import com.tryfinch.api.client.FinchClient
import com.tryfinch.api.client.okhttp.FinchOkHttpClient
import com.tryfinch.api.models.HrisPayStatementItemRuleCreateParams
import com.tryfinch.api.models.RuleCreateResponse
fun main() {
val client: FinchClient = FinchOkHttpClient.builder()
.fromEnv()
.accessToken("My Access Token")
.build()
val rule: RuleCreateResponse = client.hris().payStatementItem().rules().create()
}require "finch_api"
finch = FinchAPI::Client.new(access_token: "My Access Token")
rule = finch.hris.pay_statement_item.rules.create
puts(rule)curl --request POST \
--url https://api.tryfinch.com/employer/pay-statement-item/rule \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: <content-type>' \
--header 'Finch-API-Version: <finch-api-version>' \
--data '
{
"effective_start_date": "<string>",
"effective_end_date": "<string>",
"conditions": [
{
"field": "<string>",
"operator": "equals",
"value": "<string>"
}
],
"attributes": {
"metadata": {}
},
"entity_type": "pay_statement_item"
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tryfinch.com/employer/pay-statement-item/rule",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'effective_start_date' => '<string>',
'effective_end_date' => '<string>',
'conditions' => [
[
'field' => '<string>',
'operator' => 'equals',
'value' => '<string>'
]
],
'attributes' => [
'metadata' => [
]
],
'entity_type' => 'pay_statement_item'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: <content-type>",
"Finch-API-Version: <finch-api-version>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"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"
}{
"code": 400,
"name": "invalid_request_error",
"finch_code": "invalid_request",
"message": "Validation error: Array must contain at least 1 element(s) at \"conditions\""
}Authorizations
Please use your Access Token
Headers
Header used to specify the version for a given API request. Current version is 2020-09-17.
([12]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01]))Used to indicate the original media type of the resource
Query Parameters
The entity IDs to create the rule for. Provide exactly one entity ID per request; a maximum of one is accepted.
1 element["550e8400-e29b-41d4-a716-446655440000"]
Body
Specifies when the rule should begin applying based on the date.
(\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01]))Specifies when the rules should stop applying rules based on the date.
(\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01]))Show child attributes
Show child attributes
Specifies the fields to be applied when the condition is met.
Show child attributes
Show child attributes
The entity type to which the rule is applied.
pay_statement_item Response
Successfully Created
Finch id (uuidv4) for the rule.
[0-9a-f]{8}[-]?(?:[0-9a-f]{4}[-]?){3}[0-9a-f]{12}The priority of the rule.
The datetime when the rule was created.
The datetime when the rule was last updated.
Specifies when the rule should begin applying based on the date.
(\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01]))Specifies when the rules should stop applying rules based on the date.
(\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01]))Show child attributes
Show child attributes
Specifies the fields to be applied when the condition is met.
Show child attributes
Show child attributes
The entity type to which the rule is applied.
pay_statement_item Was this page helpful?