Advance a payroll
curl --request POST \
--url https://api.usehammock.co/test_helpers/payrolls/{id}/advance \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"outcome": "success"
}
'import requests
url = "https://api.usehammock.co/test_helpers/payrolls/{id}/advance"
payload = { "outcome": "success" }
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({outcome: 'success'})
};
fetch('https://api.usehammock.co/test_helpers/payrolls/{id}/advance', 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/test_helpers/payrolls/{id}/advance",
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([
'outcome' => 'success'
]),
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://api.usehammock.co/test_helpers/payrolls/{id}/advance"
payload := strings.NewReader("{\n \"outcome\": \"success\"\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://api.usehammock.co/test_helpers/payrolls/{id}/advance")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"outcome\": \"success\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.usehammock.co/test_helpers/payrolls/{id}/advance")
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 \"outcome\": \"success\"\n}"
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"
}
}Test helpers
Advance a payroll
Sandbox only. Moves a payroll to its next status without waiting for the pay date or ACH settlement.
POST
/
test_helpers
/
payrolls
/
{id}
/
advance
Advance a payroll
curl --request POST \
--url https://api.usehammock.co/test_helpers/payrolls/{id}/advance \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"outcome": "success"
}
'import requests
url = "https://api.usehammock.co/test_helpers/payrolls/{id}/advance"
payload = { "outcome": "success" }
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({outcome: 'success'})
};
fetch('https://api.usehammock.co/test_helpers/payrolls/{id}/advance', 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/test_helpers/payrolls/{id}/advance",
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([
'outcome' => 'success'
]),
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://api.usehammock.co/test_helpers/payrolls/{id}/advance"
payload := strings.NewReader("{\n \"outcome\": \"success\"\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://api.usehammock.co/test_helpers/payrolls/{id}/advance")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"outcome\": \"success\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.usehammock.co/test_helpers/payrolls/{id}/advance")
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 \"outcome\": \"success\"\n}"
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
Body
application/json
Response
The payroll in its next status.
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