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"
"github.com/Finch-API/finch-api-go/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_2020",
"year": 2020,
"data": {
"individual_id": "f92b3db4-7bcb-4a54-a570-396bf99e041a",
"filing_status": "single",
"amount_for_qualifying_children_under_17": 2000,
"amount_for_other_dependents": 1000,
"other_income": 500,
"deductions": 300,
"extra_withholding": 100
}
}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"
"github.com/Finch-API/finch-api-go/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_2020",
"year": 2020,
"data": {
"individual_id": "f92b3db4-7bcb-4a54-a570-396bf99e041a",
"filing_status": "single",
"amount_for_qualifying_children_under_17": 2000,
"amount_for_other_dependents": 1000,
"other_income": 500,
"deductions": 300,
"extra_withholding": 100
}
}Authorizations
Please use your Access Token
Headers
Header used to specify the version for a given API request. Current version is 2020-09-17.
Pattern:
([12]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01]))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?