Customers

Update Customer by ID

Updates one customer in your depot. This is a partial update: only the fields you send change. For capacities, skills, tags, time_windows and custom_fields, sending the array replaces the customer's whole set (an empty array clears it), and leaving it out keeps the existing set. Capacities, skills and tags that don't exist in your depot or organisation are dropped without an error. Custom fields are matched by id only.

  • Every request must include either address or both lat and lng, even when you are only changing other fields.
  • Changing address without sending coordinates re-geocodes the customer. If geocoding fails, the update is still saved and the failure is reported as a GEOCODING_FAILED entry in the response's errors array.
  • Setting account to a value another customer in your depot already uses returns 400 INVALID_INPUT.

The response holds the updated customer under customer (the same shape as GET /customers/{id}) along with an errors array.

put/customers/{id}

Request

  • Base URL: https://api.smartroutes.io/v2
  • URL: https://api.smartroutes.io/v2/customers/{id}
  • Auth: none declared

Path parameters

idstring required

ID of the customer to update.

Request body

namestring

Name of the customer.

accountstring

Account number of the customer.

addressstring

Address of the customer.

postcodestring

Postcode for the customer address.

latnumber

Latitude of the customer location.

lngnumber

Longitude of the customer location.

phonestring

Contact number of the customer.

emailstring email

Email of the customer.

durationnumber

Duration for customer interaction in minutes.

notesstring

Notes for customer interaction.

skillsstring[]

List of required skills for the customer.

tagsstring[]

List of tags for the customer

Response

Successful response

Changes

No recorded changes to this operation across all 1 revision of this API.