Integrations

Discord Webhooks

XAuctionHouse can send rich embeds to Discord channels via webhooks. There are two separate webhook configurations:

Sales webhook

Sends notifications for marketplace events. Enable in config.yml:

discord-sales:
  enabled: true
  webhook-url: "https://discord.com/api/webhooks/..."

Events sent to the sales webhook:

EventEmbed ColorDescription
New ListingBlueA player listed an item for fixed-price sale
New AuctionPurpleA player started an auction
Item PurchasedGreenA fixed-price item was bought
Bid PlacedYellowA bid was placed on an auction
Auction WonGoldAn auction ended with a winner

Admin webhook

Logs administrative actions for audit purposes:

discord-admin:
  enabled: true
  webhook-url: "https://discord.com/api/webhooks/..."
EventEmbed ColorDescription
Force RemoveRedAn admin force-removed a player's listing
PurgeOrangeAn admin purged expired or sold items

All embeds include a timestamp. When cross-server sync is enabled, the server name is included in the footer.

PlaceholderAPI

If PlaceholderAPI is installed, XAuctionHouse registers the following placeholders:

PlaceholderDescription
%xauctionhouse_sell_limit%Maximum sell slots for the player (based on ah.limit.* permission)
%xauctionhouse_sell_count%Current number of active listings
%xauctionhouse_expired_count%Current number of expired listings
%xauctionhouse_active_auctions%Number of active auction listings by this player
%xauctionhouse_active_bids%Number of items where this player is the highest bidder

These placeholders work in scoreboards, tab lists, holograms, and anywhere PlaceholderAPI is supported. Use them to show players their auction house stats.

Web Dashboard API

XAuctionHouse registers a web module with the XCore dashboard. It provides 5 pages (Listings, Expired, Sales History, Player Lookup, Statistics) and the following API endpoints.

All endpoints require Authorization: Bearer <token> authentication. Rate limit: 30 requests per IP per minute.

GET endpoints

EndpointDescription
GET /api/xauctionhouse/listingsReturns the 100 most recent active listings
GET /api/xauctionhouse/salesReturns the 100 most recent completed sales
GET /api/xauctionhouse/statsAggregate stats: active listings count, total sold, total expired
GET /api/xauctionhouse/stats/dailyLast 7 days: daily volume, top 10 sellers, top 10 buyers
GET /api/xauctionhouse/expired?page=1&limit=50Paginated expired/cancelled listings
GET /api/xauctionhouse/history?page=1&limit=50&search=namePaginated transaction history with optional player search
GET /api/xauctionhouse/player/{name}Player's active listings, sold items, bought items, and expired listings
GET /api/xauctionhouse/player/{name}/historyPlayer's complete buy/sell transaction history

POST endpoints

EndpointBodyDescription
POST /api/xauctionhouse/listing/cancel{"id": int}Cancel a single active listing by ID
POST /api/xauctionhouse/listing/cancel-all{"player": "name"}Cancel all active listings by a player
POST /api/xauctionhouse/expired/clear{"player": "name"} or {}Delete expired listings (for one player, or all if no player specified)

Response format

All responses are JSON. Listing objects include item details extracted from the serialized ItemStack:

{
  "sellerName": "Steve",
  "price": 500.0,
  "currency": "coins",
  "listingType": "FIXED_PRICE",
  "itemDetails": {
    "material": "DIAMOND_SWORD",
    "amount": 1,
    "displayMaterial": "Diamond Sword",
    "enchantments": [
      {"name": "Sharpness", "level": 5}
    ]
  }
}

For auction listings, additional fields are included: startingBid, currentBid, bidCount, and highBidder.

POST endpoints that modify listings automatically publish cross-server sync messages, so changes are reflected on all servers immediately.

Cross-Server Sync

When cross-server sync is enabled in XCore, XAuctionHouse registers a sync channel to propagate listing changes across all servers in real-time.

Sync events include:

  • ADD — A new listing was created
  • REMOVE — A listing was purchased, cancelled, or force-removed
  • BID — A bid was placed on an auction

This means players on any server see the same auction house contents. When a listing is bought on Server A, it immediately disappears from the GUI on Server B.

For instant sync, configure Redis in XCore. Without Redis, sync falls back to database polling with a configurable delay.