Update a customer
Partial update following the design philosophy:
- Omitted JSON keys leave the corresponding entity fields untouched. The mobile UI can send only the keys it actually changed.
- Explicit JSON null clears the field (sets the column to SQL NULL in the database). Use this to wipe an optional field — there is no ?clear=phone query param.
- Concrete values overwrite the entity field with the value.
customer_type is NOT NULL in the schema; sending it as null is a 422 parameter_invalid error.
custom_fields replaces the whole values object (omitted = leave, null = clear); a hidden field keeps its value unless its key is sent. See CustomerCustomFieldValues.
The customer's generated agenda events follow its dates: changing the birthday or a custom date moves its event, clearing it removes the event, and a patch that touches no date leaves them alone.
Returns the fully materialized post-update customer.
Foreign-key references in the body (price_list_id, etc.) must resolve to resources owned by the authenticated user's company. Unreachable refs return 422 parameter_invalid pointing at the offending field.
Request
- Base URL: https://api.officina.it
- URL: https://api.officina.it/v1/customers/{id}
- Auth: HTTP bearer
Request body
Example request
{
"custom_fields": {
"cf_4c1e7a": "Idraulico",
"cf_9b20d3": "2027-03-15"
}
}Response
Customer updated. Returns the full post-update entity.
Example response
{
"id": "4c911f08-7713-4e83-bdf6-a0692a1b43fd",
"documents": [
{
"url": "/v1/customers/0b6b…/documents/77c2…/download"
}
]
}Changes
No recorded changes to this operation across all 1 revision of this API.