Locations
Update with PUT
The existing update contract, retained for supported integrations.
PUT
Requires
JavaScript examples run in Node.js 22 or later; PHP examples require PHP 8.2 or later with cURL. Both read
Returns
location:update and project API access. name and city are required on each request; a street address is optional.
For a change that should preserve all omitted choices, use PATCH.
Run write requests with the cURL, JavaScript or PHP examples. They change real location data. Use PATCH for new integrations that update selected fields.
STOREROCKET_TOKEN from your environment. See the quickstart for setup.
200 and the location resource, with a geocoding object next to data describing any address lookup. Field descriptions are on Create a location.
Existing PUT behavior
- Omitted scalar values generally remain saved; PUT does not have PATCH’s preserve-all-omissions contract.
- Supplied
fieldsandcallsToActionobjects replace their respective attachments. Their omitted keys are removed; an empty object clears those attachments. - Supplied
filtersreplaces the filter list; an empty list clears it. An omitted filter list is preserved. - Omitted marker and location-type selections use the project’s defaults.
- Omitted hours, null hours, and
{}leave any existing hours unchanged. A nonempty hours object must include all seven days; it replaces the saved week. - Use PATCH for
hours:nullclearing or partial weekdays. - Changing the address moves the pin during the request, unless you send
latorlng. An address found only roughly, such as its town or postcode area, keeps the pin, andgeocoding.statusisapproximate. Send"lat": null, "lng": nullto clear the pin and geocode the address. PUT also geocodes synchronously when either coordinate is missing or zero. See addresses and coordinates. - Send null to clear an optional text field such as
phone,emailorurl. Omitting it keeps the saved value.
401, 403, 404, 422, 429. Invalid input saves no part of the location update. See errors.