Orders
Get Worker Orders
Returns a paginated list of orders for a specific worker.
GET
/
workers
/
{id}
/
orders
Get Worker Orders
curl --request GET \
--url https://api.roostedhr.com/api/1_12/workers/{id}/orders \
--header 'X-API-KEY: <api-key>'import requests
url = "https://api.roostedhr.com/api/1_12/workers/{id}/orders"
headers = {"X-API-KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-KEY': '<api-key>'}};
fetch('https://api.roostedhr.com/api/1_12/workers/{id}/orders', 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.roostedhr.com/api/1_12/workers/{id}/orders",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-KEY: <api-key>"
],
]);
$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.roostedhr.com/api/1_12/workers/{id}/orders"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-KEY", "<api-key>")
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.roostedhr.com/api/1_12/workers/{id}/orders")
.header("X-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.roostedhr.com/api/1_12/workers/{id}/orders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"orders": [
{
"id": "<string>",
"personnel_id": "<string>",
"company_id": "<string>",
"ordering_personnel_id": "<string>",
"companies_personnel_orderables_id": "<string>",
"name": "<string>",
"cost": "<string>",
"date": "<string>",
"formatted_date": "<string>",
"response_message": "<string>",
"submitter": "<string>",
"reach_out_email": "<string>",
"deduction_types_id": "<string>",
"status_datetime": "<string>"
}
],
"total": 123
}{
"code": "WRK-1300",
"error": "Invalid orderable item ID."
}{
"code": "ATH-100",
"error": "Invalid or missing API key."
}{
"code": "WRK-800",
"error": "Insufficient permissions to manage workers."
}{
"code": "WRK-300",
"error": "Worker not found."
}{
"code": "WRK-900",
"error": "An unexpected error occurred."
}This endpoint is paginated. Use
items_per_page and page query parameters to control results.Previous
Create Worker OrderCreates an order for a specific worker. The `id` in the request body refers to the orderable item ID from configuration, and `p_id` is the worker's personnel ID.
Next
⌘I
Get Worker Orders
curl --request GET \
--url https://api.roostedhr.com/api/1_12/workers/{id}/orders \
--header 'X-API-KEY: <api-key>'import requests
url = "https://api.roostedhr.com/api/1_12/workers/{id}/orders"
headers = {"X-API-KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-KEY': '<api-key>'}};
fetch('https://api.roostedhr.com/api/1_12/workers/{id}/orders', 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.roostedhr.com/api/1_12/workers/{id}/orders",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-KEY: <api-key>"
],
]);
$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.roostedhr.com/api/1_12/workers/{id}/orders"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-KEY", "<api-key>")
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.roostedhr.com/api/1_12/workers/{id}/orders")
.header("X-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.roostedhr.com/api/1_12/workers/{id}/orders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"orders": [
{
"id": "<string>",
"personnel_id": "<string>",
"company_id": "<string>",
"ordering_personnel_id": "<string>",
"companies_personnel_orderables_id": "<string>",
"name": "<string>",
"cost": "<string>",
"date": "<string>",
"formatted_date": "<string>",
"response_message": "<string>",
"submitter": "<string>",
"reach_out_email": "<string>",
"deduction_types_id": "<string>",
"status_datetime": "<string>"
}
],
"total": 123
}{
"code": "WRK-1300",
"error": "Invalid orderable item ID."
}{
"code": "ATH-100",
"error": "Invalid or missing API key."
}{
"code": "WRK-800",
"error": "Insufficient permissions to manage workers."
}{
"code": "WRK-300",
"error": "Worker not found."
}{
"code": "WRK-900",
"error": "An unexpected error occurred."
}