updateCustomer
Update a customer
PARTIAL update — send only the fields you are changing; anything you OMIT is left exactly as stored (two-way CRM sync friendly: push one field from your system of record without re-sending the record). To CLEAR a field, send it as an empty string: uid, phone, email, notes, preferred_technician_id, service_area_id. tier and status are enums with no empty member, so an empty value there is ignored rather than stored. full_name cannot be set to empty. The nested address object is all-or-nothing: omit it to leave the stored address (and its coordinates) untouched; when present it REPLACES the whole block, and missing latitude/longitude are geocoded from the address. A customer must keep at least one contact channel — an update that would clear both phone and email is refused with PHONE_OR_EMAIL_REQUIRED.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Customer ID (UUID) | |
| uid | No | Your external reference for this customer. Omit to leave unchanged, "" to clear. Max 32 chars. | |
| tier | No | Loyalty tier. Omit to leave unchanged; "" is ignored (an enum has no empty member). | |
| No | Email address. Omit to leave unchanged, "" to clear. | ||
| notes | No | Free-form internal notes about the customer. Omit to leave unchanged, "" to clear; max 4000 chars. | |
| phone | No | Phone number in E.164 international format (`+16135550188`); a bare national number is rejected with PHONE_INVALID — see createCustomerReq.Phone. Omit to leave unchanged, "" to clear. 10–20 chars. | |
| status | No | Lifecycle status. Omit to leave unchanged; "" is ignored. | |
| address | No | Postal address and coordinates. Omit the whole object to leave the stored address untouched; when present it REPLACES the address block. | |
| full_name | No | Customer's full name. Omit to leave unchanged; an empty or blank value is ignored (a customer cannot be left nameless). Max 255 chars. | |
| sms_opt_in | No | SMS consent, tri-state: omit/null = leave unchanged; true = grant (only when the customer explicitly consented — the original consent timestamp is preserved); false = revoke (opt-out, stops SMS immediately). | |
| service_area_id | No | UUID of the service area for this customer. Omit to leave unchanged, "" to clear. Must belong to this business. | |
| preferred_technician_id | No | UUID of the technician this customer prefers. Omit to leave unchanged, "" to clear. Must belong to this business. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | No | The response payload. Omitted on error unless the error carries structured data. | |
| errors | No | Field-level validation details; present only for VALIDATION_ERROR responses. | |
| message | No | Human-readable message ("Success" or an error description), localized via the X-Locale header. | |
| error_code | No | 0 on success; a stable string error code on failure (e.g. CUSTOMER_NOT_FOUND). |