# Feeds Ready

Feeds provide your inventory data to the Actions Center. This daily Secure File
Transfer Protocol (SFTP) upload updates all of the merchants, services, and
availability slots data. Feeds specify which merchants you support,
their availability, and any special features required to confirm that Google
displays your inventory properly. Feeds are uploaded to the SFTP dropboxes that
are configured when you provide your SSH key in
[Setup](https://developers.google.com/actions-center/verticals/reservations/e2e/integration-steps/setup/public-ssh-key).

You must complete the following Feeds Ready tasks before you move to Booking Server:

- [Merchant Feed Ready](https://developers.google.com/actions-center/verticals/reservations/e2e/integration-steps/feeds/merchants-feed)
- [Services Feed Ready](https://developers.google.com/actions-center/verticals/reservations/e2e/integration-steps/feeds/services-feed)
- [Availability Feed Ready](https://developers.google.com/actions-center/verticals/reservations/e2e/integration-steps/feeds/availability-feed)
- [Data quality](https://developers.google.com/actions-center/verticals/reservations/e2e/integration-steps/feeds/data-quality-check)

The tasks will be marked as completed and turn green after you upload your feeds
successfully. Review the linked documentation to complete each specific
milestone task.

For proper functionality of your
[Dining Reservations End-to-End integration](https://developers.google.com/actions-center/verticals/reservations/e2e/overview),
you need to provide daily Merchant Feed, Services Feed, and Availability Feed
uploads automatically. Your automated feed infrastructure must provide your full
inventory.

> [!NOTE]
> **Note:** All feeds must be uploaded with `processing_instruction` as `PROCESS_AS_COMPLETE`. `PROCESS_AS_INCREMENTAL` is deprecated and can't be used.

## Feed types

Dining Reservations End-to-End integrations require the following feeds and their
upload frequencies:

| Feed | Description | Frequency | Sample |
|---|---|---|---|
| [Merchant](https://developers.google.com/actions-center/verticals/reservations/e2e/integration-steps/feeds/merchants-feed) | Describes your merchants. | Once every 24 hours | [Merchant Feed sample](https://developers.google.com/actions-center/verticals/reservations/e2e/reference/feeds/merchants-feed) |
| [Services](https://developers.google.com/actions-center/verticals/reservations/e2e/integration-steps/feeds/services-feed/samples-definitions#definitions) | Describe the services of your merchants. | Once every 24 hours | [Services Feed sample](https://developers.google.com/actions-center/verticals/reservations/e2e/reference/feeds/services-feed) |
| [Availability](https://developers.google.com/actions-center/verticals/reservations/e2e/integration-steps/feeds/availability-feed) | Describes the available slots for services of your merchants. A minimum 30 days of coverage must be provided. To extend the coverage to 90 days, contact Google support through the Actions Center [contact form](https://actionscenter.google.com/support/cases). | Once every 24 hours | [Availability Feed sample](https://developers.google.com/actions-center/verticals/reservations/e2e/reference/feeds/availability-feed) |

> [!NOTE]
> **Note:** The Actions Center expects accurate real-time inventory status for party sizes.

Feed formats are described with the
[protocol buffer 3 syntax](https://developers.google.com/protocol-buffers/docs/proto3), but you can upload
your feeds per the corresponding JSON format. Refer to the feed samples for the
JSON format. We recommend that you upload the feeds in JSON format.

## Naming conventions and metadata

### File names

If you use
[sharding](https://developers.google.com/actions-center/verticals/reservations/e2e/integration-steps/feeds#feed-file-shard-compress),
the feeds that you upload must have unique names that specify the feed type
and count. A timestamp for feed generation satisfies the unique requirement of
your feed file naming.

**Structure** : `{feed_name}_{timestamp_epoch}_{shard_nunber}_{total_shard}.json`

**Example** : `availability_feed_1574117613_001_of_002.json.gz`

### Define IDs

When you define IDs for your merchants or other attributes that require
an ID, we strongly recommend to use UID or UUIDs. You can provide your own
alphanumeric solution as long as IDs remain distinct across your platform.

> [!NOTE]
> **Note:** Never use Uniform Resource Identifiers (URIs) as IDs.

### Metadata

When you create feeds, the `generation_timestamp` must reflect the time when the
data was pulled from the database. Reuse of this value across feeds can lead
to processing errors.

Nonce values, random or non-repeating numbers, must be unique across feed types
and can't be reused. The value must match for all files in
the specific sharded feed.

## Feed file size

### Sharding feed files

Based on your inventory, sharding or breaking up feeds into multiple files might
be necessary. Your feeds might need sharding in the following conditions:

- Compressed gzip feed exceeds 200 MB for one file.
  - **Example**: generated Availability Feed is 1 GB. This must be sharded to five or more separate shards.
- Partner inventory is distributed across systems or regions which results in difficulty reconciling the inventory.
  - **Example** : partner has US and EU inventory that live in separate systems. The feed might be generated with two shards. One for the US and one for the EU with the same nonce and `generation_timestamp`.

For more information, see
[Shard feed files tutorials and best practices](https://developers.google.com/actions-center/verticals/reservations/e2e/reference/tutorials/sharding).

A feed can constitute multiple files called **shards**. To determine the size of
the feeds, use the following guidelines:

- Suggested feed sharding:
  - **Merchant Feed**: one shard.
  - **Services Feed**: one shard.
  - **Availability Feed** : less than 20 shards. If you have a business justification that requires more than specified amount, [contact support](https://actionscenter.google.com/support/cases) for further instruction.
- Size of feed files and sharding:
  - Keep shard file size less than 200 MB after compression. Use multiple shards if needed.
  - Individual records sent in one shard don't need to be sent in the same shard in future feeds.
  - For better performance, split data evenly among the shards to make all the shard files similar in size.
  - If necessary, use gzip to compress plain text JSON feeds for each individual feed shard.

### Compress feed files

Any JSON or PB3 file can be compressed with gzip before you upload. This can
significantly reduce the byte size of daily feeds.

Each shard file must be gzip'd and uploaded individually such as gzip\*.json.
Compressed feed shards must end in .json.gz or .pb3.gz.

## Upload the feeds to your SFTP dropbox

After you generate the
[Merchant](https://developers.google.com/actions-center/verticals/reservations/e2e/integration-steps/feeds/merchants-feed),
[Service](https://developers.google.com/actions-center/verticals/reservations/e2e/integration-steps/feeds/services-feed),
and [Availability](https://developers.google.com/actions-center/verticals/reservations/e2e/integration-steps/feeds/availability-feed)
Feeds, you can upload your feeds to the Sandbox or Production environment
through the SFTP dropbox. The SFTP dropbox is configured when you provide your
[SSH key in Setup](https://developers.google.com/actions-center/verticals/reservations/e2e/integration-steps/setup/public-ssh-key).
The Google SFTP server is available at `sftp://partnerupload.google.com` on port
19321.

Google reviews and validates feeds files as soon as they are uploaded to the
SFTP dropbox. If the feed is sharded across multiple files, they are processed
after you upload the last file. If your feed contains errors, an email is sent
to you with the [feed error codes](https://developers.google.com/actions-center/verticals/reservations/e2e/reference/feeds/feed-errors).
Errors prevent defined merchants, services, or availability from being
ingested. After the feeds are validated, it can take up to 24 hours until the
feeds appear on the frontend.

> [!WARNING]
> **Warning:** Upload your feeds to the Production dropboxes only after Google tests and confirms your feeds in the Sandbox environment. To access the Sandbox environment, set the [environment switcher](https://developers.google.com/actions-center/verticals/reservations/e2e/partner-portal/overview/environment-switcher) at the top of your Actions Center window to Sandbox.