JavaScript
import Finch from '@tryfinch/finch-api';
const client = new Finch({
accessToken: 'My Access Token',
});
const response = await client.hris.documents.retreive('document_id');
console.log(response);from finch import Finch
client = Finch(
access_token="My Access Token",
)
response = client.hris.documents.retreive(
document_id="document_id",
)
print(response)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"),
)
response, err := client.HRIS.Documents.Retreive(
context.TODO(),
"document_id",
finchgo.HRISDocumentRetreiveParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response)
}
package com.tryfinch.api.example;
import com.tryfinch.api.client.FinchClient;
import com.tryfinch.api.client.okhttp.FinchOkHttpClient;
import com.tryfinch.api.models.DocumentRetreiveResponse;
import com.tryfinch.api.models.HrisDocumentRetreiveParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
FinchClient client = FinchOkHttpClient.builder()
.fromEnv()
.accessToken("My Access Token")
.build();
DocumentRetreiveResponse response = client.hris().documents().retreive("document_id");
}
}package com.tryfinch.api.example
import com.tryfinch.api.client.FinchClient
import com.tryfinch.api.client.okhttp.FinchOkHttpClient
import com.tryfinch.api.models.DocumentRetreiveResponse
import com.tryfinch.api.models.HrisDocumentRetreiveParams
fun main() {
val client: FinchClient = FinchOkHttpClient.builder()
.fromEnv()
.accessToken("My Access Token")
.build()
val response: DocumentRetreiveResponse = client.hris().documents().retreive("document_id")
}require "finch_api"
finch = FinchAPI::Client.new(access_token: "My Access Token")
response = finch.hris.documents.retreive("document_id")
puts(response)curl --request GET \
--url https://api.tryfinch.com/employer/documents/{document_id} \
--header 'Authorization: Bearer <token>' \
--header 'Finch-API-Version: <finch-api-version>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tryfinch.com/employer/documents/{document_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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;
}{
"type": "w4_2005",
"year": 2005,
"data": {
"individual_id": "f92b3db4-7bcb-4a54-a570-396bf99e041a",
"filing_status": "married",
"total_number_of_allowances": 22000,
"additional_withholding": 10000,
"exemption": "exempt"
}
}{
"code": 400,
"finch_code": "w4_sync_required",
"message": "W4 documents are not available. Please trigger a W4 sync job first.",
"name": "bad_request",
"context": {
"docs_url": "https://developer.tryfinch.com/api-reference/management/enqueue-a-new-automated-job#w4-form-employee-sync"
}
}Documents
Get Document
Beta: This endpoint is in beta and may change. Retrieve details of a specific document by its ID.
GET
/
employer
/
documents
/
{document_id}
JavaScript
import Finch from '@tryfinch/finch-api';
const client = new Finch({
accessToken: 'My Access Token',
});
const response = await client.hris.documents.retreive('document_id');
console.log(response);from finch import Finch
client = Finch(
access_token="My Access Token",
)
response = client.hris.documents.retreive(
document_id="document_id",
)
print(response)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"),
)
response, err := client.HRIS.Documents.Retreive(
context.TODO(),
"document_id",
finchgo.HRISDocumentRetreiveParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response)
}
package com.tryfinch.api.example;
import com.tryfinch.api.client.FinchClient;
import com.tryfinch.api.client.okhttp.FinchOkHttpClient;
import com.tryfinch.api.models.DocumentRetreiveResponse;
import com.tryfinch.api.models.HrisDocumentRetreiveParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
FinchClient client = FinchOkHttpClient.builder()
.fromEnv()
.accessToken("My Access Token")
.build();
DocumentRetreiveResponse response = client.hris().documents().retreive("document_id");
}
}package com.tryfinch.api.example
import com.tryfinch.api.client.FinchClient
import com.tryfinch.api.client.okhttp.FinchOkHttpClient
import com.tryfinch.api.models.DocumentRetreiveResponse
import com.tryfinch.api.models.HrisDocumentRetreiveParams
fun main() {
val client: FinchClient = FinchOkHttpClient.builder()
.fromEnv()
.accessToken("My Access Token")
.build()
val response: DocumentRetreiveResponse = client.hris().documents().retreive("document_id")
}require "finch_api"
finch = FinchAPI::Client.new(access_token: "My Access Token")
response = finch.hris.documents.retreive("document_id")
puts(response)curl --request GET \
--url https://api.tryfinch.com/employer/documents/{document_id} \
--header 'Authorization: Bearer <token>' \
--header 'Finch-API-Version: <finch-api-version>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tryfinch.com/employer/documents/{document_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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;
}{
"type": "w4_2005",
"year": 2005,
"data": {
"individual_id": "f92b3db4-7bcb-4a54-a570-396bf99e041a",
"filing_status": "married",
"total_number_of_allowances": 22000,
"additional_withholding": 10000,
"exemption": "exempt"
}
}{
"code": 400,
"finch_code": "w4_sync_required",
"message": "W4 documents are not available. Please trigger a W4 sync job first.",
"name": "bad_request",
"context": {
"docs_url": "https://developer.tryfinch.com/api-reference/management/enqueue-a-new-automated-job#w4-form-employee-sync"
}
}Authorizations
Please use your Access Token
Headers
Header used to specify the version for a given API request. Current version is 2020-09-17.
Path Parameters
The unique identifier of the document.
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.
Required array length:
1 elementExample:
["550e8400-e29b-41d4-a716-446655440000"]
Response
Successful response with document data specific to form type.
- Option 1
- Option 2
A 2020 version of the W-4 tax form containing information on an individual's filing status, dependents, and withholding details.
Was this page helpful?