/api/v4/locations/updateMettre à jour un établissement
Met à jour les champs modifiables d’un établissement existant. Seuls les champs que vous envoyez sont modifiés.
Paramètres
Corps
Un champ imbriqué marqué comme obligatoire ne s’applique que si vous envoyez son parent. Si le parent est facultatif et que vous l’omettez, ses champs enfants obligatoires ne s’appliquent pas.
| Nom | Type | Obligatoire | Description |
|---|---|---|---|
| input.id | string | obligatoire | The location's Base64-encoded Relay ID to update. |
| input.name | string | facultatif | Business name. |
| input.street | string | facultatif | Street address. |
| input.city | string | facultatif | City. |
| input.stateIso | string | facultatif | State/region ISO code. |
| input.postalCode | string | facultatif | Postal or ZIP code. |
| input.countryIso | string | facultatif | Two-letter country ISO code. |
| input.phone | string | facultatif | Primary phone number. |
| input.bizUrl | string | facultatif | Business website URL. Published to directories as the location's website. |
| input.primaryGbpSiteCategoryId | string | facultatif | 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 | facultatif | Additional Google Business Profile categories, as GCIDs. Also resolved against `countryIso`. |
| input.offeringsUrl | string | facultatif | URL of the menu, catalogue, or service list. |
| input.bookingUrl | string | facultatif | URL customers use to book an appointment. |
| input.reservationUrl | string | facultatif | URL customers use to make a reservation. |
| input.street1 | string | facultatif | Second address line (suite, unit, floor). |
| input.latitude | string | facultatif | Latitude of the location, as a string. Send with `longitude`; publishers use it when the address alone is ambiguous. |
| input.longitude | string | facultatif | Longitude of the location, as a string. Send with `latitude`. |
| input.ownerEmail | string | facultatif | Email of the location owner. Used for listing claims and verification, not for login. |
| input.ownerName | string | facultatif | Name of the location owner. |
| input.facebookUrl | string | facultatif | URL of the location's Facebook page. |
| input.twitterUrl | string | facultatif | URL of the location's X (Twitter) profile. |
| input.linkedinUrl | string | facultatif | URL of the location's LinkedIn page. |
| input.instagramUrl | string | facultatif | URL of the location's Instagram profile. |
| input.youtubeUrl | string | facultatif | URL of the location's YouTube channel. |
| input.tiktokUrl | string | facultatif | URL of the location's TikTok profile. |
| input.pinterestUrl | string | facultatif | URL of the location's Pinterest profile. |
| input.tagline | string | facultatif | Short tagline for the business. |
| input.description | string | facultatif | Business description. Published to Google Business Profile as the business description. |
| input.yearOfIncorporation | string | facultatif | Year the business was incorporated, e.g. `2014`. |
| input.googleAdsPhone | string | facultatif | Alternate phone shown on Google Ads location extensions instead of `phone`. |
| input.additionalPhones | array of strings | facultatif | Secondary phone numbers submitted to Google Business Profile. |
| input.videos | array of strings | facultatif | Video URLs for the location. |
| input.additionalCategoryIds | array of integers | facultatif | Secondary Listings API subcategory IDs, from the subcategories endpoint. Distinct from `additionalGbpSiteCategoryIds`, which takes Google GCIDs. |
| input.subCategoryId | integer | facultatif | Primary subcategory ID. Pick a valid ID from the subcategories list endpoint. |
| input.storeId | string | facultatif | Unique store code. Must be unique across the account. |
| input.enabledSiteIds | array of integers | facultatif | 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 | facultatif | Restrict this update to the given site IDs. Other sites keep their current published values. |
| input.contentPreferredLanguage | string | facultatif | Preferred language for the location's published content, e.g. `ENGLISH`. |
| input.submissionDisabledSiteIds | array of integers | facultatif | 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 | facultatif | Set `true` for a service-area business. ListingsAPI stores the address you send but does not submit it to publishers. |
| input.temporarilyClosed | boolean | facultatif | Set `true` to stop publishing business hours while the location is temporarily closed. |
| input.serviceItems | array of objects | facultatif | Services offered, published to Google Business Profile. |
| input.paymentMethods | array of strings | facultatif | 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 | facultatif | 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 | obligatoire | One of MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY, or SPECIAL (a one-off override for the date in `specialDate`). |
| input.businessHours[].type | string | obligatoire | `OPEN` or `CLOSED`. |
| input.businessHours[].specialDate | string | facultatif | Date of a one-off override, as `YYYY-MM-DD`. Set this only when `day` is `SPECIAL`. |
| input.businessHours[].slots | array of objects | facultatif | 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 | obligatoire | Opening time for the interval, e.g. `09:00am`. |
| input.businessHours[].slots[].end | string | obligatoire | Closing time for the interval, e.g. `05:00pm`. |
| input.moreHours | array of objects | facultatif | 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 | facultatif | Service-area business config: `businessType`, `regionCode`, and a `placeInfos` array of `{ placeId, placeName }`. |
| input.customAttributes | array of objects | facultatif | 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 | facultatif | 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. |
Exemple de requête
Corps prêt à coller. Remplacez les identifiants et valeurs d’exemple par les vôtres.
{ "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": [] } ] }}Réponses
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.
Met à jour un seul établissement. Seuls les champs présents dans input sont modifiés ; tous ceux que vous omettez conservent leur valeur actuelle. id est le seul champ obligatoire.
Cas d’utilisation : corriger un numéro de téléphone. Envoyez uniquement id et phone pour corriger les coordonnées sans modifier l’adresse ni les horaires. La réponse renvoie l’établissement mis à jour pour que vous puissiez confirmer que les nouvelles valeurs ont été enregistrées.
Cas d’utilisation : publier un planning hebdomadaire complet. Envoyez le tableau businessHours couvrant les sept jours (comme dans l’exemple de requête) pour définir les plages d’ouverture de chaque jour. Indiquez les jours de fermeture avec { "day": "SUNDAY", "type": "CLOSED", "slots": [] }.
Règles relatives aux horaires d’ouverture.
- Fournissez les sept jours ; une semaine incomplète est rejetée.
- Les heures utilisent
start/enddans chaque entréeslots(e.g,09:00am,05:00pm) ; les plages horaires d’une même journée ne doivent pas se chevaucher. - Les dérogations pour les jours fériés et les événements sont des entrées supplémentaires contenant
day: "SPECIAL"et unspecialDate(YYYY-MM-DD), envoyées avec les sept entrées correspondant aux jours de la semaine, jamais à leur place. - Utilisez
SPECIALuniquement dansbusinessHours. Les entréesmoreHoursn’ont pas de champspecialDate; un jourSPECIALdans ces entrées n’est donc associé à aucune date. - Utilisez
moreHourspour les horaires secondaires (livraison, service au volant), avechoursTypeIdcomme clé.
Envoyez toujours la semaine complète. Les plateformes de publication attendent un planning complet de MONDAY à SUNDAY ; envoyez les sept entrées chaque fois que vous définissez businessHours, en utilisant type: "CLOSED" (avec slots vide) pour les jours de fermeture plutôt que d’omettre le jour.
Points d’attention.
- Le champ d’identifiant est
id(l’identifiant Relay en Base64 renvoyé par chaque endpoint de lecture). - En cas d’échec de validation, l’appel renvoie tout de même HTTP 200 avec
success: falseet un tableauerrorsrenseigné ; vérifiez toujourssuccess, pas seulement le code de statut.
Liens d’action de l’établissement
placeActionLinks gère les boutons d’action Google d’un établissement (commande, livraison, vente à emporter, réservation, prise de rendez-vous). Le modèle d’écriture est append/upsert, et non un remplacement :
action: "add"(par défaut) : ajoute un nouveau lien ou met à jour sur place les champsuri/isPreferredd’un lien enregistré.action: "delete": supprime un lien enregistré et met sa suppression de Google en file d’attente.- Les liens que vous ne référencez pas dans la requête sont laissés inchangés ; omettre un lien ne le supprime jamais.
Comment un lien est identifié (pour modification ou suppression) : par name s’il est présent, sinon par placeActionType + uri. Incluez name (obtenu via un endpoint de lecture) lorsque vous en disposez, pour une correspondance aussi précise que possible ; un lien qui n’a pas encore été synchronisé avec Google n’a pas de name et est identifié par placeActionType + uri.
Valeurs valides pour placeActionType : APPOINTMENT, ONLINE_APPOINTMENT, DINING_RESERVATION, FOOD_ORDERING, FOOD_DELIVERY, FOOD_TAKEOUT, SHOP_ONLINE. Au maximum un lien préféré par type.
Modifier l’URL d’un lien = supprimer l’ancien + ajouter le nouveau dans la même requête :
{ "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" } ] }}Juste après une écriture, les champs name et submissionStatus d’un lien valent null ; ils sont renseignés une fois le lien synchronisé avec Google. Consultez le guide des liens d’action de l’établissement pour connaître le processus complet, notamment la manière dont les liens découverts directement sur Google apparaissent sous 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": [] } ] } }'