import Finch from '@tryfinch/finch-api';
const client = new Finch({
accessToken: 'My Access Token',
});
const rule = await client.hris.payStatementItem.rules.update('rule_id');
console.log(rule.id);from finch import Finch
client = Finch(
access_token="My Access Token",
)
rule = client.hris.pay_statement_item.rules.update(
rule_id="rule_id",
)
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.Update(
context.TODO(),
"rule_id",
finchgo.HRISPayStatementItemRuleUpdateParams{},
)
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.HrisPayStatementItemRuleUpdateParams;
import com.tryfinch.api.models.RuleUpdateResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
FinchClient client = FinchOkHttpClient.builder()
.fromEnv()
.accessToken("My Access Token")
.build();
RuleUpdateResponse rule = client.hris().payStatementItem().rules().update("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.HrisPayStatementItemRuleUpdateParams
import com.tryfinch.api.models.RuleUpdateResponse
fun main() {
val client: FinchClient = FinchOkHttpClient.builder()
.fromEnv()
.accessToken("My Access Token")
.build()
val rule: RuleUpdateResponse = client.hris().payStatementItem().rules().update("rule_id")
}require "finch_api"
finch = FinchAPI::Client.new(access_token: "My Access Token")
rule = finch.hris.pay_statement_item.rules.update("rule_id")
puts(rule)curl --request PUT \
--url https://api.tryfinch.com/employer/pay-statement-item/rule/{rule_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: <content-type>' \
--header 'Finch-API-Version: <finch-api-version>' \
--data '
{
"optionalProperty": "<unknown>"
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tryfinch.com/employer/pay-statement-item/rule/{rule_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'optionalProperty' => '<unknown>'
]),
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": null,
"effective_end_date": "2025-12-31",
"conditions": [
{
"field": "name",
"operator": "equals",
"value": "Salary"
}
],
"attributes": {
"metadata": {
"myLabel": "My Value"
}
},
"created_at": "2025-01-01T10:00:00Z",
"updated_at": "2025-02-13T08:30:00Z"
}{
"code": 400,
"name": "invalid_request_error",
"finch_code": "invalid_request",
"message": "Validation error: Array must contain at least 1 element(s) at \"conditions\""
}Update Rule
Update a rule for a pay statement item.
import Finch from '@tryfinch/finch-api';
const client = new Finch({
accessToken: 'My Access Token',
});
const rule = await client.hris.payStatementItem.rules.update('rule_id');
console.log(rule.id);from finch import Finch
client = Finch(
access_token="My Access Token",
)
rule = client.hris.pay_statement_item.rules.update(
rule_id="rule_id",
)
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.Update(
context.TODO(),
"rule_id",
finchgo.HRISPayStatementItemRuleUpdateParams{},
)
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.HrisPayStatementItemRuleUpdateParams;
import com.tryfinch.api.models.RuleUpdateResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
FinchClient client = FinchOkHttpClient.builder()
.fromEnv()
.accessToken("My Access Token")
.build();
RuleUpdateResponse rule = client.hris().payStatementItem().rules().update("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.HrisPayStatementItemRuleUpdateParams
import com.tryfinch.api.models.RuleUpdateResponse
fun main() {
val client: FinchClient = FinchOkHttpClient.builder()
.fromEnv()
.accessToken("My Access Token")
.build()
val rule: RuleUpdateResponse = client.hris().payStatementItem().rules().update("rule_id")
}require "finch_api"
finch = FinchAPI::Client.new(access_token: "My Access Token")
rule = finch.hris.pay_statement_item.rules.update("rule_id")
puts(rule)curl --request PUT \
--url https://api.tryfinch.com/employer/pay-statement-item/rule/{rule_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: <content-type>' \
--header 'Finch-API-Version: <finch-api-version>' \
--data '
{
"optionalProperty": "<unknown>"
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tryfinch.com/employer/pay-statement-item/rule/{rule_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'optionalProperty' => '<unknown>'
]),
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": null,
"effective_end_date": "2025-12-31",
"conditions": [
{
"field": "name",
"operator": "equals",
"value": "Salary"
}
],
"attributes": {
"metadata": {
"myLabel": "My Value"
}
},
"created_at": "2025-01-01T10:00:00Z",
"updated_at": "2025-02-13T08:30: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
Path Parameters
Query Parameters
The entity IDs to update the rule for. Provide exactly one entity ID per request; a maximum of one is accepted.
1 element["550e8400-e29b-41d4-a716-446655440000"]
Body
Response
Successfully Updated
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?