POST/api/v4/locations/update

Mettre à jour un établissement

Met à jour les champs modifiables d’un établissement existant. Seuls les champs que vous envoyez sont modifiés.

Nécessite une clé API. Consultez Authentification pour le format de l’en-tête et la rotation des clé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.

NomTypeObligatoireDescription
input.idstringobligatoireThe location's Base64-encoded Relay ID to update.
input.namestringfacultatifBusiness name.
input.streetstringfacultatifStreet address.
input.citystringfacultatifCity.
input.stateIsostringfacultatifState/region ISO code.
input.postalCodestringfacultatifPostal or ZIP code.
input.countryIsostringfacultatifTwo-letter country ISO code.
input.phonestringfacultatifPrimary phone number.
input.bizUrlstringfacultatifBusiness website URL. Published to directories as the location's website.
input.primaryGbpSiteCategoryIdstringfacultatifPrimary Google Business Profile category, as a GCID (e.g. `gcid:restaurant`). Resolved against `countryIso`, so send the two together.
input.additionalGbpSiteCategoryIdsarray of stringsfacultatifAdditional Google Business Profile categories, as GCIDs. Also resolved against `countryIso`.
input.offeringsUrlstringfacultatifURL of the menu, catalogue, or service list.
input.bookingUrlstringfacultatifURL customers use to book an appointment.
input.reservationUrlstringfacultatifURL customers use to make a reservation.
input.street1stringfacultatifSecond address line (suite, unit, floor).
input.latitudestringfacultatifLatitude of the location, as a string. Send with `longitude`; publishers use it when the address alone is ambiguous.
input.longitudestringfacultatifLongitude of the location, as a string. Send with `latitude`.
input.ownerEmailstringfacultatifEmail of the location owner. Used for listing claims and verification, not for login.
input.ownerNamestringfacultatifName of the location owner.
input.facebookUrlstringfacultatifURL of the location's Facebook page.
input.twitterUrlstringfacultatifURL of the location's X (Twitter) profile.
input.linkedinUrlstringfacultatifURL of the location's LinkedIn page.
input.instagramUrlstringfacultatifURL of the location's Instagram profile.
input.youtubeUrlstringfacultatifURL of the location's YouTube channel.
input.tiktokUrlstringfacultatifURL of the location's TikTok profile.
input.pinterestUrlstringfacultatifURL of the location's Pinterest profile.
input.taglinestringfacultatifShort tagline for the business.
input.descriptionstringfacultatifBusiness description. Published to Google Business Profile as the business description.
input.yearOfIncorporationstringfacultatifYear the business was incorporated, e.g. `2014`.
input.googleAdsPhonestringfacultatifAlternate phone shown on Google Ads location extensions instead of `phone`.
input.additionalPhonesarray of stringsfacultatifSecondary phone numbers submitted to Google Business Profile.
input.videosarray of stringsfacultatifVideo URLs for the location.
input.additionalCategoryIdsarray of integersfacultatifSecondary Listings API subcategory IDs, from the subcategories endpoint. Distinct from `additionalGbpSiteCategoryIds`, which takes Google GCIDs.
input.subCategoryIdintegerfacultatifPrimary subcategory ID. Pick a valid ID from the subcategories list endpoint.
input.storeIdstringfacultatifUnique store code. Must be unique across the account.
input.enabledSiteIdsarray of integersfacultatifSite 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.updateOnlySiteIdsarray of integersfacultatifRestrict this update to the given site IDs. Other sites keep their current published values.
input.contentPreferredLanguagestringfacultatifPreferred language for the location's published content, e.g. `ENGLISH`.
input.submissionDisabledSiteIdsarray of integersfacultatifSite IDs to exclude from submission. The inverse of `enabledSiteIds`, useful when you want every site in your plan except a few.
input.hideAddressbooleanfacultatifSet `true` for a service-area business. ListingsAPI stores the address you send but does not submit it to publishers.
input.temporarilyClosedbooleanfacultatifSet `true` to stop publishing business hours while the location is temporarily closed.
input.serviceItemsarray of objectsfacultatifServices offered, published to Google Business Profile.
input.paymentMethodsarray of stringsfacultatifPayment 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.businessHoursarray of objectsfacultatifHours. Each entry is `{ day, type, slots }`, plus `specialDate` for a `SPECIAL` entry. Send the full seven-day week when you set hours.
input.businessHours[].daystringobligatoireOne of MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY, or SPECIAL (a one-off override for the date in `specialDate`).
input.businessHours[].typestringobligatoire`OPEN` or `CLOSED`.
input.businessHours[].specialDatestringfacultatifDate of a one-off override, as `YYYY-MM-DD`. Set this only when `day` is `SPECIAL`.
input.businessHours[].slotsarray of objectsfacultatifOpen intervals for the day, each `{ start, end }` (e.g. `09:00am`, `05:00pm`). Use an empty array when `type` is `CLOSED`.
input.businessHours[].slots[].startstringobligatoireOpening time for the interval, e.g. `09:00am`.
input.businessHours[].slots[].endstringobligatoireClosing time for the interval, e.g. `05:00pm`.
input.moreHoursarray of objectsfacultatifAdditional 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.serviceAreaobjectfacultatifService-area business config: `businessType`, `regionCode`, and a `placeInfos` array of `{ placeId, placeName }`.
input.customAttributesarray of objectsfacultatifCustom 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.placeActionLinksarray of objectsfacultatifGoogle 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.

Request body
{  "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.
Response
{  "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/end dans chaque entrée slots (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 un specialDate (YYYY-MM-DD), envoyées avec les sept entrées correspondant aux jours de la semaine, jamais à leur place.
  • Utilisez SPECIAL uniquement dans businessHours. Les entrées moreHours n’ont pas de champ specialDate ; un jour SPECIAL dans ces entrées n’est donc associé à aucune date.
  • Utilisez moreHours pour les horaires secondaires (livraison, service au volant), avec hoursTypeId comme 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: false et un tableau errors renseigné ; vérifiez toujours success, pas seulement le code de statut.

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 champs uri/isPreferred d’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 :

JSON
{  "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.

Request
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": []        }      ]    }  }'