Skip to main content

Inventory Management

The Inventory section shows stock levels for your products and lets you make manual adjustments.

Prerequisites

  • Admin access to the Ledgerline Admin Panel.
  • At least one product with inventory tracking enabled.

How Inventory Works

Each inventory-tracked product has a snapshot that records:

FieldDescription
Quantity AvailableUnits currently available for sale.
Quantity ReservedUnits held for submitted but unfulfilled orders.

When a customer submits an order through Discord, the system automatically reserves the ordered quantity. If the order is cancelled, the reserved quantity is released back to available stock.

Viewing Inventory

Open Inventory in the admin sidebar. You will see each product's current available and reserved quantities.

Inventory Transactions

Every stock change is recorded as an inventory transaction. Transaction types include:

TypeMeaning
ADJUSTMENTManual change by an admin.
RESERVEStock reserved for a submitted order.
RELEASEReserved stock returned (order cancelled).
SALEStock deducted after payment confirmation.
RESTOCKNew stock added.

Stock Quantity Visibility

Admins can control whether customers see exact stock counts or a simple "In stock / Out of stock" indicator.

  • Tenant default: set defaultQtyVisibility in Bot Config to public (show counts) or private (hide counts). Applies to every product unless overridden.
  • Per-product override: each product has a qtyVisibility field with three values:
    • inherit — use the tenant default (default for new products).
    • public — always show the exact quantity on this product.
    • private — always hide the exact quantity on this product.

When visibility resolves to private, /catalog and /stock render "In stock" for any positive quantity and "Out of stock" for zero.

Product Cost vs. Price

Each product now has two price fields:

  • priceCents — customer-facing price, shown in catalog / order / receipts.
  • costCents — your cost basis. Admin-only. Never returned in customer-facing API output. Use it for margin reporting.

Set both when creating or editing a product in the admin panel.

Default Product Image

In Bot Config, set defaultProductImageUrl to a fallback image URL. Any product without its own image will use this URL in catalog embeds. If neither is set, Ledgerline falls back to a placeholder image.

Each transaction records the quantity change, the associated order (if any), and an optional reason.

Making a Manual Adjustment

  1. Open the inventory record for the product.
  2. Update the available quantity.
  3. Provide a reason for the adjustment (recommended for audit purposes).
  4. Click Save.

Discord Commands for Inventory (Admin)

Two admin-only commands are available directly in Discord:

/restock product:<name> quantity:<n>

Adds stock to a product. Uses Discord autocomplete on the product option. Responds with an ephemeral confirmation: Restocked Widget: 5 → 12 units. See restock command docs.

/add-item

Opens a modal to create a new draft product (isActive=false, isPublished=false). After submission, you receive an AdminJS deep-link to upload an image and publish the product. See add-item command docs.

Low-Stock Alerts

When a product's available quantity drops to or below the lowInventoryThreshold configured in Bot Config, Ledgerline:

  1. Creates an alert record (type LOW_INVENTORY, severity WARN) in the Alerts panel.
  2. Posts a message to announcementChannelId if configured.
  3. If lowStockAnnounceEveryone is true in Bot Config, prefixes the message with @everyone.

Alerts fire once per threshold-crossing. Running /restock resets the alert gate — the next time qty drops below threshold, a new alert fires.

Bot Config fields:

  • lowInventoryThreshold — qty at or below which an alert fires (default: 5).
  • lowStockAnnounceEveryone — whether to @everyone in the announcement (default: false).

Keep an eye on the Alerts section to stay ahead of stockouts.

Draft Products

Products created via /add-item start as isPublished=false. They are invisible in /catalog and /stock until an admin sets isPublished=true in the AdminJS panel. This allows you to prepare a product (upload image, set final price) before it goes live.