Real-Time Updates Ready

Inventory in your system changes because of new bookings, cancelations, and schedule changes from your merchants. The Real-Time Update (RTU) API is a mechanism to notify Google about these changes, and the changes made to existing bookings.

RTUs are required in the following cases:

  • When a user cancels a reservation on your system, and the slot becomes available.
  • When a user books a reservation through the Actions Center, and the slot is no longer available.
  • When a reservation made through the Actions Center is canceled on your side. An example situation includes a cancelation by the merchant directly. You need to update the booking and the availability, because the original slot is now available.

Complete the following RTU milestone task before you move to Sandbox review:

Each task is marked completed and turns green when the last 20 requests have no errors for a period of 14 days. Continue to send successful requests to ensure that the milestone remains green.

API RTU and Feeds

API RTUs notify Google about incremental changes to inventory availability and bookings in real-time. In addition to RTUs, send complete Availability Feeds daily. This ensures that Google has the most accurate and latest availability information as it exists in your system. Complete Feeds act as a snapshot of the latest state of inventory availability in your system.

For more information, see the following resources:

Access the API

Your Google Cloud project is how you access the Actions Center's Maps Booking API, which is how you submit RTUs. You must use a Google Account within the Google Developers console and provide your Cloud Project Number in the Setup milestone of your onboarding plan. For more information on how to enable Cloud APIs, see Enable CloudAPIs.

Use RESTful calls or download the client library

We recommend that you make RESTful calls directly to the Maps Booking API with JSON payloads. For more information, see REST API documentation.

You can also use client libraries to connect to the API.

.
Language Download link
Java Java client library. For more information, see Java client instructions

Additional support libraries that handle authorization and other aspects of calls to Google APIs are available to download. For more information, see Code Samples.

Fetch the Discovery document

For some client libraries, such as Ruby, it's necessary to fetch the Discovery document for the API that describes its methods and parameters.

To fetch the Discovery document, use the following command:

curl -s -o mapsbooking_rest

https://mapsbooking.googleapis.com/$discovery/rest?version=v1alpha

For more information on how to access the API from Ruby, see Ruby API Client and Ruby Auth Library.

Make authorized calls to the API

When you make calls to the API, refer to Preparing to make a delegated API call to authorize your service account with your private key and the following OAuth scope:

https://www.googleapis.com/auth/mapsbooking

Sandbox and Production endpoints

You can make calls to both the Sandbox and Production environments through the API. Make sure that you enable both APIs in your Google Cloud project. Both APIs use the same scope, but they have different endpoints.

Production endpoint: https://mapsbooking.googleapis.com/

Sandbox endpoint: https://partnerdev-mapsbooking.googleapis.com/

The following is an example in Java of how to switch endpoints:

 // This block of code is for OAuth and is the same for prod and sandbox.
    GoogleCredential
      .fromStream(new FileInputStream(...))
      .createScoped(Collections.singleton("https://www.googleapis.com/auth/mapsbooking"))

    // This block of code sets the endpoint. This is what you'd change to connect to the sandbox.
    new GoogleMapsBookingAPI.Builder(...)
      .setApplicationName(...)
      .setRootUrl("https://partnerdev-mapsbooking.googleapis.com/") // you add this to change the endpoint to use partnerdev.
      .build()