/api/v4/locations/updateEinen Standort aktualisieren
Aktualisiert beschreibbare Felder eines vorhandenen Standorts. Nur die von Ihnen gesendeten Felder werden geändert.
Parameter
Body
Ein als erforderlich markiertes verschachteltes Feld gilt nur, wenn Sie das übergeordnete Feld senden. Ist das übergeordnete Feld optional und lassen Sie es weg, gelten seine erforderlichen Unterfelder nicht.
| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
| input.id | string | erforderlich | The location's Base64-encoded Relay ID to update. |
| input.name | string | optional | Business name. |
| input.street | string | optional | Street address. |
| input.city | string | optional | City. |
| input.stateIso | string | optional | State/region ISO code. |
| input.postalCode | string | optional | Postal or ZIP code. |
| input.countryIso | string | optional | Two-letter country ISO code. |
| input.phone | string | optional | Primary phone number. |
| input.bizUrl | string | optional | Business website URL. Published to directories as the location's website. |
| input.primaryGbpSiteCategoryId | string | optional | 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 | optional | Additional Google Business Profile categories, as GCIDs. Also resolved against `countryIso`. |
| input.offeringsUrl | string | optional | URL of the menu, catalogue, or service list. |
| input.bookingUrl | string | optional | URL customers use to book an appointment. |
| input.reservationUrl | string | optional | URL customers use to make a reservation. |
| input.street1 | string | optional | Second address line (suite, unit, floor). |
| input.latitude | string | optional | Latitude of the location, as a string. Send with `longitude`; publishers use it when the address alone is ambiguous. |
| input.longitude | string | optional | Longitude of the location, as a string. Send with `latitude`. |
| input.ownerEmail | string | optional | Email of the location owner. Used for listing claims and verification, not for login. |
| input.ownerName | string | optional | Name of the location owner. |
| input.facebookUrl | string | optional | URL of the location's Facebook page. |
| input.twitterUrl | string | optional | URL of the location's X (Twitter) profile. |
| input.linkedinUrl | string | optional | URL of the location's LinkedIn page. |
| input.instagramUrl | string | optional | URL of the location's Instagram profile. |
| input.youtubeUrl | string | optional | URL of the location's YouTube channel. |
| input.tiktokUrl | string | optional | URL of the location's TikTok profile. |
| input.pinterestUrl | string | optional | URL of the location's Pinterest profile. |
| input.tagline | string | optional | Short tagline for the business. |
| input.description | string | optional | Business description. Published to Google Business Profile as the business description. |
| input.yearOfIncorporation | string | optional | Year the business was incorporated, e.g. `2014`. |
| input.googleAdsPhone | string | optional | Alternate phone shown on Google Ads location extensions instead of `phone`. |
| input.additionalPhones | array of strings | optional | Secondary phone numbers submitted to Google Business Profile. |
| input.videos | array of strings | optional | Video URLs for the location. |
| input.additionalCategoryIds | array of integers | optional | Secondary Listings API subcategory IDs, from the subcategories endpoint. Distinct from `additionalGbpSiteCategoryIds`, which takes Google GCIDs. |
| input.subCategoryId | integer | optional | Primary subcategory ID. Pick a valid ID from the subcategories list endpoint. |
| input.storeId | string | optional | Unique store code. Must be unique across the account. |
| input.enabledSiteIds | array of integers | optional | 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 | optional | Restrict this update to the given site IDs. Other sites keep their current published values. |
| input.contentPreferredLanguage | string | optional | Preferred language for the location's published content, e.g. `ENGLISH`. |
| input.submissionDisabledSiteIds | array of integers | optional | 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 | optional | Set `true` for a service-area business. ListingsAPI stores the address you send but does not submit it to publishers. |
| input.temporarilyClosed | boolean | optional | Set `true` to stop publishing business hours while the location is temporarily closed. |
| input.serviceItems | array of objects | optional | Services offered, published to Google Business Profile. |
| input.paymentMethods | array of strings | optional | 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 | optional | 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 | erforderlich | One of MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY, or SPECIAL (a one-off override for the date in `specialDate`). |
| input.businessHours[].type | string | erforderlich | `OPEN` or `CLOSED`. |
| input.businessHours[].specialDate | string | optional | Date of a one-off override, as `YYYY-MM-DD`. Set this only when `day` is `SPECIAL`. |
| input.businessHours[].slots | array of objects | optional | 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 | erforderlich | Opening time for the interval, e.g. `09:00am`. |
| input.businessHours[].slots[].end | string | erforderlich | Closing time for the interval, e.g. `05:00pm`. |
| input.moreHours | array of objects | optional | 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 | optional | Service-area business config: `businessType`, `regionCode`, and a `placeInfos` array of `{ placeId, placeName }`. |
| input.customAttributes | array of objects | optional | 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 | optional | 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. |
Beispielanfrage
Body zum direkten Einfügen. Ersetzen Sie Platzhalter-IDs und -Werte durch Ihre eigenen.
{ "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": [] } ] }}Antworten
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.
Aktualisiert einen einzelnen Standort. Nur die in input enthaltenen Felder werden geändert; alle ausgelassenen Felder behalten ihren aktuellen Wert. id ist das einzige Pflichtfeld.
Anwendungsfall: eine Telefonnummer korrigieren. Senden Sie nur id und phone, um Kontaktdaten zu korrigieren, ohne die Adresse oder die Öffnungszeiten zu ändern. Die Antwort gibt den aktualisierten Standort zurück, sodass Sie prüfen können, ob die neuen Werte übernommen wurden.
Anwendungsfall: einen vollständigen Wochenplan veröffentlichen. Senden Sie das businessHours-Array für alle sieben Tage (wie in der Beispielanfrage), um die Öffnungsintervalle pro Tag festzulegen. Kennzeichnen Sie geschlossene Tage mit { "day": "SUNDAY", "type": "CLOSED", "slots": [] }.
Regeln für Öffnungszeiten.
- Geben Sie alle sieben Tage an; eine unvollständige Woche wird abgelehnt.
- Zeitangaben verwenden
start/endinnerhalb jedesslots-Eintrags (e.g,09:00am,05:00pm); Intervalle innerhalb eines Tages dürfen sich nicht überschneiden. - Abweichende Zeiten für Feiertage und Veranstaltungen sind zusätzliche Einträge mit
day: "SPECIAL"und einemspecialDate(YYYY-MM-DD), die zusammen mit den sieben Wochentagseinträgen gesendet werden, niemals an deren Stelle. - Verwenden Sie
SPECIALnur inbusinessHours.moreHours-Einträge haben keinspecialDate-Feld, daher hat einSPECIAL-Tag dort kein Datum. - Verwenden Sie
moreHoursfür zusätzliche Zeitpläne (Lieferung, Drive-through), mithoursTypeIdals Schlüssel.
Senden Sie immer die vollständige Woche. Plattformen erwarten einen vollständigen Zeitplan von MONDAY bis SUNDAY; senden Sie alle sieben Einträge, wann immer Sie businessHours festlegen, und verwenden Sie für Tage ohne Betrieb type: "CLOSED" (mit leerem slots), anstatt den Tag auszulassen.
Fallstricke.
- Das Identifikatorfeld ist
id(die Base64 Relay ID, die jeder Lese-Endpunkt zurückgibt). - Bei einem Validierungsfehler gibt der Aufruf dennoch HTTP 200 mit
success: falseund einem gefülltenerrors-Array zurück; prüfen Sie immersuccess, nicht nur den Statuscode.
Aktionslinks für Standorte
placeActionLinks verwaltet die Google-Aktionsschaltflächen eines Standorts (Bestellung, Lieferung, Abholung, Reservierung, Terminvereinbarung). Das Schreibmodell ist append/upsert, kein Ersetzen:
action: "add"(Standard): fügt einen neuen Link hinzu oder aktualisierturi/isPreferredeines gespeicherten Links direkt.action: "delete": entfernt einen gespeicherten Link und stellt dessen Entfernung von Google in die Warteschlange.- Links, auf die Sie in der Anfrage nicht verweisen, bleiben unverändert; das Auslassen eines Links entfernt ihn niemals.
So wird ein Link zugeordnet (zum Bearbeiten/Löschen): anhand von name, sofern vorhanden, andernfalls anhand von placeActionType + uri. Geben Sie name (aus einem Lese-Endpunkt) an, wenn Ihnen dieser Wert vorliegt, um eine möglichst genaue Zuordnung zu erzielen; ein Link, der noch nicht mit Google synchronisiert wurde, hat kein name und wird anhand von placeActionType + uri zugeordnet.
Gültige Werte für placeActionType: APPOINTMENT, ONLINE_APPOINTMENT, DINING_RESERVATION, FOOD_ORDERING, FOOD_DELIVERY, FOOD_TAKEOUT, SHOP_ONLINE. Höchstens ein bevorzugter Link pro Typ.
Die URL eines Links ändern = den alten Link entfernen + den neuen Link in derselben Anfrage hinzufügen:
{ "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" } ] }}Unmittelbar nach einem Schreibvorgang haben name und submissionStatus eines Links den Wert null; sie werden befüllt, sobald der Link mit Google synchronisiert wird. Den vollständigen Ablauf finden Sie im Leitfaden zu Aktionslinks für Standorte, einschließlich einer Beschreibung, wie direkt auf Google entdeckte Links unter discoveredPlaceActionLinks erscheinen.
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": [] } ] } }'