Retrieve a payroll
curl --request GET \
--url https://api.usehammock.co/payrolls/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.usehammock.co/payrolls/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.usehammock.co/payrolls/{id}', 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://api.usehammock.co/payrolls/{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>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.usehammock.co/payrolls/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.usehammock.co/payrolls/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.usehammock.co/payrolls/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "pay_6Mn2Bv8cXz4L",
"object": "payroll",
"employer": "empr_1Qx8Zt2eZvKYlo2C",
"external_id": "payroll_2027_03_19",
"type": "regular",
"pay_period": {
"start_date": "2027-03-01",
"end_date": "2027-03-15"
},
"pay_date": "2027-03-19",
"status": "reported",
"totals": {
"employee_amount": 15000,
"employer_amount": 5000,
"reimbursement_amount": 12500,
"currency": "usd"
},
"deductions": [
{
"deduction": "ded_2Lp9Xc4vNm7K",
"employee": "emp_5Tg7Rw2nBx8P",
"benefit_type": "hsa",
"expected_employee_amount": 15000,
"employee_amount": 15000,
"expected_employer_amount": 5000,
"employer_amount": 5000,
"variance": "none"
}
],
"reimbursements": [
"reimb_8Wq3Zr6tHy1D"
],
"metadata": {
"plan": "growth"
},
"livemode": true,
"created": "2027-03-17T19:30:00Z",
"pay_schedule": "ps_7Hn3Kd9sLq2W",
"voidable_until": "2027-03-19T13:00:00Z",
"pull": "pull_3Vb7Nm1qWe5R",
"voided_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z"
}{
"error": {
"type": "invalid_request_error",
"code": "parameter_missing",
"message": "Missing required parameter: employer.",
"param": "employer",
"doc_url": "https://docs.usehammock.co/api/errors#parameter_missing",
"request_id": "req_9Kd2Lm5nPq8R"
}
}Payrolls
Retrieve a payroll
GET
/
payrolls
/
{id}
Retrieve a payroll
curl --request GET \
--url https://api.usehammock.co/payrolls/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.usehammock.co/payrolls/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.usehammock.co/payrolls/{id}', 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://api.usehammock.co/payrolls/{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>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.usehammock.co/payrolls/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.usehammock.co/payrolls/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.usehammock.co/payrolls/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "pay_6Mn2Bv8cXz4L",
"object": "payroll",
"employer": "empr_1Qx8Zt2eZvKYlo2C",
"external_id": "payroll_2027_03_19",
"type": "regular",
"pay_period": {
"start_date": "2027-03-01",
"end_date": "2027-03-15"
},
"pay_date": "2027-03-19",
"status": "reported",
"totals": {
"employee_amount": 15000,
"employer_amount": 5000,
"reimbursement_amount": 12500,
"currency": "usd"
},
"deductions": [
{
"deduction": "ded_2Lp9Xc4vNm7K",
"employee": "emp_5Tg7Rw2nBx8P",
"benefit_type": "hsa",
"expected_employee_amount": 15000,
"employee_amount": 15000,
"expected_employer_amount": 5000,
"employer_amount": 5000,
"variance": "none"
}
],
"reimbursements": [
"reimb_8Wq3Zr6tHy1D"
],
"metadata": {
"plan": "growth"
},
"livemode": true,
"created": "2027-03-17T19:30:00Z",
"pay_schedule": "ps_7Hn3Kd9sLq2W",
"voidable_until": "2027-03-19T13:00:00Z",
"pull": "pull_3Vb7Nm1qWe5R",
"voided_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z"
}{
"error": {
"type": "invalid_request_error",
"code": "parameter_missing",
"message": "Missing required parameter: employer.",
"param": "employer",
"doc_url": "https://docs.usehammock.co/api/errors#parameter_missing",
"request_id": "req_9Kd2Lm5nPq8R"
}
}Authorizations
Headers
Response
The payroll.
reported: received, and voidable until voidable_until. funding: the ACH pull has
started. completed: the pull settled and contributions are in employees' accounts.
voided: you voided it. failed: the pull was returned by the employer's bank.
Available options:
reported, funding, completed, voided, failed