> For the complete documentation index, see [llms.txt](https://docs.ragnasync.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ragnasync.com/event-logs/economy/vending-items.md).

# Vending Items

Logs when players open vending shops with their item listings

The Vending Items feature logs when a player opens a vending shop, showing all the items they're selling and their prices. This is a snapshot of what's available in the shop at the moment it opens.

## Action

`vending_item`

## When It's Used

This log is triggered when:

* A player **opens a vending shop** (uses the Vending skill)
* The shop setup is complete with items and prices

This happens once when the shop opens, not on each sale.

## Why Use It

* **Advertise player shops** to your Discord community
* **Track market prices** for popular items
* **Help players find deals** without logging in
* **Monitor merchant activity** on your server
* **Create a marketplace preview** channel

## Server Configuration

Vending item logging uses the same settings as vending transaction logging. In `conf/channels.conf`:

```
// Player vending logging (includes shop openings)
ragnasync_vending_log_enabled: true
ragnasync_vending_log_channel_id: "YOUR_CHANNEL_ID"
ragnasync_vending_log_min_zeny: 0
ragnasync_vending_log_group_min: 0
ragnasync_vending_log_group_max: 99
```

| Setting      | Description                                           | Default |
| ------------ | ----------------------------------------------------- | ------- |
| `enabled`    | Enable/disable vending logging                        | `false` |
| `channel_id` | Discord channel ID for vending logs and shop listings | -       |
| `min_zeny`   | Minimum zeny threshold (doesn't affect shop openings) | `0`     |
| `group_min`  | Minimum GM group level to log                         | `0`     |
| `group_max`  | Maximum GM group level to log                         | `99`    |

**Note:** Shop opening messages are always sent when vending logging is enabled, regardless of `min_zeny`.

## Message Format

The default message lists all items in the newly opened shop:

```
🏪 Vending Item:  | MerchantName     | Red Potion           | 2,000z
🏪 Vending Item:  | MerchantName     | Blue Potion          | 5,000z
🏪 Vending Item:  | MerchantName     | Lord Kaho's Horn     | 5,000,000z
```

## Data Fields

| Field         | Type   | Description                             |
| ------------- | ------ | --------------------------------------- |
| `player_name` | string | Name of the merchant character          |
| `list`        | string | All items being sold (see format below) |
| `pos`         | string | Shop location: \`map                    |
| `account_id`  | int    | Merchant's account ID                   |
| `char_id`     | int    | Merchant's character ID                 |
| `channel`     | string | Discord channel ID                      |

### List Format

Items are sent as a comma-separated list with pipe-delimited values:

```
item_id|item_name|price,item_id|item_name|price,...
```

**Example:**

```
512|Apple|2000,5013|Lord Kaho Horn|5000000,2301|Cotton Shirt|50000
```

The price is per unit, not total.

## Example Use Cases

### Public Marketplace Channel

Let players browse shop listings from Discord:

```
ragnasync_vending_log_channel_id: "1234567890"  // #marketplace
```

### Price Tracking

Monitor how items are being priced across your server.

### Shop Directory

Create a searchable channel of active vending shops with their locations.

### Deal Alerts

Players can watch the channel for items they're looking for at good prices.

## Custom Messages

Want to customize how these messages look? Head to the **Message Routes** page on your dashboard, set the format to **Custom Message**, and compose your own template using `{{placeholder}}` syntax.

**Example template:**

```
:label: {{player_name}} is selling {{item_name}} for {{price}}z
```

**Available placeholders for this event:**

| Placeholder       | Example            |
| ----------------- | ------------------ |
| `{{player_name}}` | Marky              |
| `{{item_name}}`   | Apple              |
| `{{price}}`       | 50000              |
| `{{pos}}`         | prontera\|150\|180 |

See [Message Routing](/ragnascript/message-routing.md) for more about formats, conditions, and multi-channel routing.

## Notes

* Sent once when the shop opens, not on each sale
* Maximum 12 items per shop (game limit)
* Price shown is per unit
* Use with Vending Logs to track actual sales
* Position helps players find the shop in-game
