Report a completed payroll's HSA withholding
curl --request POST \
--url https://www.getprescience.com/api/partner/v1/groups/{groupId}/payroll-results \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"eventId": "<string>",
"version": 2,
"companyId": "<string>",
"payrollRunId": "<string>",
"contributionYear": 123,
"payday": "2023-12-25",
"isVoid": true,
"sourceReference": "<string>",
"sourceTimestamp": "2023-11-07T05:31:56Z",
"rosterComplete": true,
"employees": [
{
"employeeId": "<string>",
"email": "jsmith@example.com",
"hsaWithheldCents": 123,
"payrollItemId": "<string>",
"deductionId": "<string>",
"expectedHsaCents": 1,
"voidOf": "<string>"
}
]
}
'import requests
url = "https://www.getprescience.com/api/partner/v1/groups/{groupId}/payroll-results"
payload = {
"eventId": "<string>",
"version": 2,
"companyId": "<string>",
"payrollRunId": "<string>",
"contributionYear": 123,
"payday": "2023-12-25",
"isVoid": True,
"sourceReference": "<string>",
"sourceTimestamp": "2023-11-07T05:31:56Z",
"rosterComplete": True,
"employees": [
{
"employeeId": "<string>",
"email": "jsmith@example.com",
"hsaWithheldCents": 123,
"payrollItemId": "<string>",
"deductionId": "<string>",
"expectedHsaCents": 1,
"voidOf": "<string>"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
eventId: '<string>',
version: 2,
companyId: '<string>',
payrollRunId: '<string>',
contributionYear: 123,
payday: '2023-12-25',
isVoid: true,
sourceReference: '<string>',
sourceTimestamp: '2023-11-07T05:31:56Z',
rosterComplete: true,
employees: [
{
employeeId: '<string>',
email: 'jsmith@example.com',
hsaWithheldCents: 123,
payrollItemId: '<string>',
deductionId: '<string>',
expectedHsaCents: 1,
voidOf: '<string>'
}
]
})
};
fetch('https://www.getprescience.com/api/partner/v1/groups/{groupId}/payroll-results', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://www.getprescience.com/api/partner/v1/groups/{groupId}/payroll-results",
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([
'eventId' => '<string>',
'version' => 2,
'companyId' => '<string>',
'payrollRunId' => '<string>',
'contributionYear' => 123,
'payday' => '2023-12-25',
'isVoid' => true,
'sourceReference' => '<string>',
'sourceTimestamp' => '2023-11-07T05:31:56Z',
'rosterComplete' => true,
'employees' => [
[
'employeeId' => '<string>',
'email' => 'jsmith@example.com',
'hsaWithheldCents' => 123,
'payrollItemId' => '<string>',
'deductionId' => '<string>',
'expectedHsaCents' => 1,
'voidOf' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://www.getprescience.com/api/partner/v1/groups/{groupId}/payroll-results"
payload := strings.NewReader("{\n \"eventId\": \"<string>\",\n \"version\": 2,\n \"companyId\": \"<string>\",\n \"payrollRunId\": \"<string>\",\n \"contributionYear\": 123,\n \"payday\": \"2023-12-25\",\n \"isVoid\": true,\n \"sourceReference\": \"<string>\",\n \"sourceTimestamp\": \"2023-11-07T05:31:56Z\",\n \"rosterComplete\": true,\n \"employees\": [\n {\n \"employeeId\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"hsaWithheldCents\": 123,\n \"payrollItemId\": \"<string>\",\n \"deductionId\": \"<string>\",\n \"expectedHsaCents\": 1,\n \"voidOf\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://www.getprescience.com/api/partner/v1/groups/{groupId}/payroll-results")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"eventId\": \"<string>\",\n \"version\": 2,\n \"companyId\": \"<string>\",\n \"payrollRunId\": \"<string>\",\n \"contributionYear\": 123,\n \"payday\": \"2023-12-25\",\n \"isVoid\": true,\n \"sourceReference\": \"<string>\",\n \"sourceTimestamp\": \"2023-11-07T05:31:56Z\",\n \"rosterComplete\": true,\n \"employees\": [\n {\n \"employeeId\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"hsaWithheldCents\": 123,\n \"payrollItemId\": \"<string>\",\n \"deductionId\": \"<string>\",\n \"expectedHsaCents\": 1,\n \"voidOf\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.getprescience.com/api/partner/v1/groups/{groupId}/payroll-results")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"eventId\": \"<string>\",\n \"version\": 2,\n \"companyId\": \"<string>\",\n \"payrollRunId\": \"<string>\",\n \"contributionYear\": 123,\n \"payday\": \"2023-12-25\",\n \"isVoid\": true,\n \"sourceReference\": \"<string>\",\n \"sourceTimestamp\": \"2023-11-07T05:31:56Z\",\n \"rosterComplete\": true,\n \"employees\": [\n {\n \"employeeId\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"hsaWithheldCents\": 123,\n \"payrollItemId\": \"<string>\",\n \"deductionId\": \"<string>\",\n \"expectedHsaCents\": 1,\n \"voidOf\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"eventId": "<string>",
"version": 123,
"status": "received",
"holdReason": "<string>",
"employees": [
{
"employeeId": "<string>",
"outcome": "recorded",
"message": "<string>"
}
],
"receivedAt": "2023-11-07T05:31:56Z",
"processedAt": "2023-11-07T05:31:56Z"
}{
"id": "<string>",
"eventId": "<string>",
"version": 123,
"status": "received",
"holdReason": "<string>",
"employees": [
{
"employeeId": "<string>",
"outcome": "recorded",
"message": "<string>"
}
],
"receivedAt": "2023-11-07T05:31:56Z",
"processedAt": "2023-11-07T05:31:56Z"
}{
"error": "invalid_request",
"message": "Payroll result failed validation."
}{
"error": "unauthorized",
"message": "Provide a valid partner API key as `Authorization: Bearer psk_...`."
}{
"error": "not_found",
"message": "No group grp_8c2f41d09a3e found."
}{
"error": "conflict",
"message": "Event evt_2026_10_30_regular version 1 was already received with different content. Send changes as a new version."
}{
"error": "invalid_request",
"message": "Payroll result is inconsistent."
}{
"error": "rate_limited",
"message": "Too many requests. Please retry later."
}Enrollments
Report a completed payroll's HSA withholding
Post after every completed payroll. Stored once per eventId and version; a repeat returns what was stored. Prescience deposits only what is reported as withheld. See the Payroll results guide.
POST
/
groups
/
{groupId}
/
payroll-results
Report a completed payroll's HSA withholding
curl --request POST \
--url https://www.getprescience.com/api/partner/v1/groups/{groupId}/payroll-results \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"eventId": "<string>",
"version": 2,
"companyId": "<string>",
"payrollRunId": "<string>",
"contributionYear": 123,
"payday": "2023-12-25",
"isVoid": true,
"sourceReference": "<string>",
"sourceTimestamp": "2023-11-07T05:31:56Z",
"rosterComplete": true,
"employees": [
{
"employeeId": "<string>",
"email": "jsmith@example.com",
"hsaWithheldCents": 123,
"payrollItemId": "<string>",
"deductionId": "<string>",
"expectedHsaCents": 1,
"voidOf": "<string>"
}
]
}
'import requests
url = "https://www.getprescience.com/api/partner/v1/groups/{groupId}/payroll-results"
payload = {
"eventId": "<string>",
"version": 2,
"companyId": "<string>",
"payrollRunId": "<string>",
"contributionYear": 123,
"payday": "2023-12-25",
"isVoid": True,
"sourceReference": "<string>",
"sourceTimestamp": "2023-11-07T05:31:56Z",
"rosterComplete": True,
"employees": [
{
"employeeId": "<string>",
"email": "jsmith@example.com",
"hsaWithheldCents": 123,
"payrollItemId": "<string>",
"deductionId": "<string>",
"expectedHsaCents": 1,
"voidOf": "<string>"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
eventId: '<string>',
version: 2,
companyId: '<string>',
payrollRunId: '<string>',
contributionYear: 123,
payday: '2023-12-25',
isVoid: true,
sourceReference: '<string>',
sourceTimestamp: '2023-11-07T05:31:56Z',
rosterComplete: true,
employees: [
{
employeeId: '<string>',
email: 'jsmith@example.com',
hsaWithheldCents: 123,
payrollItemId: '<string>',
deductionId: '<string>',
expectedHsaCents: 1,
voidOf: '<string>'
}
]
})
};
fetch('https://www.getprescience.com/api/partner/v1/groups/{groupId}/payroll-results', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://www.getprescience.com/api/partner/v1/groups/{groupId}/payroll-results",
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([
'eventId' => '<string>',
'version' => 2,
'companyId' => '<string>',
'payrollRunId' => '<string>',
'contributionYear' => 123,
'payday' => '2023-12-25',
'isVoid' => true,
'sourceReference' => '<string>',
'sourceTimestamp' => '2023-11-07T05:31:56Z',
'rosterComplete' => true,
'employees' => [
[
'employeeId' => '<string>',
'email' => 'jsmith@example.com',
'hsaWithheldCents' => 123,
'payrollItemId' => '<string>',
'deductionId' => '<string>',
'expectedHsaCents' => 1,
'voidOf' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://www.getprescience.com/api/partner/v1/groups/{groupId}/payroll-results"
payload := strings.NewReader("{\n \"eventId\": \"<string>\",\n \"version\": 2,\n \"companyId\": \"<string>\",\n \"payrollRunId\": \"<string>\",\n \"contributionYear\": 123,\n \"payday\": \"2023-12-25\",\n \"isVoid\": true,\n \"sourceReference\": \"<string>\",\n \"sourceTimestamp\": \"2023-11-07T05:31:56Z\",\n \"rosterComplete\": true,\n \"employees\": [\n {\n \"employeeId\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"hsaWithheldCents\": 123,\n \"payrollItemId\": \"<string>\",\n \"deductionId\": \"<string>\",\n \"expectedHsaCents\": 1,\n \"voidOf\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://www.getprescience.com/api/partner/v1/groups/{groupId}/payroll-results")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"eventId\": \"<string>\",\n \"version\": 2,\n \"companyId\": \"<string>\",\n \"payrollRunId\": \"<string>\",\n \"contributionYear\": 123,\n \"payday\": \"2023-12-25\",\n \"isVoid\": true,\n \"sourceReference\": \"<string>\",\n \"sourceTimestamp\": \"2023-11-07T05:31:56Z\",\n \"rosterComplete\": true,\n \"employees\": [\n {\n \"employeeId\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"hsaWithheldCents\": 123,\n \"payrollItemId\": \"<string>\",\n \"deductionId\": \"<string>\",\n \"expectedHsaCents\": 1,\n \"voidOf\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.getprescience.com/api/partner/v1/groups/{groupId}/payroll-results")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"eventId\": \"<string>\",\n \"version\": 2,\n \"companyId\": \"<string>\",\n \"payrollRunId\": \"<string>\",\n \"contributionYear\": 123,\n \"payday\": \"2023-12-25\",\n \"isVoid\": true,\n \"sourceReference\": \"<string>\",\n \"sourceTimestamp\": \"2023-11-07T05:31:56Z\",\n \"rosterComplete\": true,\n \"employees\": [\n {\n \"employeeId\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"hsaWithheldCents\": 123,\n \"payrollItemId\": \"<string>\",\n \"deductionId\": \"<string>\",\n \"expectedHsaCents\": 1,\n \"voidOf\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"eventId": "<string>",
"version": 123,
"status": "received",
"holdReason": "<string>",
"employees": [
{
"employeeId": "<string>",
"outcome": "recorded",
"message": "<string>"
}
],
"receivedAt": "2023-11-07T05:31:56Z",
"processedAt": "2023-11-07T05:31:56Z"
}{
"id": "<string>",
"eventId": "<string>",
"version": 123,
"status": "received",
"holdReason": "<string>",
"employees": [
{
"employeeId": "<string>",
"outcome": "recorded",
"message": "<string>"
}
],
"receivedAt": "2023-11-07T05:31:56Z",
"processedAt": "2023-11-07T05:31:56Z"
}{
"error": "invalid_request",
"message": "Payroll result failed validation."
}{
"error": "unauthorized",
"message": "Provide a valid partner API key as `Authorization: Bearer psk_...`."
}{
"error": "not_found",
"message": "No group grp_8c2f41d09a3e found."
}{
"error": "conflict",
"message": "Event evt_2026_10_30_regular version 1 was already received with different content. Send changes as a new version."
}{
"error": "invalid_request",
"message": "Payroll result is inconsistent."
}{
"error": "rate_limited",
"message": "Too many requests. Please retry later."
}Authorizations
Partner API key. psk_test_<32 hex> for test mode, psk_live_<32 hex> for live mode. Store them in your secrets manager on issue. Live keys are shown once; the scoped partner portal can show an active sandbox key again.
Path Parameters
Body
application/json
Required range:
x >= 1Your company ID (the group's externalId).
Check payroll.type. Amendments and balancing payrolls are corrections.
Available options:
regular, off_cycle, amendment, balancing, third_party_sick_pay Check payroll.status. Draft, pending and processing are held.
Available options:
draft, pending, processing, failed, partially_paid, paid Check payroll.is_void.
Every employee with a Prescience HSA deduction on this payroll is listed, including zeros.
Maximum array length:
10000Show child attributes
Show child attributes