/api/v4/locations/updateActualizar una ubicación
Actualiza los campos que se pueden modificar de una ubicación existente. Solo se cambian los campos que envías.
Parámetros
Cuerpo
Un campo anidado marcado como obligatorio solo se aplica cuando envías su campo principal. Si el campo principal es opcional y lo omites, sus campos hijos obligatorios no se aplican.
| Nombre | Tipo | Obligatorio | Descripción |
|---|---|---|---|
| input.id | string | obligatorio | The location's Base64-encoded Relay ID to update. |
| input.name | string | opcional | Business name. |
| input.street | string | opcional | Street address. |
| input.city | string | opcional | City. |
| input.stateIso | string | opcional | State/region ISO code. |
| input.postalCode | string | opcional | Postal or ZIP code. |
| input.countryIso | string | opcional | Two-letter country ISO code. |
| input.phone | string | opcional | Primary phone number. |
| input.bizUrl | string | opcional | Business website URL. Published to directories as the location's website. |
| input.primaryGbpSiteCategoryId | string | opcional | Primary Google Business Profile category, as a GCID (e.g. `gcid:restaurant`). Resolved against `countryIso`, so send the two together. |
| input.additionalGbpSiteCategoryIds | array of strings | opcional | Additional Google Business Profile categories, as GCIDs. Also resolved against `countryIso`. |
| input.offeringsUrl | string | opcional | URL of the menu, catalogue, or service list. |
| input.bookingUrl | string | opcional | URL customers use to book an appointment. |
| input.reservationUrl | string | opcional | URL customers use to make a reservation. |
| input.street1 | string | opcional | Second address line (suite, unit, floor). |
| input.latitude | string | opcional | Latitude of the location, as a string. Send with `longitude`; publishers use it when the address alone is ambiguous. |
| input.longitude | string | opcional | Longitude of the location, as a string. Send with `latitude`. |
| input.ownerEmail | string | opcional | Email of the location owner. Used for listing claims and verification, not for login. |
| input.ownerName | string | opcional | Name of the location owner. |
| input.facebookUrl | string | opcional | URL of the location's Facebook page. |
| input.twitterUrl | string | opcional | URL of the location's X (Twitter) profile. |
| input.linkedinUrl | string | opcional | URL of the location's LinkedIn page. |
| input.instagramUrl | string | opcional | URL of the location's Instagram profile. |
| input.youtubeUrl | string | opcional | URL of the location's YouTube channel. |
| input.tiktokUrl | string | opcional | URL of the location's TikTok profile. |
| input.pinterestUrl | string | opcional | URL of the location's Pinterest profile. |
| input.tagline | string | opcional | Short tagline for the business. |
| input.description | string | opcional | Business description. Published to Google Business Profile as the business description. |
| input.yearOfIncorporation | string | opcional | Year the business was incorporated, e.g. `2014`. |
| input.googleAdsPhone | string | opcional | Alternate phone shown on Google Ads location extensions instead of `phone`. |
| input.additionalPhones | array of strings | opcional | Secondary phone numbers submitted to Google Business Profile. |
| input.videos | array of strings | opcional | Video URLs for the location. |
| input.additionalCategoryIds | array of integers | opcional | Secondary Listings API subcategory IDs, from the subcategories endpoint. Distinct from `additionalGbpSiteCategoryIds`, which takes Google GCIDs. |
| input.subCategoryId | integer | opcional | Primary subcategory ID. Pick a valid ID from the subcategories list endpoint. |
| input.storeId | string | opcional | Unique store code. Must be unique across the account. |
| input.enabledSiteIds | array of integers | opcional | Site IDs to publish this location to, when you want a subset of your plan's sites. See the plan-sites endpoint for valid IDs. Omit to publish to every site in your plan. |
| input.updateOnlySiteIds | array of integers | opcional | Restrict this update to the given site IDs. Other sites keep their current published values. |
| input.contentPreferredLanguage | string | opcional | Preferred language for the location's published content, e.g. `ENGLISH`. |
| input.submissionDisabledSiteIds | array of integers | opcional | Site IDs to exclude from submission. The inverse of `enabledSiteIds`, useful when you want every site in your plan except a few. |
| input.hideAddress | boolean | opcional | Set `true` for a service-area business. ListingsAPI stores the address you send but does not submit it to publishers. |
| input.temporarilyClosed | boolean | opcional | Set `true` to stop publishing business hours while the location is temporarily closed. |
| input.serviceItems | array of objects | opcional | Services offered, published to Google Business Profile. |
| input.paymentMethods | array of strings | opcional | Payment methods accepted. One or more of `VISA`, `MASTERCARD`, `AMEX`, `CASH`, `CHEQUE`, `CRYPTO`, `DINERS_CLUB`, `DISCOVER`, `FINANCING`, `INVOICE`, `TRAVELERS_CHECK`, `APPLE_PAY`, `SAMSUNG_PAY`, `PAYPAL`, `ANDROID_PAY`. |
| input.businessHours | array of objects | opcional | Hours. Each entry is `{ day, type, slots }`, plus `specialDate` for a `SPECIAL` entry. Send the full seven-day week when you set hours. |
| input.businessHours[].day | string | obligatorio | One of MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY, or SPECIAL (a one-off override for the date in `specialDate`). |
| input.businessHours[].type | string | obligatorio | `OPEN` or `CLOSED`. |
| input.businessHours[].specialDate | string | opcional | Date of a one-off override, as `YYYY-MM-DD`. Set this only when `day` is `SPECIAL`. |
| input.businessHours[].slots | array of objects | opcional | Open intervals for the day, each `{ start, end }` (e.g. `09:00am`, `05:00pm`). Use an empty array when `type` is `CLOSED`. |
| input.businessHours[].slots[].start | string | obligatorio | Opening time for the interval, e.g. `09:00am`. |
| input.businessHours[].slots[].end | string | obligatorio | Closing time for the interval, e.g. `05:00pm`. |
| input.moreHours | array of objects | opcional | Additional hour sets (e.g. delivery, drive-through). Each entry is `{ hoursTypeId, moreHour }`, where `moreHour` is an array of `{ day, type, slots }` using the same shape as `businessHours` (minus `specialDate`). |
| input.serviceArea | object | opcional | Service-area business config: `businessType`, `regionCode`, and a `placeInfos` array of `{ placeId, placeName }`. |
| input.customAttributes | array of objects | opcional | Custom attribute values for the location. Each item is `{ slug, value }`, where `slug` identifies a custom attribute registered on your account and `value` is an array of strings. Sending a slug that is not registered returns `SY10035`. Registering a new custom attribute is not yet available through the API. |
| input.placeActionLinks | array of objects | opcional | Google action links (ordering, delivery, takeout, reservation, appointment). Each item: `placeActionType` (enum), `uri` (string), optional `isPreferred` (boolean), optional `action` (`add`, the default, or `delete`), optional `name` (the link identifier returned by read endpoints once synced to Google). Only the links you reference are affected; links you don't include are left unchanged. See the Place Action Links guide. |
Solicitud de ejemplo
Cuerpo listo para pegar. Sustituye los ID y valores de ejemplo por los tuyos.
{ "input": { "id": "TG9jYXRpb246MTgwMDI4OQ==", "phone": "5125550199", "bizUrl": "https://acmekitchen.example.com", "primaryGbpSiteCategoryId": "gcid:restaurant", "businessHours": [ { "day": "MONDAY", "type": "OPEN", "slots": [{ "start": "09:00am", "end": "05:00pm" }] }, { "day": "TUESDAY", "type": "OPEN", "slots": [{ "start": "09:00am", "end": "05:00pm" }] }, { "day": "WEDNESDAY", "type": "OPEN", "slots": [{ "start": "09:00am", "end": "05:00pm" }] }, { "day": "THURSDAY", "type": "OPEN", "slots": [{ "start": "09:00am", "end": "05:00pm" }] }, { "day": "FRIDAY", "type": "OPEN", "slots": [{ "start": "09:00am", "end": "05:00pm" }] }, { "day": "SATURDAY", "type": "OPEN", "slots": [{ "start": "10:00am", "end": "02:00pm" }] }, { "day": "SUNDAY", "type": "CLOSED", "slots": [] } ] }}Respuestas
200Location updated. `success` is true and the updated location summary is returned.
{ "data": { "updateLocation": { "clientMutationId": null, "success": true, "errors": null, "location": { "id": "TG9jYXRpb246MTgwMDI4OQ==", "databaseId": 1800289, "name": "Jenny Home", "street": "600 Congress Ave, Suite 200", "city": "Austin", "stateIso": "TX", "countryIso": "US", "postalCode": "78701", "phone": "5125550199", "storeId": null, "status": "APPROVED", "placeActionLinks": [ { "placeActionType": "FOOD_ORDERING", "uri": "https://order.example.com", "isPreferred": true, "name": null, "submissionStatus": null } ], "discoveredPlaceActionLinks": [] } } }}401Unauthenticated, missing or invalid API key.
Actualiza una sola ubicación. Solo se modifican los campos presentes en input; todo lo que omitas conserva su valor actual. id es el único campo obligatorio.
Caso de uso: corregir un número de teléfono. Envía solo id y phone para corregir los datos de contacto sin modificar la dirección ni el horario. La respuesta devuelve la ubicación actualizada para que puedas confirmar que se han aplicado los nuevos valores.
Caso de uso: publicar un horario semanal completo. Envía el array businessHours de siete días (como en la solicitud de ejemplo) para establecer los intervalos de apertura de cada día. Marca los días de cierre con { "day": "SUNDAY", "type": "CLOSED", "slots": [] }.
Reglas del horario comercial.
- Incluye los siete días; se rechaza cualquier semana incompleta.
- Las horas usan
start/enddentro de cada entrada deslots(e.g,09:00am,05:00pm); los intervalos de un mismo día no deben solaparse. - Las excepciones por festivos y eventos son entradas adicionales con
day: "SPECIAL"y unspecialDate(YYYY-MM-DD), que se envían junto con las siete entradas de los días de la semana, nunca en su lugar. - Usa
SPECIALsolo enbusinessHours. Las entradas demoreHoursno tienen el campospecialDate, por lo que un díaSPECIALen ellas no lleva fecha. - Usa
moreHourspara los horarios secundarios (entrega a domicilio, atención desde el vehículo), conhoursTypeIdcomo clave.
Envía siempre la semana completa. Las plataformas de publicación esperan un horario completo de MONDAY a SUNDAY; envía las siete entradas siempre que establezcas businessHours, usando type: "CLOSED" (con slots vacío) para los días sin actividad en lugar de omitir el día.
Aspectos que debes tener en cuenta.
- El campo identificador es
id(el ID de Relay en Base64 que devuelve cada endpoint de lectura). - Si la validación falla, la llamada sigue devolviendo HTTP 200 con
success: falsey un arrayerrorscon elementos; comprueba siempresuccess, no solo el código de estado.
Enlaces de acción de la ubicación
placeActionLinks gestiona los botones de acción de Google de una ubicación (pedidos, entrega a domicilio, recogida, reservas, citas). El modelo de escritura es append/upsert, no de sustitución:
action: "add"(valor predeterminado): añade un enlace nuevo o actualizauri/isPreferredde un enlace guardado sin sustituirlo.action: "delete": elimina un enlace guardado y pone en cola su eliminación de Google.- Los enlaces que no incluyas en la solicitud se mantienen sin cambios; omitir un enlace nunca lo elimina.
Cómo se identifica un enlace (para editarlo o eliminarlo): por name si está presente; de lo contrario, por placeActionType + uri. Incluye name (obtenido de un endpoint de lectura) cuando lo tengas para identificarlo con la mayor precisión posible; un enlace que aún no se ha sincronizado con Google no tiene name y se identifica por placeActionType + uri.
Valores válidos de placeActionType: APPOINTMENT, ONLINE_APPOINTMENT, DINING_RESERVATION, FOOD_ORDERING, FOOD_DELIVERY, FOOD_TAKEOUT, SHOP_ONLINE. Como máximo, un enlace preferido por tipo.
Cambiar la URL de un enlace = eliminar el antiguo + añadir el nuevo en la misma solicitud:
{ "input": { "id": "TG9jYXRpb246MTgwMDI4OQ==", "placeActionLinks": [ { "placeActionType": "FOOD_ORDERING", "uri": "https://order.example.com", "name": "<link-name-if-synced>", "action": "delete" }, { "placeActionType": "FOOD_ORDERING", "uri": "https://new-order.example.com", "isPreferred": true, "action": "add" } ] }}Justo después de una escritura, name y submissionStatus de un enlace tienen el valor null; se rellenan una vez que el enlace se sincroniza con Google. Consulta la guía de enlaces de acción de la ubicación para conocer el flujo completo, incluido cómo aparecen en discoveredPlaceActionLinks los enlaces descubiertos directamente en Google.
curl -X POST 'https://listingsapi.com/api/v4/locations/update' \ -H "Authorization: API $LISTINGSAPI_KEY" \ -H 'Content-Type: application/json' \ -d '{ "input": { "id": "TG9jYXRpb246MTgwMDI4OQ==", "phone": "5125550199", "bizUrl": "https://acmekitchen.example.com", "primaryGbpSiteCategoryId": "gcid:restaurant", "businessHours": [ { "day": "MONDAY", "type": "OPEN", "slots": [ { "start": "09:00am", "end": "05:00pm" } ] }, { "day": "TUESDAY", "type": "OPEN", "slots": [ { "start": "09:00am", "end": "05:00pm" } ] }, { "day": "WEDNESDAY", "type": "OPEN", "slots": [ { "start": "09:00am", "end": "05:00pm" } ] }, { "day": "THURSDAY", "type": "OPEN", "slots": [ { "start": "09:00am", "end": "05:00pm" } ] }, { "day": "FRIDAY", "type": "OPEN", "slots": [ { "start": "09:00am", "end": "05:00pm" } ] }, { "day": "SATURDAY", "type": "OPEN", "slots": [ { "start": "10:00am", "end": "02:00pm" } ] }, { "day": "SUNDAY", "type": "CLOSED", "slots": [] } ] } }'