사용 사례
Google Maps Booking API는 다양한 Actions Center 통합 또는 지역 서비스 광고 인벤토리의 개별 판매자 상태를 프로그래매틱 방식으로 가져오는 데 사용할 수 있는 두 가지 메서드를 제공합니다.
Merchant Status API 사용 사례:
- 기존 고객 관계 관리 도구를 개선하여 고객에게 인벤토리가 Actions Center 플랫폼에 표시되는 방식을 보여줍니다.
- 판매자의 인벤토리 상태와 일치 상태를 추적하는 대시보드를 빌드합니다.
- 프로그래매틱 방식으로 판매자의 일치 및 예약 가능 상태를 가져오고 잘못된 정보를 수정하여 데이터 품질을 개선합니다.
판매자 상태에 포함되는 내용
MerchantStatus에는 다음 정보가 포함됩니다.
- 판매자 인벤토리 상태: 예약 및/또는 대기 목록 판매자 모두에게 적용됩니다.
- 판매자 일치 상태: 일치하는 비즈니스 등록정보에 대한 세부정보가 포함됩니다.
- Google 지역 서비스 광고에만 해당) 일치하는 판매자 서비스 제공업체: 고객 ID와 서비스 카테고리를 포함합니다.
- Google 예약을 통해 판매자가 표시되는 방식을 보여주는 URL입니다.
단일 판매자 상태 조회
inventory.partners.merchants.getStatus를 사용하여 단일 판매자의 상태를 가져올 수 있습니다.
GET https://mapsbooking.googleapis.com/v1alpha/inventory/partners/{partnerId}/merchants/{merchantId}/status다음은 Python 코드 샘플입니다 (여기에서 더 많은 언어의 예시를 확인하세요).
from google.auth.transport.requests import AuthorizedSession from google.oauth2 import service_account credentials = service_account.Credentials.from_service_account_file( './your_key.json') scoped_credentials = credentials.with_scopes( ['https://www.googleapis.com/auth/mapsbooking']) authed_session = AuthorizedSession(scoped_credentials) response = authed_session.get('https://partnerdev-mapsbooking.googleapis.com' + '/v1alpha/inventory/partners/123456789/merchants/001/status')
MerchantStatus 응답의 예는 다음과 같습니다.
{ "name": "partners/123456789/merchants/001/status", "merchantName": "Foo Bar Restaurant", "inputGeoInfo": { "unstructured_address": "123 Foo Bar Street, Mountain View" }, "processingStatus": "COMPLETED", "bookingStatus": { "hasValidFutureInventory": true }, "waitlistStatus": { "hasValidWaitlistService": true } "geoMatch": { "name": "Foo Bar Restaurant", "formattedAddress": "123 Foo Bar St, Mountain View, CA 94043", "placeId": "ChIAAAAAAAAABBBBBBBB" }, "directUrls": [ { "type": "BOOKING", "url": "https://reserve-partnerdev.sandbox.google.com/maps/reserve/v/dine/m/Nwaaaaa" }, { "type": "WAITLIST", "url": "https://reserve-partnerdev.sandbox.google.com/maps/reserve/v/wait/c/iDbbbbb" } ] }
판매자 상태를 일괄적으로 가져옵니다.
inventory.partners.merchants.status.list를 사용하여 모든 판매자 또는 특정 인벤토리/일치 조건을 충족하는 판매자 그룹의 상태를 가져올 수 있습니다. 예를 들어 이 호출을 통해 유효한 미래 날짜 예약 인벤토리가 있는 일치하지 않는 판매자를 모두 가져올 수 있습니다.
GET https://mapsbooking.googleapis.com/v1alpha/inventory/partners/{partnerId}/merchants/status?pageSize=50&bookingInventoryStatusRestrict=HAS_VALID_FUTURE_INVENTORY&geoMatchRestrict=GEO_UNMATCHED샘플 응답은 다음과 같습니다.
{ "merchantStatuses": [ { "name": "partners/123456789/merchants/002/status", "merchantName": "Bar Foo Restaurant", "inputGeoInfo": { "unstructured_address": "234 Bar Foo Street, Mountain View" }, "processingStatus": "COMPLETED", "bookingStatus": { "hasValidFutureInventory": true }, "waitlistStatus": {}, }, ... { "name": "partners/123456789/merchants/080/status", "merchantName": "Baz Restaurant", "inputGeoInfo": { "unstructured_address": "345 Baz Street, Mountain View" }, "processingStatus": "COMPLETED", "bookingStatus": { "hasValidFutureInventory": true }, "waitlistStatus": { "hasValidWaitlistService": true }, }, ], "nextPageToken": "AAABBBB" }
이 응답에는 필터링 조건을 충족하고 merchant_id로 정렬된 50개의 MerchantStatus가 포함됩니다. 응답에는 다음 페이지를 쿼리하기 위한 페이지 토큰도 포함됩니다 (마지막 페이지가 아닌 경우).
필터링 조건은 모든 페이지에서 일관되어야 합니다.
권장사항
대부분의 경우 판매자 상태는 자주 변경되지 않으므로 검색된 결과를 캐시하고 주기적으로 (예: 몇 시간마다) 새 쿼리를 통해 검색하는 것이 좋습니다. 초당 요청 수가 지나치게 높다고 판단되면 Actions Center에서 쿼리를 제한할 수 있습니다.