/api/v4/locations/updateAtualizar um local
Atualiza os campos graváveis de um local existente. Apenas os campos que você envia são alterados.
Parâmetros
Corpo
Um campo aninhado marcado como obrigatório só se aplica quando você envia o campo pai. Se o campo pai for opcional e você o omitir, os campos filhos obrigatórios não se aplicam.
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
| input.id | string | obrigatório | 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 | obrigatório | One of MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY, or SPECIAL (a one-off override for the date in `specialDate`). |
| input.businessHours[].type | string | obrigatório | `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 | obrigatório | Opening time for the interval, e.g. `09:00am`. |
| input.businessHours[].slots[].end | string | obrigatório | 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. |
Exemplo de requisição
Corpo pronto para colar. Substitua os IDs e valores de exemplo pelos seus.
{ "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": [] } ] }}Respostas
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.
Atualiza um único local. Apenas os campos presentes em input são modificados; tudo o que você omitir mantém seu valor atual. id é o único campo obrigatório.
Caso de uso: corrigir um número de telefone. Envie apenas id e phone para corrigir os dados de contato sem alterar o endereço ou os horários. A resposta retorna o local atualizado para que você possa confirmar que os novos valores foram aplicados.
Caso de uso: publicar uma programação semanal completa. Envie o array businessHours com os sete dias (como na requisição de exemplo) para definir os intervalos de funcionamento por dia. Marque os dias sem funcionamento com { "day": "SUNDAY", "type": "CLOSED", "slots": [] }.
Regras de horário de funcionamento.
- Informe todos os sete dias; uma semana parcial é rejeitada.
- Os horários usam
start/enddentro de cada entrada deslots(e.g,09:00am,05:00pm); os intervalos de um mesmo dia não devem se sobrepor. - As exceções para feriados e eventos são entradas extras com
day: "SPECIAL"e umspecialDate(YYYY-MM-DD), enviadas junto com as sete entradas dos dias da semana, nunca em substituição a elas. - Use
SPECIALapenas embusinessHours. As entradas demoreHoursnão têm o campospecialDate, portanto um diaSPECIALnessas entradas não contém uma data. - Use
moreHourspara horários secundários (entrega, drive-through), comhoursTypeIdcomo chave.
Sempre envie a semana completa. As plataformas de publicação esperam uma programação completa de MONDAY–SUNDAY; envie todas as sete entradas sempre que você definir businessHours, usando type: "CLOSED" (com slots vazio) para os dias sem funcionamento em vez de omitir o dia.
Pontos de atenção.
- O campo identificador é
id(o ID Relay em Base64 retornado por todos os endpoints de leitura). - Em caso de falha de validação, a chamada ainda retorna HTTP 200 com
success: falsee um arrayerrorspreenchido; sempre verifiquesuccess, não apenas o código de status.
Links de ação do local
placeActionLinks gerencia os botões de ação de um local no Google (pedidos, entrega, retirada, reserva, agendamento). O modelo de gravação é append/upsert, não de substituição:
action: "add"(o padrão): adiciona um novo link ou atualizauri/isPreferredde um link salvo, mantendo o mesmo registro.action: "delete": remove um link salvo e coloca sua remoção do Google na fila.- Os links que você não referencia na requisição são mantidos sem alterações; omitir um link nunca o remove.
Como um link é identificado (para edição/exclusão): por name, se presente; caso contrário, por placeActionType + uri. Inclua name (obtido de um endpoint de leitura) quando você o tiver, para uma correspondência mais precisa; um link que ainda não foi sincronizado com o Google não tem name e é identificado por placeActionType + uri.
Valores válidos de placeActionType: APPOINTMENT, ONLINE_APPOINTMENT, DINING_RESERVATION, FOOD_ORDERING, FOOD_DELIVERY, FOOD_TAKEOUT, SHOP_ONLINE. No máximo um link preferencial por tipo.
Alterar a URL de um link = remover o antigo + adicionar o novo na mesma requisição:
{ "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" } ] }}Logo após uma gravação, name e submissionStatus de um link são null; eles são preenchidos assim que o link é sincronizado com o Google. Consulte o guia de links de ação do local para ver o fluxo completo, incluindo como os links descobertos diretamente no Google aparecem em discoveredPlaceActionLinks.
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": [] } ] } }'