Shifts
Add Shifts to Existing Check
Add one or more shifts to an existing, pending employee check.
POST
/
shifts
Add Shifts to Existing Check
curl --request POST \
--url https://api.zeal.com/shifts \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"shifts": [
{
"hourly": {
"hours": 10,
"wage": 33,
"custom_name": "hourly"
},
"overtime": {
"hours": 2
},
"time": "2023-3-29"
}
],
"companyID": "fc235f092bwe46aa8a082f357715bcfa",
"employeeCheckID": "f251842623e942d6bab6ad2bca436d95"
}
'import requests
url = "https://api.zeal.com/shifts"
payload = {
"shifts": [
{
"hourly": {
"hours": 10,
"wage": 33,
"custom_name": "hourly"
},
"overtime": { "hours": 2 },
"time": "2023-3-29"
}
],
"companyID": "fc235f092bwe46aa8a082f357715bcfa",
"employeeCheckID": "f251842623e942d6bab6ad2bca436d95"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
shifts: [
{
hourly: {hours: 10, wage: 33, custom_name: 'hourly'},
overtime: {hours: 2},
time: '2023-3-29'
}
],
companyID: 'fc235f092bwe46aa8a082f357715bcfa',
employeeCheckID: 'f251842623e942d6bab6ad2bca436d95'
})
};
fetch('https://api.zeal.com/shifts', 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.zeal.com/shifts",
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([
'shifts' => [
[
'hourly' => [
'hours' => 10,
'wage' => 33,
'custom_name' => 'hourly'
],
'overtime' => [
'hours' => 2
],
'time' => '2023-3-29'
]
],
'companyID' => 'fc235f092bwe46aa8a082f357715bcfa',
'employeeCheckID' => 'f251842623e942d6bab6ad2bca436d95'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.zeal.com/shifts"
payload := strings.NewReader("{\n \"shifts\": [\n {\n \"hourly\": {\n \"hours\": 10,\n \"wage\": 33,\n \"custom_name\": \"hourly\"\n },\n \"overtime\": {\n \"hours\": 2\n },\n \"time\": \"2023-3-29\"\n }\n ],\n \"companyID\": \"fc235f092bwe46aa8a082f357715bcfa\",\n \"employeeCheckID\": \"f251842623e942d6bab6ad2bca436d95\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.zeal.com/shifts")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"shifts\": [\n {\n \"hourly\": {\n \"hours\": 10,\n \"wage\": 33,\n \"custom_name\": \"hourly\"\n },\n \"overtime\": {\n \"hours\": 2\n },\n \"time\": \"2023-3-29\"\n }\n ],\n \"companyID\": \"fc235f092bwe46aa8a082f357715bcfa\",\n \"employeeCheckID\": \"f251842623e942d6bab6ad2bca436d95\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zeal.com/shifts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"shifts\": [\n {\n \"hourly\": {\n \"hours\": 10,\n \"wage\": 33,\n \"custom_name\": \"hourly\"\n },\n \"overtime\": {\n \"hours\": 2\n },\n \"time\": \"2023-3-29\"\n }\n ],\n \"companyID\": \"fc235f092bwe46aa8a082f357715bcfa\",\n \"employeeCheckID\": \"f251842623e942d6bab6ad2bca436d95\"\n}"
response = http.request(request)
puts response.read_body"{\n \"success\": true,\n \"data\": {\n \"employeeCheckID\": \"9827465739\",\n \"employerCheckID\": null,\n \"companyID\": \"1b5n28nrideucd24\",\n \"employeeID\": \"1234567890\",\n \"status\": \"pending\",\n \"first_name\": \"erlich\",\n \"middle_initial\": null,\n \"last_name\": \"bachman\",\n \"reportingPeriodID\": \"0982349584387523234\",\n \"check_date\": \"2023-10-07\",\n \"metadata\": {\n \"checkCorrelationID\": \"1\"\n },\n \"disbursement\": {\n \"method\": \"direct_deposit\"\n },\n \"net_pay\": null,\n \"taxes\": null,\n \"total_employer_taxes\": null,\n \"total_employee_taxes\": null,\n \"shifts\": [\n {\n \"employeeID\": \"1234567890\",\n \"shiftID\": \"123456789\",\n \"first_name\": \"erlich\",\n \"last_name\": \"bachman\",\n \"metadata\": {},\n \"time\": \"2023-01-12T10:00:00\",\n\t\t\t\t\"workLocationID\": \"bcc34345ereretwe3rw31234ee\",\n \"hourly\": {\n \"hours\": 2,\n \"wage\": 20\n }\n }\n ]\n }\n}"{
"success": false,
"errors": [
{
"message": "Shift object(s) is missing required fields or has improperly formatted data",
"code": 13
}
]
}See the Shift Object for the shift schema.
Authorizations
Body
application/json
Response
200
⌘I
Add Shifts to Existing Check
curl --request POST \
--url https://api.zeal.com/shifts \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"shifts": [
{
"hourly": {
"hours": 10,
"wage": 33,
"custom_name": "hourly"
},
"overtime": {
"hours": 2
},
"time": "2023-3-29"
}
],
"companyID": "fc235f092bwe46aa8a082f357715bcfa",
"employeeCheckID": "f251842623e942d6bab6ad2bca436d95"
}
'import requests
url = "https://api.zeal.com/shifts"
payload = {
"shifts": [
{
"hourly": {
"hours": 10,
"wage": 33,
"custom_name": "hourly"
},
"overtime": { "hours": 2 },
"time": "2023-3-29"
}
],
"companyID": "fc235f092bwe46aa8a082f357715bcfa",
"employeeCheckID": "f251842623e942d6bab6ad2bca436d95"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
shifts: [
{
hourly: {hours: 10, wage: 33, custom_name: 'hourly'},
overtime: {hours: 2},
time: '2023-3-29'
}
],
companyID: 'fc235f092bwe46aa8a082f357715bcfa',
employeeCheckID: 'f251842623e942d6bab6ad2bca436d95'
})
};
fetch('https://api.zeal.com/shifts', 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.zeal.com/shifts",
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([
'shifts' => [
[
'hourly' => [
'hours' => 10,
'wage' => 33,
'custom_name' => 'hourly'
],
'overtime' => [
'hours' => 2
],
'time' => '2023-3-29'
]
],
'companyID' => 'fc235f092bwe46aa8a082f357715bcfa',
'employeeCheckID' => 'f251842623e942d6bab6ad2bca436d95'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.zeal.com/shifts"
payload := strings.NewReader("{\n \"shifts\": [\n {\n \"hourly\": {\n \"hours\": 10,\n \"wage\": 33,\n \"custom_name\": \"hourly\"\n },\n \"overtime\": {\n \"hours\": 2\n },\n \"time\": \"2023-3-29\"\n }\n ],\n \"companyID\": \"fc235f092bwe46aa8a082f357715bcfa\",\n \"employeeCheckID\": \"f251842623e942d6bab6ad2bca436d95\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.zeal.com/shifts")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"shifts\": [\n {\n \"hourly\": {\n \"hours\": 10,\n \"wage\": 33,\n \"custom_name\": \"hourly\"\n },\n \"overtime\": {\n \"hours\": 2\n },\n \"time\": \"2023-3-29\"\n }\n ],\n \"companyID\": \"fc235f092bwe46aa8a082f357715bcfa\",\n \"employeeCheckID\": \"f251842623e942d6bab6ad2bca436d95\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zeal.com/shifts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"shifts\": [\n {\n \"hourly\": {\n \"hours\": 10,\n \"wage\": 33,\n \"custom_name\": \"hourly\"\n },\n \"overtime\": {\n \"hours\": 2\n },\n \"time\": \"2023-3-29\"\n }\n ],\n \"companyID\": \"fc235f092bwe46aa8a082f357715bcfa\",\n \"employeeCheckID\": \"f251842623e942d6bab6ad2bca436d95\"\n}"
response = http.request(request)
puts response.read_body"{\n \"success\": true,\n \"data\": {\n \"employeeCheckID\": \"9827465739\",\n \"employerCheckID\": null,\n \"companyID\": \"1b5n28nrideucd24\",\n \"employeeID\": \"1234567890\",\n \"status\": \"pending\",\n \"first_name\": \"erlich\",\n \"middle_initial\": null,\n \"last_name\": \"bachman\",\n \"reportingPeriodID\": \"0982349584387523234\",\n \"check_date\": \"2023-10-07\",\n \"metadata\": {\n \"checkCorrelationID\": \"1\"\n },\n \"disbursement\": {\n \"method\": \"direct_deposit\"\n },\n \"net_pay\": null,\n \"taxes\": null,\n \"total_employer_taxes\": null,\n \"total_employee_taxes\": null,\n \"shifts\": [\n {\n \"employeeID\": \"1234567890\",\n \"shiftID\": \"123456789\",\n \"first_name\": \"erlich\",\n \"last_name\": \"bachman\",\n \"metadata\": {},\n \"time\": \"2023-01-12T10:00:00\",\n\t\t\t\t\"workLocationID\": \"bcc34345ereretwe3rw31234ee\",\n \"hourly\": {\n \"hours\": 2,\n \"wage\": 20\n }\n }\n ]\n }\n}"{
"success": false,
"errors": [
{
"message": "Shift object(s) is missing required fields or has improperly formatted data",
"code": 13
}
]
}