Order Lifecycle
Understanding how orders progress from creation to completion.
Lifecycle Overview
An order goes through several states during its lifetime:
PENDING → IN_PROGRESS → DELIVERED → COMPLETED
↓
CANCELLED
Order States
PENDING
Description: Order created, waiting for deliveries
Characteristics:
- No items delivered yet
- Escrow balance held (if charge-on-creation enabled)
- Visible to all players
- Can be cancelled (if allowed)
Transitions:
- →
IN_PROGRESSwhen first delivery occurs - →
CANCELLEDif cancelled - → Expired if time limit reached
IN_PROGRESS
Description: Order has partial deliveries
Characteristics:
- Some items delivered
- Partial payment made to deliverers
- Remaining items still needed
- Can receive more deliveries
Transitions:
- →
DELIVEREDwhen all items delivered - →
CANCELLEDif cancelled (may be restricted) - → Expired if time limit reached
DELIVERED
Description: All items delivered, waiting for collection
Characteristics:
- All items delivered
- Deliverers paid
- Items available for collection
- Order creator can collect items
Transitions:
- →
COMPLETEDwhen all items collected - → Auto-deleted when fully collected and paid
COMPLETED
Description: Order fully fulfilled and collected
Characteristics:
- All items collected
- All payments processed
- Order ready for deletion
- Auto-deleted to save storage
Transitions:
- → Deleted (automatic cleanup)
CANCELLED
Description: Order cancelled by creator or admin
Characteristics:
- Order no longer active
- Escrow refunded (if enabled)
- No new deliveries allowed
- May be kept for record-keeping
Transitions:
- → Deleted (optional, configurable)
Lifecycle Diagram
State Transitions
Creation → PENDING
When an order is created:
- Order created with
PENDINGstatus - Payment deducted (if charge-on-creation enabled)
- Escrow balance set
- Order visible to all players
PENDING → IN_PROGRESS
When first delivery occurs:
- First items delivered
- Status changes to
IN_PROGRESS - Partial payment to deliverer
- Remaining items still needed
IN_PROGRESS → DELIVERED
When all items delivered:
- Last items delivered
- Status changes to
DELIVERED - All deliverers paid
- Items available for collection
DELIVERED → COMPLETED
When all items collected:
- Order creator collects items
- Status changes to
COMPLETED - Order auto-deleted
- Lifecycle complete
Any State → CANCELLED
When order is cancelled:
- Status changes to
CANCELLED - Escrow refunded (if enabled)
- No new deliveries allowed
- Order removed from active list
Expiration
Orders can expire if order-life is configured:
- Expiration Check: Periodic check for expired orders
- Auto-Refund: Escrow refunded if enabled
- Status Update: Order marked appropriately
- Cleanup: Expired orders with no uncollected items are deleted
Concurrent Operations
The plugin handles concurrent operations safely:
- Multiple Deliveries: Multiple players can deliver simultaneously
- Optimistic Locking: Prevents over-delivery
- Transaction Safety: Database transactions ensure consistency
Best Practices
- Monitor Order Status: Use
/orders myordersto track your orders - Collect Promptly: Collect items soon after delivery
- Cancel Early: Cancel orders before deliveries if needed
- Check Expiration: Be aware of order expiration times
Related Documentation
- Escrow System - Payment handling
- Delivery System - How deliveries work
- Collection System - How collection works