Creates a contract with its service lines.
Name, ClientId and at least one service line are required; each line needs
Name and LaborTermsId, plus the one details object matching its labor terms
(none for No Labor Terms). A setting a labor term can’t have is a 400 naming it, where the
app would silently turn it off. Every id is checked against the service provider, and the
client’s own locations and contacts, before anything is written.
Line items need ItemId and Quantity; the rest falls back to the item’s own
values. Amounts, tax and the recurring totals are calculated. A Block Hours line also raises a
Draft invoice for the block and opens its hours ledger, as in the app; that invoice is listed
by GET /v1/invoices.
Returns the contract in the GET /v1/contracts/{contractId} shape.
curl --request POST \
--url https://api.usw.gorelo.io/v1/contracts \
--header 'Content-Type: application/json-patch+json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"Name": "All Labor Terms Example",
"ClientId": 88,
"IsForAllLocations": true,
"LocationIds": [
123
],
"Reference": "MSA-2025-014",
"StartDate": "2026-01-15T00:00:00.0000000+00:00",
"EndDate": "2023-11-07T05:31:56Z",
"ProrateTypeId": 0,
"AutoInvoiceTicketProducts": true,
"RepeatPeriodId": 1,
"DaysBeforeInvoiceCreation": 0,
"DaysUntilDue": 30,
"AutoApproveAndSend": true,
"ContactIds": [
123
],
"InvoiceTemplateId": 123,
"InvoiceEmailTemplateId": 123,
"BrandingThemeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ServiceLines": [
{
"Id": 88214,
"Name": "Managed Services",
"LaborTermsId": 1,
"WorkTypeIds": [
123
],
"WorkRoleIds": [
123
],
"AutoApproveTime": true,
"AutoInvoiceTime": true,
"IncludedTimeGoesToId": 1,
"UnlimitedHoursDetails": {},
"PerHourDetails": {
"RateTypeId": 2,
"HourlyRate": 150,
"CustomRates": {
"WorkRoles": [
{
"WorkRoleId": 12,
"HourlyRate": 95,
"CoaCode": "270"
}
],
"WorkTypes": [
{
"WorkTypeId": 176,
"HourlyMultiplier": 1.5,
"CoaCode": "200"
}
]
}
},
"LimitedHoursDetails": {
"ShowRemainingHoursInClientPortal": true,
"AllocatedHours": 10,
"RateTypeId": 123,
"HourlyRate": 123,
"CustomRates": {
"WorkRoles": [
{
"WorkRoleId": 12,
"HourlyRate": 95,
"CoaCode": "270"
}
],
"WorkTypes": [
{
"WorkTypeId": 176,
"HourlyMultiplier": 1.5,
"CoaCode": "200"
}
]
}
},
"BlockHoursDetails": {
"ShowRemainingHoursInClientPortal": true,
"TemplateId": 0,
"Balance": 20,
"Price": 2000,
"WarningThreshold": 20,
"OverrunThreshold": 10
},
"LineItems": [
{
"Id": 991204,
"ItemId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"Quantity": 12,
"Description": "<string>",
"UnitPrice": 24.2,
"UnitCost": 18.4,
"DiscountPercent": 123,
"TaxId": 2419,
"BillableStatusId": 123,
"StartDate": "2023-11-07T05:31:56Z",
"EndDate": "2023-11-07T05:31:56Z"
}
]
}
]
}
'import requests
url = "https://api.usw.gorelo.io/v1/contracts"
payload = {
"Name": "All Labor Terms Example",
"ClientId": 88,
"IsForAllLocations": True,
"LocationIds": [123],
"Reference": "MSA-2025-014",
"StartDate": "2026-01-15T00:00:00.0000000+00:00",
"EndDate": "2023-11-07T05:31:56Z",
"ProrateTypeId": 0,
"AutoInvoiceTicketProducts": True,
"RepeatPeriodId": 1,
"DaysBeforeInvoiceCreation": 0,
"DaysUntilDue": 30,
"AutoApproveAndSend": True,
"ContactIds": [123],
"InvoiceTemplateId": 123,
"InvoiceEmailTemplateId": 123,
"BrandingThemeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ServiceLines": [
{
"Id": 88214,
"Name": "Managed Services",
"LaborTermsId": 1,
"WorkTypeIds": [123],
"WorkRoleIds": [123],
"AutoApproveTime": True,
"AutoInvoiceTime": True,
"IncludedTimeGoesToId": 1,
"UnlimitedHoursDetails": {},
"PerHourDetails": {
"RateTypeId": 2,
"HourlyRate": 150,
"CustomRates": {
"WorkRoles": [
{
"WorkRoleId": 12,
"HourlyRate": 95,
"CoaCode": "270"
}
],
"WorkTypes": [
{
"WorkTypeId": 176,
"HourlyMultiplier": 1.5,
"CoaCode": "200"
}
]
}
},
"LimitedHoursDetails": {
"ShowRemainingHoursInClientPortal": True,
"AllocatedHours": 10,
"RateTypeId": 123,
"HourlyRate": 123,
"CustomRates": {
"WorkRoles": [
{
"WorkRoleId": 12,
"HourlyRate": 95,
"CoaCode": "270"
}
],
"WorkTypes": [
{
"WorkTypeId": 176,
"HourlyMultiplier": 1.5,
"CoaCode": "200"
}
]
}
},
"BlockHoursDetails": {
"ShowRemainingHoursInClientPortal": True,
"TemplateId": 0,
"Balance": 20,
"Price": 2000,
"WarningThreshold": 20,
"OverrunThreshold": 10
},
"LineItems": [
{
"Id": 991204,
"ItemId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"Quantity": 12,
"Description": "<string>",
"UnitPrice": 24.2,
"UnitCost": 18.4,
"DiscountPercent": 123,
"TaxId": 2419,
"BillableStatusId": 123,
"StartDate": "2023-11-07T05:31:56Z",
"EndDate": "2023-11-07T05:31:56Z"
}
]
}
]
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json-patch+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-patch+json'},
body: JSON.stringify({
Name: 'All Labor Terms Example',
ClientId: 88,
IsForAllLocations: true,
LocationIds: [123],
Reference: 'MSA-2025-014',
StartDate: '2026-01-15T00:00:00.0000000+00:00',
EndDate: '2023-11-07T05:31:56Z',
ProrateTypeId: 0,
AutoInvoiceTicketProducts: true,
RepeatPeriodId: 1,
DaysBeforeInvoiceCreation: 0,
DaysUntilDue: 30,
AutoApproveAndSend: true,
ContactIds: [123],
InvoiceTemplateId: 123,
InvoiceEmailTemplateId: 123,
BrandingThemeId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
ServiceLines: [
{
Id: 88214,
Name: 'Managed Services',
LaborTermsId: 1,
WorkTypeIds: [123],
WorkRoleIds: [123],
AutoApproveTime: true,
AutoInvoiceTime: true,
IncludedTimeGoesToId: 1,
UnlimitedHoursDetails: {},
PerHourDetails: {
RateTypeId: 2,
HourlyRate: 150,
CustomRates: {
WorkRoles: [{WorkRoleId: 12, HourlyRate: 95, CoaCode: '270'}],
WorkTypes: [{WorkTypeId: 176, HourlyMultiplier: 1.5, CoaCode: '200'}]
}
},
LimitedHoursDetails: {
ShowRemainingHoursInClientPortal: true,
AllocatedHours: 10,
RateTypeId: 123,
HourlyRate: 123,
CustomRates: {
WorkRoles: [{WorkRoleId: 12, HourlyRate: 95, CoaCode: '270'}],
WorkTypes: [{WorkTypeId: 176, HourlyMultiplier: 1.5, CoaCode: '200'}]
}
},
BlockHoursDetails: {
ShowRemainingHoursInClientPortal: true,
TemplateId: 0,
Balance: 20,
Price: 2000,
WarningThreshold: 20,
OverrunThreshold: 10
},
LineItems: [
{
Id: 991204,
ItemId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
Quantity: 12,
Description: '<string>',
UnitPrice: 24.2,
UnitCost: 18.4,
DiscountPercent: 123,
TaxId: 2419,
BillableStatusId: 123,
StartDate: '2023-11-07T05:31:56Z',
EndDate: '2023-11-07T05:31:56Z'
}
]
}
]
})
};
fetch('https://api.usw.gorelo.io/v1/contracts', 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.usw.gorelo.io/v1/contracts",
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' => 'All Labor Terms Example',
'ClientId' => 88,
'IsForAllLocations' => true,
'LocationIds' => [
123
],
'Reference' => 'MSA-2025-014',
'StartDate' => '2026-01-15T00:00:00.0000000+00:00',
'EndDate' => '2023-11-07T05:31:56Z',
'ProrateTypeId' => 0,
'AutoInvoiceTicketProducts' => true,
'RepeatPeriodId' => 1,
'DaysBeforeInvoiceCreation' => 0,
'DaysUntilDue' => 30,
'AutoApproveAndSend' => true,
'ContactIds' => [
123
],
'InvoiceTemplateId' => 123,
'InvoiceEmailTemplateId' => 123,
'BrandingThemeId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'ServiceLines' => [
[
'Id' => 88214,
'Name' => 'Managed Services',
'LaborTermsId' => 1,
'WorkTypeIds' => [
123
],
'WorkRoleIds' => [
123
],
'AutoApproveTime' => true,
'AutoInvoiceTime' => true,
'IncludedTimeGoesToId' => 1,
'UnlimitedHoursDetails' => [
],
'PerHourDetails' => [
'RateTypeId' => 2,
'HourlyRate' => 150,
'CustomRates' => [
'WorkRoles' => [
[
'WorkRoleId' => 12,
'HourlyRate' => 95,
'CoaCode' => '270'
]
],
'WorkTypes' => [
[
'WorkTypeId' => 176,
'HourlyMultiplier' => 1.5,
'CoaCode' => '200'
]
]
]
],
'LimitedHoursDetails' => [
'ShowRemainingHoursInClientPortal' => true,
'AllocatedHours' => 10,
'RateTypeId' => 123,
'HourlyRate' => 123,
'CustomRates' => [
'WorkRoles' => [
[
'WorkRoleId' => 12,
'HourlyRate' => 95,
'CoaCode' => '270'
]
],
'WorkTypes' => [
[
'WorkTypeId' => 176,
'HourlyMultiplier' => 1.5,
'CoaCode' => '200'
]
]
]
],
'BlockHoursDetails' => [
'ShowRemainingHoursInClientPortal' => true,
'TemplateId' => 0,
'Balance' => 20,
'Price' => 2000,
'WarningThreshold' => 20,
'OverrunThreshold' => 10
],
'LineItems' => [
[
'Id' => 991204,
'ItemId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'Quantity' => 12,
'Description' => '<string>',
'UnitPrice' => 24.2,
'UnitCost' => 18.4,
'DiscountPercent' => 123,
'TaxId' => 2419,
'BillableStatusId' => 123,
'StartDate' => '2023-11-07T05:31:56Z',
'EndDate' => '2023-11-07T05:31:56Z'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json-patch+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.usw.gorelo.io/v1/contracts"
payload := strings.NewReader("{\n \"Name\": \"All Labor Terms Example\",\n \"ClientId\": 88,\n \"IsForAllLocations\": true,\n \"LocationIds\": [\n 123\n ],\n \"Reference\": \"MSA-2025-014\",\n \"StartDate\": \"2026-01-15T00:00:00.0000000+00:00\",\n \"EndDate\": \"2023-11-07T05:31:56Z\",\n \"ProrateTypeId\": 0,\n \"AutoInvoiceTicketProducts\": true,\n \"RepeatPeriodId\": 1,\n \"DaysBeforeInvoiceCreation\": 0,\n \"DaysUntilDue\": 30,\n \"AutoApproveAndSend\": true,\n \"ContactIds\": [\n 123\n ],\n \"InvoiceTemplateId\": 123,\n \"InvoiceEmailTemplateId\": 123,\n \"BrandingThemeId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ServiceLines\": [\n {\n \"Id\": 88214,\n \"Name\": \"Managed Services\",\n \"LaborTermsId\": 1,\n \"WorkTypeIds\": [\n 123\n ],\n \"WorkRoleIds\": [\n 123\n ],\n \"AutoApproveTime\": true,\n \"AutoInvoiceTime\": true,\n \"IncludedTimeGoesToId\": 1,\n \"UnlimitedHoursDetails\": {},\n \"PerHourDetails\": {\n \"RateTypeId\": 2,\n \"HourlyRate\": 150,\n \"CustomRates\": {\n \"WorkRoles\": [\n {\n \"WorkRoleId\": 12,\n \"HourlyRate\": 95,\n \"CoaCode\": \"270\"\n }\n ],\n \"WorkTypes\": [\n {\n \"WorkTypeId\": 176,\n \"HourlyMultiplier\": 1.5,\n \"CoaCode\": \"200\"\n }\n ]\n }\n },\n \"LimitedHoursDetails\": {\n \"ShowRemainingHoursInClientPortal\": true,\n \"AllocatedHours\": 10,\n \"RateTypeId\": 123,\n \"HourlyRate\": 123,\n \"CustomRates\": {\n \"WorkRoles\": [\n {\n \"WorkRoleId\": 12,\n \"HourlyRate\": 95,\n \"CoaCode\": \"270\"\n }\n ],\n \"WorkTypes\": [\n {\n \"WorkTypeId\": 176,\n \"HourlyMultiplier\": 1.5,\n \"CoaCode\": \"200\"\n }\n ]\n }\n },\n \"BlockHoursDetails\": {\n \"ShowRemainingHoursInClientPortal\": true,\n \"TemplateId\": 0,\n \"Balance\": 20,\n \"Price\": 2000,\n \"WarningThreshold\": 20,\n \"OverrunThreshold\": 10\n },\n \"LineItems\": [\n {\n \"Id\": 991204,\n \"ItemId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"Quantity\": 12,\n \"Description\": \"<string>\",\n \"UnitPrice\": 24.2,\n \"UnitCost\": 18.4,\n \"DiscountPercent\": 123,\n \"TaxId\": 2419,\n \"BillableStatusId\": 123,\n \"StartDate\": \"2023-11-07T05:31:56Z\",\n \"EndDate\": \"2023-11-07T05:31:56Z\"\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json-patch+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.usw.gorelo.io/v1/contracts")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json-patch+json")
.body("{\n \"Name\": \"All Labor Terms Example\",\n \"ClientId\": 88,\n \"IsForAllLocations\": true,\n \"LocationIds\": [\n 123\n ],\n \"Reference\": \"MSA-2025-014\",\n \"StartDate\": \"2026-01-15T00:00:00.0000000+00:00\",\n \"EndDate\": \"2023-11-07T05:31:56Z\",\n \"ProrateTypeId\": 0,\n \"AutoInvoiceTicketProducts\": true,\n \"RepeatPeriodId\": 1,\n \"DaysBeforeInvoiceCreation\": 0,\n \"DaysUntilDue\": 30,\n \"AutoApproveAndSend\": true,\n \"ContactIds\": [\n 123\n ],\n \"InvoiceTemplateId\": 123,\n \"InvoiceEmailTemplateId\": 123,\n \"BrandingThemeId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ServiceLines\": [\n {\n \"Id\": 88214,\n \"Name\": \"Managed Services\",\n \"LaborTermsId\": 1,\n \"WorkTypeIds\": [\n 123\n ],\n \"WorkRoleIds\": [\n 123\n ],\n \"AutoApproveTime\": true,\n \"AutoInvoiceTime\": true,\n \"IncludedTimeGoesToId\": 1,\n \"UnlimitedHoursDetails\": {},\n \"PerHourDetails\": {\n \"RateTypeId\": 2,\n \"HourlyRate\": 150,\n \"CustomRates\": {\n \"WorkRoles\": [\n {\n \"WorkRoleId\": 12,\n \"HourlyRate\": 95,\n \"CoaCode\": \"270\"\n }\n ],\n \"WorkTypes\": [\n {\n \"WorkTypeId\": 176,\n \"HourlyMultiplier\": 1.5,\n \"CoaCode\": \"200\"\n }\n ]\n }\n },\n \"LimitedHoursDetails\": {\n \"ShowRemainingHoursInClientPortal\": true,\n \"AllocatedHours\": 10,\n \"RateTypeId\": 123,\n \"HourlyRate\": 123,\n \"CustomRates\": {\n \"WorkRoles\": [\n {\n \"WorkRoleId\": 12,\n \"HourlyRate\": 95,\n \"CoaCode\": \"270\"\n }\n ],\n \"WorkTypes\": [\n {\n \"WorkTypeId\": 176,\n \"HourlyMultiplier\": 1.5,\n \"CoaCode\": \"200\"\n }\n ]\n }\n },\n \"BlockHoursDetails\": {\n \"ShowRemainingHoursInClientPortal\": true,\n \"TemplateId\": 0,\n \"Balance\": 20,\n \"Price\": 2000,\n \"WarningThreshold\": 20,\n \"OverrunThreshold\": 10\n },\n \"LineItems\": [\n {\n \"Id\": 991204,\n \"ItemId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"Quantity\": 12,\n \"Description\": \"<string>\",\n \"UnitPrice\": 24.2,\n \"UnitCost\": 18.4,\n \"DiscountPercent\": 123,\n \"TaxId\": 2419,\n \"BillableStatusId\": 123,\n \"StartDate\": \"2023-11-07T05:31:56Z\",\n \"EndDate\": \"2023-11-07T05:31:56Z\"\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.usw.gorelo.io/v1/contracts")
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-patch+json'
request.body = "{\n \"Name\": \"All Labor Terms Example\",\n \"ClientId\": 88,\n \"IsForAllLocations\": true,\n \"LocationIds\": [\n 123\n ],\n \"Reference\": \"MSA-2025-014\",\n \"StartDate\": \"2026-01-15T00:00:00.0000000+00:00\",\n \"EndDate\": \"2023-11-07T05:31:56Z\",\n \"ProrateTypeId\": 0,\n \"AutoInvoiceTicketProducts\": true,\n \"RepeatPeriodId\": 1,\n \"DaysBeforeInvoiceCreation\": 0,\n \"DaysUntilDue\": 30,\n \"AutoApproveAndSend\": true,\n \"ContactIds\": [\n 123\n ],\n \"InvoiceTemplateId\": 123,\n \"InvoiceEmailTemplateId\": 123,\n \"BrandingThemeId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ServiceLines\": [\n {\n \"Id\": 88214,\n \"Name\": \"Managed Services\",\n \"LaborTermsId\": 1,\n \"WorkTypeIds\": [\n 123\n ],\n \"WorkRoleIds\": [\n 123\n ],\n \"AutoApproveTime\": true,\n \"AutoInvoiceTime\": true,\n \"IncludedTimeGoesToId\": 1,\n \"UnlimitedHoursDetails\": {},\n \"PerHourDetails\": {\n \"RateTypeId\": 2,\n \"HourlyRate\": 150,\n \"CustomRates\": {\n \"WorkRoles\": [\n {\n \"WorkRoleId\": 12,\n \"HourlyRate\": 95,\n \"CoaCode\": \"270\"\n }\n ],\n \"WorkTypes\": [\n {\n \"WorkTypeId\": 176,\n \"HourlyMultiplier\": 1.5,\n \"CoaCode\": \"200\"\n }\n ]\n }\n },\n \"LimitedHoursDetails\": {\n \"ShowRemainingHoursInClientPortal\": true,\n \"AllocatedHours\": 10,\n \"RateTypeId\": 123,\n \"HourlyRate\": 123,\n \"CustomRates\": {\n \"WorkRoles\": [\n {\n \"WorkRoleId\": 12,\n \"HourlyRate\": 95,\n \"CoaCode\": \"270\"\n }\n ],\n \"WorkTypes\": [\n {\n \"WorkTypeId\": 176,\n \"HourlyMultiplier\": 1.5,\n \"CoaCode\": \"200\"\n }\n ]\n }\n },\n \"BlockHoursDetails\": {\n \"ShowRemainingHoursInClientPortal\": true,\n \"TemplateId\": 0,\n \"Balance\": 20,\n \"Price\": 2000,\n \"WarningThreshold\": 20,\n \"OverrunThreshold\": 10\n },\n \"LineItems\": [\n {\n \"Id\": 991204,\n \"ItemId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"Quantity\": 12,\n \"Description\": \"<string>\",\n \"UnitPrice\": 24.2,\n \"UnitCost\": 18.4,\n \"DiscountPercent\": 123,\n \"TaxId\": 2419,\n \"BillableStatusId\": 123,\n \"StartDate\": \"2023-11-07T05:31:56Z\",\n \"EndDate\": \"2023-11-07T05:31:56Z\"\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"StatusCode": 100,
"IsSuccess": true,
"Data": {
"Id": 4021,
"Name": "All Labor Terms Example",
"Status": {
"Id": 1,
"Name": "<string>"
},
"Client": {
"Id": 1,
"Name": "<string>"
},
"LocationIds": [
123
],
"IsForAllLocations": true,
"CreatedOn": "2023-11-07T05:31:56Z",
"UpdatedOn": "2023-11-07T05:31:56Z",
"Reference": "MSA-2025-014",
"StartDate": "2023-12-25",
"EndDate": "2023-12-25",
"RepeatPeriod": {
"Id": 1,
"Name": "<string>"
},
"DaysBeforeInvoiceCreation": 123,
"DaysUntilDue": 30,
"ProrateType": {
"Id": 1,
"Name": "<string>"
},
"AutoInvoiceTicketProducts": true,
"InvoiceTemplateId": 123,
"InvoiceEmailTemplateId": 123,
"BrandingThemeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"AutoApproveAndSend": true,
"Contacts": [
{
"Id": 1,
"Name": "<string>"
}
],
"RecurringAmount": 6870,
"RecurringCost": 2981.36,
"ServiceLines": [
{
"Id": 88214,
"Name": "<string>",
"CreatedOn": "2023-11-07T05:31:56Z",
"UpdatedOn": "2023-11-07T05:31:56Z",
"LaborTerms": {
"Id": 1,
"Name": "<string>"
},
"WorkTypes": [
{
"Id": 1,
"Name": "<string>"
}
],
"WorkRoles": [
{
"Id": 1,
"Name": "<string>"
}
],
"AutoApproveTime": true,
"AutoInvoiceTime": true,
"IncludedTimeGoesTo": {
"Id": 1,
"Name": "<string>"
},
"UnlimitedHoursDetails": {},
"PerHourDetails": {
"RateType": {
"Id": 1,
"Name": "<string>"
},
"HourlyRate": 123,
"CustomRates": {
"WorkRoles": [
{
"WorkRoleId": 123,
"HourlyRate": 123,
"CoaCode": "<string>"
}
],
"WorkTypes": [
{
"WorkTypeId": 123,
"HourlyMultiplier": 123,
"CoaCode": "<string>"
}
]
}
},
"LimitedHoursDetails": {
"ShowRemainingHoursInClientPortal": true,
"AllocatedHours": 123,
"RateType": {
"Id": 1,
"Name": "<string>"
},
"HourlyRate": 123,
"CustomRates": {
"WorkRoles": [
{
"WorkRoleId": 123,
"HourlyRate": 123,
"CoaCode": "<string>"
}
],
"WorkTypes": [
{
"WorkTypeId": 123,
"HourlyMultiplier": 123,
"CoaCode": "<string>"
}
]
}
},
"BlockHoursDetails": {
"ShowRemainingHoursInClientPortal": true,
"TemplateId": 123,
"Balance": 123,
"WarningThreshold": 123,
"OverrunThreshold": 123
},
"RecurringAmount": 123,
"RecurringCost": 123,
"LineItems": [
{
"Id": 123,
"ItemId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ItemType": {
"Id": 1,
"Name": "<string>"
},
"Name": "<string>",
"Description": "<string>",
"Quantity": 123,
"UnitCost": 123,
"UnitPrice": 123,
"DiscountPercent": 123,
"StartDate": "2023-12-25",
"EndDate": "2023-12-25",
"Tax": {
"Id": 1,
"Name": "<string>"
},
"Amount": 123,
"TaxAmount": 123,
"BillableStatus": {
"Id": 1,
"Name": "<string>"
}
}
]
}
]
},
"DataContext": null,
"Notifications": [
{
"Code": "070101",
"Message": "<string>",
"PropertyName": "<string>",
"ActionHint": "<string>",
"DocUrl": "<string>"
}
]
}{
"StatusCode": 100,
"IsSuccess": true,
"Data": null,
"DataContext": {
"TraceId": "<string>"
},
"Notifications": [
{
"Code": "070101",
"Message": "<string>",
"PropertyName": "<string>",
"ActionHint": "<string>",
"DocUrl": "<string>"
}
]
}{
"StatusCode": 100,
"IsSuccess": true,
"Data": null,
"DataContext": {
"TraceId": "<string>"
},
"Notifications": [
{
"Code": "070101",
"Message": "<string>",
"PropertyName": "<string>",
"ActionHint": "<string>",
"DocUrl": "<string>"
}
]
}{
"StatusCode": 100,
"IsSuccess": true,
"Data": null,
"DataContext": {
"TraceId": "<string>"
},
"Notifications": [
{
"Code": "070101",
"Message": "<string>",
"PropertyName": "<string>",
"ActionHint": "<string>",
"DocUrl": "<string>"
}
]
}التفويضات
Your Gorelo API key. See Generate API key. If your data is hosted in Australia, click the base URL at the top of this page and select https://api.aue.gorelo.io.
الجسم
The contract to create.
Creates a contract with its service lines. Name, ClientId and at least one service line are
required; each line needs Name and LaborTermsId. Returns the contract in the
GET /v1/contracts/{contractId} shape.
الاستجابة
OK
100, 101, 102, 103, 200, 201, 202, 203, 204, 205, 206, 207, 208, 226, 300, 301, 302, 303, 304, 305, 306, 307, 308, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 421, 422, 423, 424, 426, 428, 429, 431, 451, 500, 501, 502, 503, 504, 505, 506, 507, 508, 510, 511 هل كانت هذه الصفحة مفيدة؟
curl --request POST \
--url https://api.usw.gorelo.io/v1/contracts \
--header 'Content-Type: application/json-patch+json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"Name": "All Labor Terms Example",
"ClientId": 88,
"IsForAllLocations": true,
"LocationIds": [
123
],
"Reference": "MSA-2025-014",
"StartDate": "2026-01-15T00:00:00.0000000+00:00",
"EndDate": "2023-11-07T05:31:56Z",
"ProrateTypeId": 0,
"AutoInvoiceTicketProducts": true,
"RepeatPeriodId": 1,
"DaysBeforeInvoiceCreation": 0,
"DaysUntilDue": 30,
"AutoApproveAndSend": true,
"ContactIds": [
123
],
"InvoiceTemplateId": 123,
"InvoiceEmailTemplateId": 123,
"BrandingThemeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ServiceLines": [
{
"Id": 88214,
"Name": "Managed Services",
"LaborTermsId": 1,
"WorkTypeIds": [
123
],
"WorkRoleIds": [
123
],
"AutoApproveTime": true,
"AutoInvoiceTime": true,
"IncludedTimeGoesToId": 1,
"UnlimitedHoursDetails": {},
"PerHourDetails": {
"RateTypeId": 2,
"HourlyRate": 150,
"CustomRates": {
"WorkRoles": [
{
"WorkRoleId": 12,
"HourlyRate": 95,
"CoaCode": "270"
}
],
"WorkTypes": [
{
"WorkTypeId": 176,
"HourlyMultiplier": 1.5,
"CoaCode": "200"
}
]
}
},
"LimitedHoursDetails": {
"ShowRemainingHoursInClientPortal": true,
"AllocatedHours": 10,
"RateTypeId": 123,
"HourlyRate": 123,
"CustomRates": {
"WorkRoles": [
{
"WorkRoleId": 12,
"HourlyRate": 95,
"CoaCode": "270"
}
],
"WorkTypes": [
{
"WorkTypeId": 176,
"HourlyMultiplier": 1.5,
"CoaCode": "200"
}
]
}
},
"BlockHoursDetails": {
"ShowRemainingHoursInClientPortal": true,
"TemplateId": 0,
"Balance": 20,
"Price": 2000,
"WarningThreshold": 20,
"OverrunThreshold": 10
},
"LineItems": [
{
"Id": 991204,
"ItemId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"Quantity": 12,
"Description": "<string>",
"UnitPrice": 24.2,
"UnitCost": 18.4,
"DiscountPercent": 123,
"TaxId": 2419,
"BillableStatusId": 123,
"StartDate": "2023-11-07T05:31:56Z",
"EndDate": "2023-11-07T05:31:56Z"
}
]
}
]
}
'import requests
url = "https://api.usw.gorelo.io/v1/contracts"
payload = {
"Name": "All Labor Terms Example",
"ClientId": 88,
"IsForAllLocations": True,
"LocationIds": [123],
"Reference": "MSA-2025-014",
"StartDate": "2026-01-15T00:00:00.0000000+00:00",
"EndDate": "2023-11-07T05:31:56Z",
"ProrateTypeId": 0,
"AutoInvoiceTicketProducts": True,
"RepeatPeriodId": 1,
"DaysBeforeInvoiceCreation": 0,
"DaysUntilDue": 30,
"AutoApproveAndSend": True,
"ContactIds": [123],
"InvoiceTemplateId": 123,
"InvoiceEmailTemplateId": 123,
"BrandingThemeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ServiceLines": [
{
"Id": 88214,
"Name": "Managed Services",
"LaborTermsId": 1,
"WorkTypeIds": [123],
"WorkRoleIds": [123],
"AutoApproveTime": True,
"AutoInvoiceTime": True,
"IncludedTimeGoesToId": 1,
"UnlimitedHoursDetails": {},
"PerHourDetails": {
"RateTypeId": 2,
"HourlyRate": 150,
"CustomRates": {
"WorkRoles": [
{
"WorkRoleId": 12,
"HourlyRate": 95,
"CoaCode": "270"
}
],
"WorkTypes": [
{
"WorkTypeId": 176,
"HourlyMultiplier": 1.5,
"CoaCode": "200"
}
]
}
},
"LimitedHoursDetails": {
"ShowRemainingHoursInClientPortal": True,
"AllocatedHours": 10,
"RateTypeId": 123,
"HourlyRate": 123,
"CustomRates": {
"WorkRoles": [
{
"WorkRoleId": 12,
"HourlyRate": 95,
"CoaCode": "270"
}
],
"WorkTypes": [
{
"WorkTypeId": 176,
"HourlyMultiplier": 1.5,
"CoaCode": "200"
}
]
}
},
"BlockHoursDetails": {
"ShowRemainingHoursInClientPortal": True,
"TemplateId": 0,
"Balance": 20,
"Price": 2000,
"WarningThreshold": 20,
"OverrunThreshold": 10
},
"LineItems": [
{
"Id": 991204,
"ItemId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"Quantity": 12,
"Description": "<string>",
"UnitPrice": 24.2,
"UnitCost": 18.4,
"DiscountPercent": 123,
"TaxId": 2419,
"BillableStatusId": 123,
"StartDate": "2023-11-07T05:31:56Z",
"EndDate": "2023-11-07T05:31:56Z"
}
]
}
]
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json-patch+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-patch+json'},
body: JSON.stringify({
Name: 'All Labor Terms Example',
ClientId: 88,
IsForAllLocations: true,
LocationIds: [123],
Reference: 'MSA-2025-014',
StartDate: '2026-01-15T00:00:00.0000000+00:00',
EndDate: '2023-11-07T05:31:56Z',
ProrateTypeId: 0,
AutoInvoiceTicketProducts: true,
RepeatPeriodId: 1,
DaysBeforeInvoiceCreation: 0,
DaysUntilDue: 30,
AutoApproveAndSend: true,
ContactIds: [123],
InvoiceTemplateId: 123,
InvoiceEmailTemplateId: 123,
BrandingThemeId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
ServiceLines: [
{
Id: 88214,
Name: 'Managed Services',
LaborTermsId: 1,
WorkTypeIds: [123],
WorkRoleIds: [123],
AutoApproveTime: true,
AutoInvoiceTime: true,
IncludedTimeGoesToId: 1,
UnlimitedHoursDetails: {},
PerHourDetails: {
RateTypeId: 2,
HourlyRate: 150,
CustomRates: {
WorkRoles: [{WorkRoleId: 12, HourlyRate: 95, CoaCode: '270'}],
WorkTypes: [{WorkTypeId: 176, HourlyMultiplier: 1.5, CoaCode: '200'}]
}
},
LimitedHoursDetails: {
ShowRemainingHoursInClientPortal: true,
AllocatedHours: 10,
RateTypeId: 123,
HourlyRate: 123,
CustomRates: {
WorkRoles: [{WorkRoleId: 12, HourlyRate: 95, CoaCode: '270'}],
WorkTypes: [{WorkTypeId: 176, HourlyMultiplier: 1.5, CoaCode: '200'}]
}
},
BlockHoursDetails: {
ShowRemainingHoursInClientPortal: true,
TemplateId: 0,
Balance: 20,
Price: 2000,
WarningThreshold: 20,
OverrunThreshold: 10
},
LineItems: [
{
Id: 991204,
ItemId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
Quantity: 12,
Description: '<string>',
UnitPrice: 24.2,
UnitCost: 18.4,
DiscountPercent: 123,
TaxId: 2419,
BillableStatusId: 123,
StartDate: '2023-11-07T05:31:56Z',
EndDate: '2023-11-07T05:31:56Z'
}
]
}
]
})
};
fetch('https://api.usw.gorelo.io/v1/contracts', 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.usw.gorelo.io/v1/contracts",
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' => 'All Labor Terms Example',
'ClientId' => 88,
'IsForAllLocations' => true,
'LocationIds' => [
123
],
'Reference' => 'MSA-2025-014',
'StartDate' => '2026-01-15T00:00:00.0000000+00:00',
'EndDate' => '2023-11-07T05:31:56Z',
'ProrateTypeId' => 0,
'AutoInvoiceTicketProducts' => true,
'RepeatPeriodId' => 1,
'DaysBeforeInvoiceCreation' => 0,
'DaysUntilDue' => 30,
'AutoApproveAndSend' => true,
'ContactIds' => [
123
],
'InvoiceTemplateId' => 123,
'InvoiceEmailTemplateId' => 123,
'BrandingThemeId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'ServiceLines' => [
[
'Id' => 88214,
'Name' => 'Managed Services',
'LaborTermsId' => 1,
'WorkTypeIds' => [
123
],
'WorkRoleIds' => [
123
],
'AutoApproveTime' => true,
'AutoInvoiceTime' => true,
'IncludedTimeGoesToId' => 1,
'UnlimitedHoursDetails' => [
],
'PerHourDetails' => [
'RateTypeId' => 2,
'HourlyRate' => 150,
'CustomRates' => [
'WorkRoles' => [
[
'WorkRoleId' => 12,
'HourlyRate' => 95,
'CoaCode' => '270'
]
],
'WorkTypes' => [
[
'WorkTypeId' => 176,
'HourlyMultiplier' => 1.5,
'CoaCode' => '200'
]
]
]
],
'LimitedHoursDetails' => [
'ShowRemainingHoursInClientPortal' => true,
'AllocatedHours' => 10,
'RateTypeId' => 123,
'HourlyRate' => 123,
'CustomRates' => [
'WorkRoles' => [
[
'WorkRoleId' => 12,
'HourlyRate' => 95,
'CoaCode' => '270'
]
],
'WorkTypes' => [
[
'WorkTypeId' => 176,
'HourlyMultiplier' => 1.5,
'CoaCode' => '200'
]
]
]
],
'BlockHoursDetails' => [
'ShowRemainingHoursInClientPortal' => true,
'TemplateId' => 0,
'Balance' => 20,
'Price' => 2000,
'WarningThreshold' => 20,
'OverrunThreshold' => 10
],
'LineItems' => [
[
'Id' => 991204,
'ItemId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'Quantity' => 12,
'Description' => '<string>',
'UnitPrice' => 24.2,
'UnitCost' => 18.4,
'DiscountPercent' => 123,
'TaxId' => 2419,
'BillableStatusId' => 123,
'StartDate' => '2023-11-07T05:31:56Z',
'EndDate' => '2023-11-07T05:31:56Z'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json-patch+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.usw.gorelo.io/v1/contracts"
payload := strings.NewReader("{\n \"Name\": \"All Labor Terms Example\",\n \"ClientId\": 88,\n \"IsForAllLocations\": true,\n \"LocationIds\": [\n 123\n ],\n \"Reference\": \"MSA-2025-014\",\n \"StartDate\": \"2026-01-15T00:00:00.0000000+00:00\",\n \"EndDate\": \"2023-11-07T05:31:56Z\",\n \"ProrateTypeId\": 0,\n \"AutoInvoiceTicketProducts\": true,\n \"RepeatPeriodId\": 1,\n \"DaysBeforeInvoiceCreation\": 0,\n \"DaysUntilDue\": 30,\n \"AutoApproveAndSend\": true,\n \"ContactIds\": [\n 123\n ],\n \"InvoiceTemplateId\": 123,\n \"InvoiceEmailTemplateId\": 123,\n \"BrandingThemeId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ServiceLines\": [\n {\n \"Id\": 88214,\n \"Name\": \"Managed Services\",\n \"LaborTermsId\": 1,\n \"WorkTypeIds\": [\n 123\n ],\n \"WorkRoleIds\": [\n 123\n ],\n \"AutoApproveTime\": true,\n \"AutoInvoiceTime\": true,\n \"IncludedTimeGoesToId\": 1,\n \"UnlimitedHoursDetails\": {},\n \"PerHourDetails\": {\n \"RateTypeId\": 2,\n \"HourlyRate\": 150,\n \"CustomRates\": {\n \"WorkRoles\": [\n {\n \"WorkRoleId\": 12,\n \"HourlyRate\": 95,\n \"CoaCode\": \"270\"\n }\n ],\n \"WorkTypes\": [\n {\n \"WorkTypeId\": 176,\n \"HourlyMultiplier\": 1.5,\n \"CoaCode\": \"200\"\n }\n ]\n }\n },\n \"LimitedHoursDetails\": {\n \"ShowRemainingHoursInClientPortal\": true,\n \"AllocatedHours\": 10,\n \"RateTypeId\": 123,\n \"HourlyRate\": 123,\n \"CustomRates\": {\n \"WorkRoles\": [\n {\n \"WorkRoleId\": 12,\n \"HourlyRate\": 95,\n \"CoaCode\": \"270\"\n }\n ],\n \"WorkTypes\": [\n {\n \"WorkTypeId\": 176,\n \"HourlyMultiplier\": 1.5,\n \"CoaCode\": \"200\"\n }\n ]\n }\n },\n \"BlockHoursDetails\": {\n \"ShowRemainingHoursInClientPortal\": true,\n \"TemplateId\": 0,\n \"Balance\": 20,\n \"Price\": 2000,\n \"WarningThreshold\": 20,\n \"OverrunThreshold\": 10\n },\n \"LineItems\": [\n {\n \"Id\": 991204,\n \"ItemId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"Quantity\": 12,\n \"Description\": \"<string>\",\n \"UnitPrice\": 24.2,\n \"UnitCost\": 18.4,\n \"DiscountPercent\": 123,\n \"TaxId\": 2419,\n \"BillableStatusId\": 123,\n \"StartDate\": \"2023-11-07T05:31:56Z\",\n \"EndDate\": \"2023-11-07T05:31:56Z\"\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json-patch+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.usw.gorelo.io/v1/contracts")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json-patch+json")
.body("{\n \"Name\": \"All Labor Terms Example\",\n \"ClientId\": 88,\n \"IsForAllLocations\": true,\n \"LocationIds\": [\n 123\n ],\n \"Reference\": \"MSA-2025-014\",\n \"StartDate\": \"2026-01-15T00:00:00.0000000+00:00\",\n \"EndDate\": \"2023-11-07T05:31:56Z\",\n \"ProrateTypeId\": 0,\n \"AutoInvoiceTicketProducts\": true,\n \"RepeatPeriodId\": 1,\n \"DaysBeforeInvoiceCreation\": 0,\n \"DaysUntilDue\": 30,\n \"AutoApproveAndSend\": true,\n \"ContactIds\": [\n 123\n ],\n \"InvoiceTemplateId\": 123,\n \"InvoiceEmailTemplateId\": 123,\n \"BrandingThemeId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ServiceLines\": [\n {\n \"Id\": 88214,\n \"Name\": \"Managed Services\",\n \"LaborTermsId\": 1,\n \"WorkTypeIds\": [\n 123\n ],\n \"WorkRoleIds\": [\n 123\n ],\n \"AutoApproveTime\": true,\n \"AutoInvoiceTime\": true,\n \"IncludedTimeGoesToId\": 1,\n \"UnlimitedHoursDetails\": {},\n \"PerHourDetails\": {\n \"RateTypeId\": 2,\n \"HourlyRate\": 150,\n \"CustomRates\": {\n \"WorkRoles\": [\n {\n \"WorkRoleId\": 12,\n \"HourlyRate\": 95,\n \"CoaCode\": \"270\"\n }\n ],\n \"WorkTypes\": [\n {\n \"WorkTypeId\": 176,\n \"HourlyMultiplier\": 1.5,\n \"CoaCode\": \"200\"\n }\n ]\n }\n },\n \"LimitedHoursDetails\": {\n \"ShowRemainingHoursInClientPortal\": true,\n \"AllocatedHours\": 10,\n \"RateTypeId\": 123,\n \"HourlyRate\": 123,\n \"CustomRates\": {\n \"WorkRoles\": [\n {\n \"WorkRoleId\": 12,\n \"HourlyRate\": 95,\n \"CoaCode\": \"270\"\n }\n ],\n \"WorkTypes\": [\n {\n \"WorkTypeId\": 176,\n \"HourlyMultiplier\": 1.5,\n \"CoaCode\": \"200\"\n }\n ]\n }\n },\n \"BlockHoursDetails\": {\n \"ShowRemainingHoursInClientPortal\": true,\n \"TemplateId\": 0,\n \"Balance\": 20,\n \"Price\": 2000,\n \"WarningThreshold\": 20,\n \"OverrunThreshold\": 10\n },\n \"LineItems\": [\n {\n \"Id\": 991204,\n \"ItemId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"Quantity\": 12,\n \"Description\": \"<string>\",\n \"UnitPrice\": 24.2,\n \"UnitCost\": 18.4,\n \"DiscountPercent\": 123,\n \"TaxId\": 2419,\n \"BillableStatusId\": 123,\n \"StartDate\": \"2023-11-07T05:31:56Z\",\n \"EndDate\": \"2023-11-07T05:31:56Z\"\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.usw.gorelo.io/v1/contracts")
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-patch+json'
request.body = "{\n \"Name\": \"All Labor Terms Example\",\n \"ClientId\": 88,\n \"IsForAllLocations\": true,\n \"LocationIds\": [\n 123\n ],\n \"Reference\": \"MSA-2025-014\",\n \"StartDate\": \"2026-01-15T00:00:00.0000000+00:00\",\n \"EndDate\": \"2023-11-07T05:31:56Z\",\n \"ProrateTypeId\": 0,\n \"AutoInvoiceTicketProducts\": true,\n \"RepeatPeriodId\": 1,\n \"DaysBeforeInvoiceCreation\": 0,\n \"DaysUntilDue\": 30,\n \"AutoApproveAndSend\": true,\n \"ContactIds\": [\n 123\n ],\n \"InvoiceTemplateId\": 123,\n \"InvoiceEmailTemplateId\": 123,\n \"BrandingThemeId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ServiceLines\": [\n {\n \"Id\": 88214,\n \"Name\": \"Managed Services\",\n \"LaborTermsId\": 1,\n \"WorkTypeIds\": [\n 123\n ],\n \"WorkRoleIds\": [\n 123\n ],\n \"AutoApproveTime\": true,\n \"AutoInvoiceTime\": true,\n \"IncludedTimeGoesToId\": 1,\n \"UnlimitedHoursDetails\": {},\n \"PerHourDetails\": {\n \"RateTypeId\": 2,\n \"HourlyRate\": 150,\n \"CustomRates\": {\n \"WorkRoles\": [\n {\n \"WorkRoleId\": 12,\n \"HourlyRate\": 95,\n \"CoaCode\": \"270\"\n }\n ],\n \"WorkTypes\": [\n {\n \"WorkTypeId\": 176,\n \"HourlyMultiplier\": 1.5,\n \"CoaCode\": \"200\"\n }\n ]\n }\n },\n \"LimitedHoursDetails\": {\n \"ShowRemainingHoursInClientPortal\": true,\n \"AllocatedHours\": 10,\n \"RateTypeId\": 123,\n \"HourlyRate\": 123,\n \"CustomRates\": {\n \"WorkRoles\": [\n {\n \"WorkRoleId\": 12,\n \"HourlyRate\": 95,\n \"CoaCode\": \"270\"\n }\n ],\n \"WorkTypes\": [\n {\n \"WorkTypeId\": 176,\n \"HourlyMultiplier\": 1.5,\n \"CoaCode\": \"200\"\n }\n ]\n }\n },\n \"BlockHoursDetails\": {\n \"ShowRemainingHoursInClientPortal\": true,\n \"TemplateId\": 0,\n \"Balance\": 20,\n \"Price\": 2000,\n \"WarningThreshold\": 20,\n \"OverrunThreshold\": 10\n },\n \"LineItems\": [\n {\n \"Id\": 991204,\n \"ItemId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"Quantity\": 12,\n \"Description\": \"<string>\",\n \"UnitPrice\": 24.2,\n \"UnitCost\": 18.4,\n \"DiscountPercent\": 123,\n \"TaxId\": 2419,\n \"BillableStatusId\": 123,\n \"StartDate\": \"2023-11-07T05:31:56Z\",\n \"EndDate\": \"2023-11-07T05:31:56Z\"\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"StatusCode": 100,
"IsSuccess": true,
"Data": {
"Id": 4021,
"Name": "All Labor Terms Example",
"Status": {
"Id": 1,
"Name": "<string>"
},
"Client": {
"Id": 1,
"Name": "<string>"
},
"LocationIds": [
123
],
"IsForAllLocations": true,
"CreatedOn": "2023-11-07T05:31:56Z",
"UpdatedOn": "2023-11-07T05:31:56Z",
"Reference": "MSA-2025-014",
"StartDate": "2023-12-25",
"EndDate": "2023-12-25",
"RepeatPeriod": {
"Id": 1,
"Name": "<string>"
},
"DaysBeforeInvoiceCreation": 123,
"DaysUntilDue": 30,
"ProrateType": {
"Id": 1,
"Name": "<string>"
},
"AutoInvoiceTicketProducts": true,
"InvoiceTemplateId": 123,
"InvoiceEmailTemplateId": 123,
"BrandingThemeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"AutoApproveAndSend": true,
"Contacts": [
{
"Id": 1,
"Name": "<string>"
}
],
"RecurringAmount": 6870,
"RecurringCost": 2981.36,
"ServiceLines": [
{
"Id": 88214,
"Name": "<string>",
"CreatedOn": "2023-11-07T05:31:56Z",
"UpdatedOn": "2023-11-07T05:31:56Z",
"LaborTerms": {
"Id": 1,
"Name": "<string>"
},
"WorkTypes": [
{
"Id": 1,
"Name": "<string>"
}
],
"WorkRoles": [
{
"Id": 1,
"Name": "<string>"
}
],
"AutoApproveTime": true,
"AutoInvoiceTime": true,
"IncludedTimeGoesTo": {
"Id": 1,
"Name": "<string>"
},
"UnlimitedHoursDetails": {},
"PerHourDetails": {
"RateType": {
"Id": 1,
"Name": "<string>"
},
"HourlyRate": 123,
"CustomRates": {
"WorkRoles": [
{
"WorkRoleId": 123,
"HourlyRate": 123,
"CoaCode": "<string>"
}
],
"WorkTypes": [
{
"WorkTypeId": 123,
"HourlyMultiplier": 123,
"CoaCode": "<string>"
}
]
}
},
"LimitedHoursDetails": {
"ShowRemainingHoursInClientPortal": true,
"AllocatedHours": 123,
"RateType": {
"Id": 1,
"Name": "<string>"
},
"HourlyRate": 123,
"CustomRates": {
"WorkRoles": [
{
"WorkRoleId": 123,
"HourlyRate": 123,
"CoaCode": "<string>"
}
],
"WorkTypes": [
{
"WorkTypeId": 123,
"HourlyMultiplier": 123,
"CoaCode": "<string>"
}
]
}
},
"BlockHoursDetails": {
"ShowRemainingHoursInClientPortal": true,
"TemplateId": 123,
"Balance": 123,
"WarningThreshold": 123,
"OverrunThreshold": 123
},
"RecurringAmount": 123,
"RecurringCost": 123,
"LineItems": [
{
"Id": 123,
"ItemId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ItemType": {
"Id": 1,
"Name": "<string>"
},
"Name": "<string>",
"Description": "<string>",
"Quantity": 123,
"UnitCost": 123,
"UnitPrice": 123,
"DiscountPercent": 123,
"StartDate": "2023-12-25",
"EndDate": "2023-12-25",
"Tax": {
"Id": 1,
"Name": "<string>"
},
"Amount": 123,
"TaxAmount": 123,
"BillableStatus": {
"Id": 1,
"Name": "<string>"
}
}
]
}
]
},
"DataContext": null,
"Notifications": [
{
"Code": "070101",
"Message": "<string>",
"PropertyName": "<string>",
"ActionHint": "<string>",
"DocUrl": "<string>"
}
]
}{
"StatusCode": 100,
"IsSuccess": true,
"Data": null,
"DataContext": {
"TraceId": "<string>"
},
"Notifications": [
{
"Code": "070101",
"Message": "<string>",
"PropertyName": "<string>",
"ActionHint": "<string>",
"DocUrl": "<string>"
}
]
}{
"StatusCode": 100,
"IsSuccess": true,
"Data": null,
"DataContext": {
"TraceId": "<string>"
},
"Notifications": [
{
"Code": "070101",
"Message": "<string>",
"PropertyName": "<string>",
"ActionHint": "<string>",
"DocUrl": "<string>"
}
]
}{
"StatusCode": 100,
"IsSuccess": true,
"Data": null,
"DataContext": {
"TraceId": "<string>"
},
"Notifications": [
{
"Code": "070101",
"Message": "<string>",
"PropertyName": "<string>",
"ActionHint": "<string>",
"DocUrl": "<string>"
}
]
}