Email a quote to the customer, or mark it as sent
POST/api/v1/quotes/{id}/send
With email, sends the customer a link to the online quote and a PDF copy, and can resend a sent or accepted quote. Without it, only records a draft as sent. A quote past its valid_until returns 409 unless the request gives it a new valid_until, after which the customer can accept it again. Emails are limited to 100 a day per account.
- 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
sendQuote.
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.
lock_versionintegerAt least 0.
emailobjectFields(3)
tostring (email)requiredmessagestring or nullReplaces the default email text (`email_message` on the quote or invoice).
Up to 2000 characters.
copy_to_senderbooleanBlind-copies the signed-in user so they keep what the customer received.
Default: false.
valid_untilstring (date)A new last day for the quote, set before it is sent, so that an expired quote can go out again and be accepted. Today or later; an earlier date returns 422. Ignored once the quote is accepted.
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 POST "https://app.tradesender.co.uk/api/v1/quotes/7b5058e5-2d85-572f-8904-aff17cc66328/send" \
-H "Authorization: Bearer $TRADESENDER_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"email": {
"to": "taylor@example.test",
"message": "Here is the quote for the hedge and borders we talked about."
}
}'