# Consume the event from a service

Copy as Markdown[View as Markdown](/docs/tutorial/consume-event.md)

***

In this step, you will create `InventoryService` and connect it to the `OrderPlaced` event.

In EventCatalog, a service consumes an event by listing it under `receives`.

## In this chapter...

Here are the topics we'll cover

* Create the InventoryService page.
* Add OrderPlaced to the receives list.
* Refresh EventCatalog and inspect the full relationship.

### Create the service folder[​](#create-the-service-folder "Direct link to Create the service folder")

From the root of your catalog, create a new folder for the service:

```
mkdir -p services/InventoryService
```

### Add the service page[​](#add-the-service-page "Direct link to Add the service page")

Create a new file at `services/InventoryService/index.mdx` and add `receives` to the frontmatter:

services/InventoryService/index.mdx

```
---
id: InventoryService
name: Inventory Service
version: 0.0.1
summary: |
  Tracks stock levels and reserves inventory for customer orders.
receives:
  - id: OrderPlaced
    version: 0.0.1
---

## Overview

The inventory service tracks product avaliability and reservces stock when a customer places an order.
```

Keep the markdown content below the frontmatter as it is.

The frontmatter follows the same shape as `OrderService`:

* `id` is the stable identifier EventCatalog uses for links and references.
* `name` is the label people see in the UI.
* `version` is the version of this service.
* `summary` appears in service lists and page headers.
* `receives` lists the events this service consumes.

The `version` field inside `receives` is optional. If you leave it out, EventCatalog will use the latest version of the event.

### Check the service in EventCatalog[​](#check-the-service-in-eventcatalog "Direct link to Check the service in EventCatalog")

Refresh EventCatalog in your browser. You should now be able to find `InventoryService` in your catalog.

![The Inventory Service page in EventCatalog](/img/tutorial/inventory-service-page.png)

The Inventory Service page after adding the service file.

### Check the relationship[​](#check-the-relationship "Direct link to Check the relationship")

Refresh EventCatalog in your browser and open the `OrderPlaced` event page.

You should now be able to see both sides of the event:

* `OrderService` publishes `OrderPlaced`.
* `InventoryService` consumes `OrderPlaced`.

Open the `Map` view from the event page to see the relationship visually.

![The OrderPlaced event map showing OrderService as producer and InventoryService as consumer](/img/tutorial/order-placed-producer-consumer-map.png)

The OrderPlaced map showing OrderService publishing the event and InventoryService consuming it.

Show the visualizer on the page

You can embed the same kind of visualization directly into a documentation page with the [`NodeGraph`](/docs/development/components/components/nodegraph.md) component:

```
<NodeGraph />
```

When used on a service or event page, `NodeGraph` renders the graph for the current resource.

### What you have now[​](#what-you-have-now "Direct link to What you have now")

Your catalog now knows:

* `OrderPlaced` is an event.
* `OrderPlaced` has a schema.
* `OrderService` publishes `OrderPlaced`.
* `InventoryService` consumes `OrderPlaced`.

This is the first complete event relationship in the tutorial catalog.

### Next[​](#next "Direct link to Next")

Continue to [Add ownership](/docs/tutorial/add-ownership.md).
