onStockOrdered
Purpose
Triggered when stock is ordered for a shop. Use this hook to track wholesale spending and monitor supply chain.
When It Triggers
Employee or owner places a stock order
Order is confirmed and paid for
Parameters
data.source
number
Server ID of who ordered
data.shopId
string
Unique shop identifier
data.shopName
string
Display name of the shop
data.orderId
string
Unique order identifier
data.items
table
Array of ordered items
data.items[i].item
string
Item spawn name
data.items[i].label
string
Item display name
data.items[i].quantity
number
Quantity ordered
data.items[i].unitCost
number
Cost per unit
data.items[i].totalCost
number
Total cost for this item
data.totalCost
number
Original total cost
data.finalCost
number
Final cost after discounts
data.reputationDiscount
number
Discount from shop reputation (%)
data.discountAmount
number
Dollar amount saved
data.paymentMethod
string
'business', 'cash', or 'bank'
data.totalItems
number
Total number of items ordered
data.deliveryTime
number
Minutes until delivery
data.estimatedDelivery
string
Estimated delivery time string
data.orderedBy
string
Name of person who ordered
data.orderedByIdentifier
string
Identifier of person who ordered
data.timestamp
number
Server timestamp
Example
Last updated