List deductions
curl --request GET \
--url https://api.usehammock.co/deductions \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.usehammock.co/deductions"
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/deductions', 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/deductions",
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/deductions"
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/deductions")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.usehammock.co/deductions")
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{
"object": "list",
"data": [
{
"id": "ded_2Lp9Xc4vNm7K",
"object": "deduction",
"employer": "empr_1Qx8Zt2eZvKYlo2C",
"employee": "emp_5Tg7Rw2nBx8P",
"benefit": "ben_4Df8Gh2jKl6M",
"election": "elec_3Sd6Fg9hJk2L",
"benefit_type": "hsa",
"category": "contribution",
"tax_treatment": "pre_tax",
"status": "scheduled",
"employee_amount": 15000,
"employer_amount": 5000,
"currency": "usd",
"effective_date": "2027-03-19",
"variable": true,
"livemode": true,
"created": "2023-11-07T05:31:56Z",
"updated": "2023-11-07T05:31:56Z",
"end_date": "2023-12-25",
"upcoming_change": {
"employee_amount": 17500,
"employer_amount": 5000,
"effective_date": "2027-04-05"
}
}
],
"has_more": true,
"url": "/deductions"
}{
"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"
}
}Deductions
List deductions
Returns an employer’s standing deductions. Pass pay_date to get the amounts that apply
to one payday: each deduction is returned with employee_amount and employer_amount
already resolved for that date, and deductions that don’t apply on it are left out.
GET
/
deductions
List deductions
curl --request GET \
--url https://api.usehammock.co/deductions \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.usehammock.co/deductions"
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/deductions', 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/deductions",
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/deductions"
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/deductions")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.usehammock.co/deductions")
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{
"object": "list",
"data": [
{
"id": "ded_2Lp9Xc4vNm7K",
"object": "deduction",
"employer": "empr_1Qx8Zt2eZvKYlo2C",
"employee": "emp_5Tg7Rw2nBx8P",
"benefit": "ben_4Df8Gh2jKl6M",
"election": "elec_3Sd6Fg9hJk2L",
"benefit_type": "hsa",
"category": "contribution",
"tax_treatment": "pre_tax",
"status": "scheduled",
"employee_amount": 15000,
"employer_amount": 5000,
"currency": "usd",
"effective_date": "2027-03-19",
"variable": true,
"livemode": true,
"created": "2023-11-07T05:31:56Z",
"updated": "2023-11-07T05:31:56Z",
"end_date": "2023-12-25",
"upcoming_change": {
"employee_amount": 17500,
"employer_amount": 5000,
"effective_date": "2027-04-05"
}
}
],
"has_more": true,
"url": "/deductions"
}{
"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"
}
}