Turn an enquiry into a customer
POST/api/v1/enquiries/{id}/customer
Send customer to create one from the details you have checked, or customer_id to file the enquiry under a customer you already have. property adds a property to that customer. Returns the customer with its contacts and properties. An enquiry that already has a customer answers 409. For an enquiry of kind request, which has its customer already, this marks the request picked up. Its status becomes converted, nobody is created, and customer, customer_id and property are ignored.
- 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.
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.
customer_idstring (uuid)File the enquiry under this customer instead of creating one.
customerobjectFields(12)
lock_versionintegerAt least 0.
namestringrequiredcompany_namestring or nullemailstring (email) or nullphonestring or nullpayment_terms_daysintegerAt least 0.
notesstring or nullautomatic_emailsbooleanDeprecated: use `invoice_reminders`, `quote_follow_ups` and `visit_reminders`, which it stands for. It reads false only when all three are `off`. Writing false sets all three to `off`; writing true sets all three to `default` when they were all `off`, and otherwise changes nothing. Sent with any of the three, it is ignored. It changes nothing about emails a person sends.
Default: true. Deprecated.
invoice_remindersstringWhether this customer is reminded by email about their overdue invoices.
One of: default, on, off. Default: "default".
quote_follow_upsstringWhether this customer's quotes awaiting an answer are followed up by email.
One of: default, on, off. Default: "default".
visit_remindersstringWhether this customer is reminded by email of their visits the day before.
One of: default, on, off. Default: "default".
billing_addressobject or nullFields(6)
address_line_1stringrequiredaddress_line_2string or nullcitystringrequiredregionstring or nullpostal_codestringrequiredcountry_codestringrequiredAt least 2 characters. Up to 2 characters.
propertyobjectA property to add to the customer, usually the enquiry's address.
Fields(12)
lock_versionintegerAt least 0.
namestring or nulladdress_line_1stringrequiredaddress_line_2string or nullcitystringrequiredregionstring or nullpostal_codestringrequiredcountry_codestringDefaults to GB.
Default: "GB". At least 2 characters. Up to 2 characters.
access_notesstring or nulllawn_area_m2string or nullThe lawn at the property in square metres, with up to two decimal places, or null when it has not been measured. Use it as the quantity of lawn work priced per square metre, such as turfing. A patio or decking is priced the same way and is some other size.
Matches ^\d{1,8}(\.\d{1,2})?$.
billing_namestring or nullWho quotes and invoices for work here are addressed to, such as a letting agent. Defaults to the customer.
billing_addressobject or nullWhere quotes and invoices for work here are sent, before the customer's billing address. Omit to keep, null to clear.
Fields(6)
address_line_1stringrequiredaddress_line_2string or nullcitystringrequiredregionstring or nullpostal_codestringrequiredcountry_codestringrequiredAt least 2 characters. Up to 2 characters.
Responses
201Customer details, contacts, and properties.
dataobjectrequiredFields(20)
lock_versionintegerAt least 0.
created_atstring (date-time)requiredupdated_atstring (date-time)requiredidstring (uuid)requiredaccount_idstring (uuid)requirednamestringrequiredcompany_namestring or nullemailstring (email) or nullphonestring or nullpayment_terms_daysintegerrequiredAt least 0.
notesstring or nullautomatic_emailsbooleanDeprecated: use `invoice_reminders`, `quote_follow_ups` and `visit_reminders`, which it stands for. It reads false only when all three are `off`. Writing false sets all three to `off`; writing true sets all three to `default` when they were all `off`, and otherwise changes nothing. Sent with any of the three, it is ignored. It changes nothing about emails a person sends.
Default: true. Deprecated.
invoice_remindersstringWhether this customer is reminded by email about their overdue invoices.
One of: default, on, off. Default: "default".
quote_follow_upsstringWhether this customer's quotes awaiting an answer are followed up by email.
One of: default, on, off. Default: "default".
visit_remindersstringWhether this customer is reminded by email of their visits the day before.
One of: default, on, off. Default: "default".
billing_addressobject or nullFields(6)
address_line_1stringrequiredaddress_line_2string or nullcitystringrequiredregionstring or nullpostal_codestringrequiredcountry_codestringrequiredAt least 2 characters. Up to 2 characters.
portal_urlstring (uri) or nullThe customer's sign-in link to their customer portal. It signs them in without a password, so it is null for technicians, for AI assistants and for an archived customer. Replace it with rotateCustomerPortalKey.
Read only.
archived_atstring (date-time) or nullcontactsarray of objectrequiredEach item(12)
lock_versionintegerAt least 0.
created_atstring (date-time)requiredupdated_atstring (date-time)requiredidstring (uuid)requiredaccount_idstring (uuid)requiredcustomer_idstring (uuid)requirednamestringrequiredjob_titlestring or nullemailstring (email) or nullphonestring or nullnotesstring or nullarchived_atstring (date-time) or null
propertiesarray of objectrequiredEach item(20)
lock_versionintegerAt least 0.
created_atstring (date-time)requiredupdated_atstring (date-time)requiredidstring (uuid)requiredaccount_idstring (uuid)requiredcustomer_idstring (uuid)requirednamestring or nulladdress_line_1stringrequiredaddress_line_2string or nullcitystringrequiredregionstring or nullpostal_codestringrequiredcountry_codestringrequiredaccess_notesstring or nulllawn_area_m2string or nullThe lawn at the property in square metres, with up to two decimal places, or null when it has not been measured. Use it as the quantity of lawn work priced per square metre, such as turfing. A patio or decking is priced the same way and is some other size.
Matches ^\d{1,8}(\.\d{1,2})?$.
latitudenumber (double) or nullWhere the property is, to the middle of its postcode. Looked up shortly after the property is saved, and null until then. Stays null when the postcode is unknown, in Northern Ireland or outside the United Kingdom.
At least -90. At most 90. Read only.
longitudenumber (double) or nullAt least -180. At most 180. Read only.
billing_namestring or nullbilling_addressobject or nullFields(6)
address_line_1stringrequiredaddress_line_2string or nullcitystringrequiredregionstring or nullpostal_codestringrequiredcountry_codestringrequiredAt least 2 characters. Up to 2 characters.
archived_atstring (date-time) or null
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/enquiries/d18b965e-7fe3-5c54-9582-9799f884b874/customer" \
-H "Authorization: Bearer $TRADESENDER_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"lock_version": "1",
"customer": {
"name": "Jane Smith",
"email": "jane.smith@example.test",
"phone": "01632 960123"
},
"property": {
"address_line_1": "3 Mill Lane",
"city": "Douglas",
"postal_code": "IM1 1AA"
}
}'