Real Time Updates

Real time updates allow you to keep your offer inventory in sync with Google. You can push incremental updates in near real-time. Our system will compile the changes from Feed + RTU to display the most recent information to users.

API Endpoints

To push or delete real-time updates, use the following REST API endpoints:

Batch Push

  • Sandbox: https://partnerdev-mapsbooking.googleapis.com/v1alpha/inventory/partners/{partner_id}/feeds/google.offer/record:batchPush
  • Production: https://mapsbooking.googleapis.com/v1alpha/inventory/partners/{partner_id}/feeds/google.offer/record:batchPush

Batch Delete

  • Sandbox: https://partnerdev-mapsbooking.googleapis.com/v1alpha/inventory/partners/{partner_id}/feeds/google.offer/record:batchDelete
  • Production: https://mapsbooking.googleapis.com/v1alpha/inventory/partners/{partner_id}/feeds/google.offer/record:batchDelete

For more information on the Offer JSON object definition, see Offer. For more details on offer properties, visit the Offer reference page.

How to authenticate to the API

To connect to the API, refer to Authenticate with Mapsbooking API.

Limitations

When using the real-time updates API, keep the following limitations in mind:

  • protoRecord Only: The API is configured to only use protoRecord (not dataRecord).
  • Quota Limits: These APIs have a quota of 1500 requests per minute per partner account. Each request is capped to sending 1000 records for upsert or deletion.
  • Entity Mapping Restrictions: For each offer, partners can send an update for 1 entity ID. If you want to update the same offer on multiple entity IDs, the partner must send 1 record per entityId. entityIds must always be singular per record.
  • Add-on Offers: Because of the entity mapping restriction, add-on offers that are addOnOfferApplicableToAllEntities are not really supported for RTU update and cannot be updated this way (only via feeds).

Example

Batch Updates Example

Here is an example of pushing a real-time update via curl:

curl -X POST \
  -H "Authorization: Bearer $(gcloud auth application-default print-access-token --impersonate-service-account=test@myproject.gserviceaccount.com --scopes=https://www.googleapis.com/auth/mapsbooking)" \
  -H "Content-Type: application/json" \
  -d '{
  "records": [
    {
      "generationTimestamp": {
        "seconds": 100
      },
      "protoRecord": {
        "@type": "type.googleapis.com/madden.ingestion.offer.Offer",
        "offerId": "1",
        "entityIds": [
          "1234567890"
        ],
        "addOnOfferApplicableToAllEntities": false,
        "offerSource": "OFFER_SOURCE_AGGREGATOR",
        "actionType": "ACTION_TYPE_FOOD_DELIVERY",
        "offerModes": [
          "OFFER_MODE_WALK_IN"
        ],
        "offerCategory": "OFFER_CATEGORY_BASE_OFFER",
        "tags": [
          "OFFER_TAG_NEW_YEAR_SPECIAL"
        ],
        "offerDetails": {
          "offerDisplayText": "FLAT 10% off",
          "offerSummaryText": "MONDAY TO FRIDAY",
          "discountPercent": 10
        },
        "offerRestrictions": {
          "combinableWithOtherOffers": true,
          "inclusions": [
            {
              "description": "complementary drink"
            },
            {
              "description": " starters"
            }
          ],
          "exclusions": [
            {
              "description": "taxes and Tips"
            }
          ]
        },
        "validityPeriods": [
          {
            "timeOfDay": {
              "timeWindows": [
                {
                  "openTime": {
                    "hours": 10
                  },
                  "closeTime": {
                    "hours": 20
                  }
                }
              ]
            },
            "validPeriod": {
              "validFromTime": {
                "seconds": 10
              }
            }
          }
        ],
        "offerUrl": "https://www.google.com/offer"
      }
    }
  ]
}' \
  https://partnerdev-mapsbooking.googleapis.com/v1alpha/inventory/partners/20000123/feeds/google.offer/record:batchPush

Batch Delete Example

Here is an example of deleting an offer via curl:

curl -X POST \
  -H "Authorization: Bearer $(gcloud auth application-default print-access-token --impersonate-service-account=test@myproject.gserviceaccount.com --scopes=https://www.googleapis.com/auth/mapsbooking)" \
  -H "Content-Type: application/json" \
  -d '{
  "records": [
    {
      "deleteTime": {
        "seconds": 150
      },
      "protoRecord": {
        "@type": "type.googleapis.com/madden.ingestion.offer.Offer",
        "offerId": "1",
        "entityIds": [
          "1234567890"
        ]
      }
    }
  ]
}' \
  https://partnerdev-mapsbooking.googleapis.com/v1alpha/inventory/partners/20000123/feeds/google.offer/record:batchDelete