Skip to main content

Shipment Commands

Source: src/data/shipment/shipment.command.ts

/ship

Mark an order as shipped. Admin-only.

Usage

/ship order:<orderId> carrier:<text> tracking:<text>

Options

OptionTypeRequiredDescription
orderstringYesThe order ID to mark as shipped
carrierstringYesCarrier name (e.g. USPS, UPS, FedEx)
trackingstringYesTracking number

Permissions

Caller must have at least one role from the guild's adminRoleIds list. Returns a permission-denied message otherwise.

Behavior

  • Calls shipmentService.markShipped(ctx, orderId, { carrier, trackingNumber })
  • Idempotent: calling the same command twice with identical inputs is a no-op
  • Transitions shipment status to in_transit
  • Updates order status to SHIPPED
  • Emits shipment.shipped and order.shipped events

Example response (success)

Order `ord-abc123` marked as shipped via **USPS**. Tracking: `9400111899223197657496`

Example response (permission denied)

Permission denied: you must have an admin role to use `/ship`.

Dual path

The same service method is called by the AdminJS "Mark Shipped" action on the Order resource. Both paths apply identical validation.