Wage Rules
Create Wage Rule
Creates a new wage rule.
POST
/
wage-rules
Create Wage Rule
curl --request POST \
--url https://api.roostedhr.com/api/1_12/wage-rules \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"name": "Test Wage Rule",
"default_wage": 10.99
}
'import requests
url = "https://api.roostedhr.com/api/1_12/wage-rules"
payload = {
"name": "Test Wage Rule",
"default_wage": 10.99
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'Test Wage Rule', default_wage: 10.99})
};
fetch('https://api.roostedhr.com/api/1_12/wage-rules', 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/wage-rules",
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([
'name' => 'Test Wage Rule',
'default_wage' => 10.99
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.roostedhr.com/api/1_12/wage-rules"
payload := strings.NewReader("{\n \"name\": \"Test Wage Rule\",\n \"default_wage\": 10.99\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<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.roostedhr.com/api/1_12/wage-rules")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Test Wage Rule\",\n \"default_wage\": 10.99\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.roostedhr.com/api/1_12/wage-rules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Test Wage Rule\",\n \"default_wage\": 10.99\n}"
response = http.request(request)
puts response.read_body{
"id": "TGJzm",
"name": "TWR001",
"default_wage": 10.56,
"deleted": 0,
"insert_date": "Jan 9, 2024",
"pending": false,
"updateError": false,
"deleteError": false
}Authorizations
Body
application/json
Wage Rule Request Body
Response
Created
A wage rule used to define default wage rates.
Unique wage rule identifier.
Name of the wage rule.
Default wage amount.
Soft-delete flag (0 = active, 1 = deleted).
Required range:
0 <= x <= 1Date the wage rule was created.
Whether the wage rule is pending.
Whether the last update had an error.
Whether the last delete had an error.
⌘I
Create Wage Rule
curl --request POST \
--url https://api.roostedhr.com/api/1_12/wage-rules \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"name": "Test Wage Rule",
"default_wage": 10.99
}
'import requests
url = "https://api.roostedhr.com/api/1_12/wage-rules"
payload = {
"name": "Test Wage Rule",
"default_wage": 10.99
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'Test Wage Rule', default_wage: 10.99})
};
fetch('https://api.roostedhr.com/api/1_12/wage-rules', 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/wage-rules",
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([
'name' => 'Test Wage Rule',
'default_wage' => 10.99
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.roostedhr.com/api/1_12/wage-rules"
payload := strings.NewReader("{\n \"name\": \"Test Wage Rule\",\n \"default_wage\": 10.99\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<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.roostedhr.com/api/1_12/wage-rules")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Test Wage Rule\",\n \"default_wage\": 10.99\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.roostedhr.com/api/1_12/wage-rules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Test Wage Rule\",\n \"default_wage\": 10.99\n}"
response = http.request(request)
puts response.read_body{
"id": "TGJzm",
"name": "TWR001",
"default_wage": 10.56,
"deleted": 0,
"insert_date": "Jan 9, 2024",
"pending": false,
"updateError": false,
"deleteError": false
}