Update a draft quote
PATCH/api/v1/quotes/{id}
- 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
updateQuote.
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.
quoteobjectrequiredFields(12)
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.
deposit_centsinteger (int64)A deposit to ask for when the quote is accepted, tax included. 0, the default, asks for none. Never more than the quote's `total_cents`: a larger one is refused with 422. Like the rest of a quote, it can be changed only while the quote is a draft.
At least 0.
valid_untilstring (date) or nulltermsstring or nullnotesstring or nulllock_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
200Quote details.
dataobjectrequiredFields(31)
lock_versionintegerrequiredAt least 0.
created_atstring (date-time)requiredupdated_atstring (date-time)requiredidstring (uuid)requiredsource_visit_idstring (uuid) or nullAssessment which produced this quote; retained when archived or converted to a job.
account_idstring (uuid)requiredcustomer_idstring (uuid)requiredproperty_idstring (uuid) or nullnumberstringrequiredtitlestringrequireddescriptionstring or nullstatusstringrequiredOne of: draft, sent, accepted, declined.
expiredbooleanrequiredcurrencystringrequiredsubtotal_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.
deposit_centsinteger (int64)The deposit asked for when the quote is accepted, tax included; 0 when none is. Accepting the quote issues an invoice of `kind` `deposit` for it, which carries this quote's `quote_id`.
At least 0.
valid_untilstring (date) or nullsent_atstring (date-time) or nullsent_to_emailstring (email) or nullWhere the quote was last emailed.
email_messagestringThe note the quote is emailed with unless the sender edits it, from the account's template. [Link] and any placeholder without a value yet are filled in on sending.
public_urlstring (uri) or nullThe customer's link. Null while the quote is a draft or archived.
accepted_atstring (date-time) or nullaccepted_by_namestring or nullaccepted_by_emailstring (email) or nulldeclined_atstring (date-time) or nulltermsstring or nullnotesstring 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.
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/quotes/7b5058e5-2d85-572f-8904-aff17cc66328" \
-H "Authorization: Bearer $TRADESENDER_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"quote": {
"notes": "The price holds for 30 days."
}
}'