Update a job
PATCH/api/v1/jobs/{id}
Changes an existing job: its customer or property, title, description, price lines (items_attributes), discount, currency, internal notes or how it is billed (billing). Send only the fields to change. The job's visits are scheduled and changed through the visit operations, not here. An active or completed job accepts every field, so a completed job can be priced and invoiced without reopening it. A cancelled job accepts only billing (with lock_version), so it can be set to none ("Don’t invoice"); any other field returns 409. The customer cannot change once the job has an invoice (409). Billing cannot change once a visit has been invoiced (422). A job from a quote whose deposit has been invoiced keeps that invoice's currency: another returns 409 invalid_transition.
- Needs an API key, and runs with the access of the member who made the key.
- Send an
Idempotency-Key. The same key with the same request within 24 hours gives the first answer again and changes nothing. - A connected AI assistant can use it too, as
updateJob.
Parameters
In the address
idstring (uuid)required
Headers
Idempotency-KeystringrequiredUnique user-scoped key for safely retrying this mutation for 24 hours.
At least 1 character. Up to 200 characters.
Request body
Sent as application/json.
jobobjectrequiredFields(10)
customer_idstring (uuid)property_idstring (uuid) or nulltitlestringdescriptionstring or nullcurrencystringAt least 3 characters. Up to 3 characters.
discount_centsinteger (int64)Integer minor currency units, such as pence.
At least 0.
internal_notesstring or nullbillingstringOnce a visit of the job has been invoiced it can only move between `per_visit` and `monthly`; any other change returns 422.
One of: on_completion, per_visit, none, monthly. Default: "on_completion".
lock_versionintegerAt least 0.
items_attributesarray of objectEach item(10)
idstring (uuid)service_idstring (uuid) or nullpositionintegerAt least 0.
descriptionstringquantitystringMatches ^\d{1,9}(\.\d{1,3})?$.
unit_namestring or nullunit_price_centsinteger (int64)Integer minor currency units, such as pence.
At least 0.
tax_rate_basis_pointsintegerAt least 0. At most 10000.
tax_inclusiveboolean_destroyboolean
Responses
200Job details.
dataobjectrequiredFields(24)
lock_versionintegerrequiredAt least 0.
created_atstring (date-time)requiredupdated_atstring (date-time)requiredidstring (uuid)requiredaccount_idstring (uuid)requiredcustomer_idstring (uuid)requiredproperty_idstring (uuid) or nullsource_quote_idstring (uuid) or nullnumberstringrequiredtitlestringrequireddescriptionstring or nullstatusstringrequiredOne of: active, completed, cancelled.
billingstringrequired`on_completion`: one invoice once the job is complete. `per_visit`: job lines are the price of one visit, and the job is invoiced batch by batch as visits are completed while it stays active. `none`: "Don’t invoice", for work paid another way or done for free; the job is never invoiced. `monthly`: "At month end". Priced and invoiced exactly as `per_visit` is, but its completed visits are meant to wait until their month is over: a visit is due for invoicing once the day it was booked for is before the first day of the current month, in the account's time zone. createMonthEndInvoices invoices every such job at once.
One of: on_completion, per_visit, none, monthly. Default: "on_completion".
currencystringrequiredsubtotal_centsinteger (int64)requiredInteger minor currency units, such as pence.
At least 0.
discount_centsinteger (int64)requiredInteger minor currency units, such as pence.
At least 0.
tax_centsinteger (int64)requiredInteger minor currency units, such as pence.
At least 0.
total_centsinteger (int64)requiredInteger minor currency units, such as pence.
At least 0.
internal_notesstring or nullcompleted_atstring (date-time) or nullcancelled_atstring (date-time) or nullarchived_atstring (date-time) or nullitemsarray of objectrequiredEach item(12)
idstring (uuid)requiredservice_idstring (uuid) or nullpositionintegerrequireddescriptionstringrequiredquantitystringrequiredMatches ^\d{1,9}(\.\d{1,3})?$.
unit_namestring or nullunit_price_centsinteger (int64)requiredInteger minor currency units, such as pence.
At least 0.
tax_rate_basis_pointsintegerrequiredAt least 0. At most 10000.
tax_inclusivebooleanrequiredsubtotal_centsinteger (int64)requiredInteger minor currency units, such as pence.
At least 0.
tax_centsinteger (int64)requiredInteger minor currency units, such as pence.
At least 0.
total_centsinteger (int64)requiredInteger minor currency units, such as pence.
At least 0.
repeatsarray of objectThe repeating visits still running on this job, oldest first: every series with dates left to book. A series for part of the year is listed between its seasons, when the job has no visit booked. A series whose every date is booked is not listed; its visits still carry it.
Each item(8)
idstring (uuid)requiredintervalintegerrequiredAt least 1. At most 99.
unitstringrequired`weekday` is Monday to Friday, one visit per working day, and needs an interval of 1.
One of: day, weekday, week, month.
starts_onstring (date)requiredends_onstring (date) or nullseason_from_monthinteger or null`season_from_month` and `season_to_month` are the first and last month of the part of the year a series runs in, 1 for January to 12 for December, both included. Give both or neither. A season may run over the year end: 11 and 2 is November to February. Dates outside it are skipped; the rhythm is not restarted.
At least 1. At most 12.
season_to_monthinteger or null`season_from_month` and `season_to_month` are the first and last month of the part of the year a series runs in, 1 for January to 12 for December, both included. Give both or neither. A season may run over the year end: 11 and 2 is November to February. Dates outside it are skipped; the rhythm is not restarted.
At least 1. At most 12.
lock_versionintegerrequiredAt least 0.
A refusal answers in the one error shape every operation shares.
Example
A request our own tests send. The ids are made up: put your own in their place.
curl -X PATCH "https://app.tradesender.co.uk/api/v1/jobs/4088bebb-3a71-586f-922c-1612b3fa6557" \
-H "Authorization: Bearer $TRADESENDER_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"job": {
"internal_notes": "Bring the long-reach trimmer."
}
}'