> For the complete documentation index, see [llms.txt](https://shredded.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://shredded.gitbook.io/docs/paid-scripts/shr-pawnshop/webhook.md).

# WEBHOOK

Optional logging for completed sales is configured in `config.lua` and handled in `server/webhook.lua`.

## Setup

```lua
Config.Webhook = {
    enabled = true,
    url = "https://discord.com/api/webhooks/...",
    username = "Pawnshop",
    avatar = "https://...",  -- optional image URL
    color = 15844367,        -- embed color (decimal)
}
```

| Field      | Description                                |
| ---------- | ------------------------------------------ |
| `enabled`  | Must be `true` and `url` non-empty to send |
| `url`      | Discord webhook URL                        |
| `username` | Webhook display name                       |
| `avatar`   | Webhook avatar URL (optional)              |
| `color`    | Embed sidebar color                        |

## Embed contents

Each successful sale sends an embed with:

* Player name, server ID, character identifier
* Steam, license, Discord mention (if linked)
* Item name, amount, item id
* Total payout, unit price, configured price range

Webhook footer text: `pawnshop_raw` (internal identifier).

## Privacy

Only enable webhooks on servers where staff are allowed to see identifiers. Keep the webhook URL private — never commit it to public repositories.
