JavaScript
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/v2"
"github.com/Finch-API/finch-api-go/v2/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"
}Rules
Update Rule
Update a rule for a pay statement item.
PUT
/
employer
/
pay-statement-item
/
rule
/
{rule_id}
JavaScript
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/v2"
"github.com/Finch-API/finch-api-go/v2/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"
}Headers
Query Parameters
The entity IDs to update the rule for. Provide exactly one entity ID per request; a maximum of one is accepted. Required when the connection has more than one entity — omitting it returns a 400 invalid_request_error. Optional for single-entity connections.
Required array length:
1 elementExample:
["550e8400-e29b-41d4-a716-446655440000"]
Response
Successfully Updated
Was this page helpful?