import Finch from '@tryfinch/finch-api';
const client = new Finch({
accessToken: 'My Access Token',
});
const createCompanyBenefitsResponse = await client.hris.benefits.create();
console.log(createCompanyBenefitsResponse.benefit_id);from finch import Finch
client = Finch(
access_token="My Access Token",
)
create_company_benefits_response = client.hris.benefits.create()
print(create_company_benefits_response.benefit_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"),
)
createCompanyBenefitsResponse, err := client.HRIS.Benefits.New(context.TODO(), finchgo.HRISBenefitNewParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", createCompanyBenefitsResponse.BenefitID)
}
package com.tryfinch.api.example;
import com.tryfinch.api.client.FinchClient;
import com.tryfinch.api.client.okhttp.FinchOkHttpClient;
import com.tryfinch.api.models.CreateCompanyBenefitsResponse;
import com.tryfinch.api.models.HrisBenefitCreateParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
FinchClient client = FinchOkHttpClient.builder()
.fromEnv()
.accessToken("My Access Token")
.build();
CreateCompanyBenefitsResponse createCompanyBenefitsResponse = client.hris().benefits().create();
}
}package com.tryfinch.api.example
import com.tryfinch.api.client.FinchClient
import com.tryfinch.api.client.okhttp.FinchOkHttpClient
import com.tryfinch.api.models.CreateCompanyBenefitsResponse
import com.tryfinch.api.models.HrisBenefitCreateParams
fun main() {
val client: FinchClient = FinchOkHttpClient.builder()
.fromEnv()
.accessToken("My Access Token")
.build()
val createCompanyBenefitsResponse: CreateCompanyBenefitsResponse = client.hris().benefits().create()
}require "finch_api"
finch = FinchAPI::Client.new(access_token: "My Access Token")
create_company_benefits_response = finch.hris.benefits.create
puts(create_company_benefits_response)curl --request POST \
--url https://api.tryfinch.com/employer/benefits \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: <content-type>' \
--header 'Finch-API-Version: <finch-api-version>' \
--data '
{
"description": "<string>",
"company_contribution": {
"type": "match",
"tiers": [
{
"match": 5000,
"threshold": 5000
}
]
}
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tryfinch.com/employer/benefits",
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([
'description' => '<string>',
'company_contribution' => [
'type' => 'match',
'tiers' => [
[
'match' => 5000,
'threshold' => 5000
]
]
]
]),
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;
}{
"benefit_id": "e8b90071-0c11-471c-86e8-e303ef2f6782",
"job_id": "be1b3351-a88e-46c2-96e4-c2cf38e529a7"
}{
"code": 400,
"name": "invalid_request_error",
"finch_code": "invalid_request",
"message": "[body:description]: Not a valid string"
}{
"code": 422,
"name": "unprocessable_request_error",
"finch_code": "unsupported_paramters",
"message": "Provider does not support benefit type '401k'"
}Create Deduction
Creates a new company-wide deduction or contribution. Please use the /providers endpoint to view available types for each provider.
import Finch from '@tryfinch/finch-api';
const client = new Finch({
accessToken: 'My Access Token',
});
const createCompanyBenefitsResponse = await client.hris.benefits.create();
console.log(createCompanyBenefitsResponse.benefit_id);from finch import Finch
client = Finch(
access_token="My Access Token",
)
create_company_benefits_response = client.hris.benefits.create()
print(create_company_benefits_response.benefit_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"),
)
createCompanyBenefitsResponse, err := client.HRIS.Benefits.New(context.TODO(), finchgo.HRISBenefitNewParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", createCompanyBenefitsResponse.BenefitID)
}
package com.tryfinch.api.example;
import com.tryfinch.api.client.FinchClient;
import com.tryfinch.api.client.okhttp.FinchOkHttpClient;
import com.tryfinch.api.models.CreateCompanyBenefitsResponse;
import com.tryfinch.api.models.HrisBenefitCreateParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
FinchClient client = FinchOkHttpClient.builder()
.fromEnv()
.accessToken("My Access Token")
.build();
CreateCompanyBenefitsResponse createCompanyBenefitsResponse = client.hris().benefits().create();
}
}package com.tryfinch.api.example
import com.tryfinch.api.client.FinchClient
import com.tryfinch.api.client.okhttp.FinchOkHttpClient
import com.tryfinch.api.models.CreateCompanyBenefitsResponse
import com.tryfinch.api.models.HrisBenefitCreateParams
fun main() {
val client: FinchClient = FinchOkHttpClient.builder()
.fromEnv()
.accessToken("My Access Token")
.build()
val createCompanyBenefitsResponse: CreateCompanyBenefitsResponse = client.hris().benefits().create()
}require "finch_api"
finch = FinchAPI::Client.new(access_token: "My Access Token")
create_company_benefits_response = finch.hris.benefits.create
puts(create_company_benefits_response)curl --request POST \
--url https://api.tryfinch.com/employer/benefits \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: <content-type>' \
--header 'Finch-API-Version: <finch-api-version>' \
--data '
{
"description": "<string>",
"company_contribution": {
"type": "match",
"tiers": [
{
"match": 5000,
"threshold": 5000
}
]
}
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tryfinch.com/employer/benefits",
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([
'description' => '<string>',
'company_contribution' => [
'type' => 'match',
'tiers' => [
[
'match' => 5000,
'threshold' => 5000
]
]
]
]),
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;
}{
"benefit_id": "e8b90071-0c11-471c-86e8-e303ef2f6782",
"job_id": "be1b3351-a88e-46c2-96e4-c2cf38e529a7"
}{
"code": 400,
"name": "invalid_request_error",
"finch_code": "invalid_request",
"message": "[body:description]: Not a valid string"
}{
"code": 422,
"name": "unprocessable_request_error",
"finch_code": "unsupported_paramters",
"message": "Provider does not support benefit type '401k'"
}type, frequency and description, a new item will not be created. Finch will instead return the benefit_id of the existing item.
Latencies may vary depending on whether the provider is Automated or Assisted - new items will be created within minutes for Automated providers and within the 2 business day SLA for Assisted providers.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 specify which entities' data to access. Provide exactly one entity ID per request; a maximum of one is accepted.
1 element["550e8400-e29b-41d4-a716-446655440000"]
Body
Type of benefit.
457, 401k, 401k_roth, 401k_loan, 403b, 403b_roth, 457_roth, commuter, custom_post_tax, custom_pre_tax, fsa_dependent_care, fsa_medical, hsa_post, hsa_pre, s125_dental, s125_medical, s125_vision, simple, simple_ira, null Name of the benefit as it appears in the provider and pay statements. Recommend limiting this to <30 characters due to limitations in specific providers (e.g. Justworks).
The frequency of the benefit deduction/contribution.
every_paycheck, monthly, one_time, null The company match for this benefit.
Show child attributes
Show child attributes
Was this page helpful?