Order Management
The Orders section lets you view, update, and fulfill orders placed by customers through the Discord bot or other channels.
Prerequisites
- Admin access to the Ledgerline Admin Panel.
- At least one order in the system (orders are created when customers complete the Discord ordering flow, which supports buttons, product lists, and saved address reuse).
Viewing Orders
Open Orders in the admin sidebar. You will see a list of all orders for the current tenant, showing:
- Order number
- Customer name
- Status
- Total amount
- Date created
Click on any order to see its full details, including line items, shipping address, payment information, discount applied, sales tax, and notes.
Order Statuses
Orders follow this lifecycle:
| Status | Meaning |
|---|---|
| PENDING_PAYMENT | Order submitted, waiting for payment. |
| PAID | Payment confirmed. |
| FULFILLING | Order is being prepared for shipment. |
| SHIPPED | Order has been shipped; tracking number may be available. |
| COMPLETE | Order delivered and closed. |
| CANCELLED | Order was cancelled before fulfillment. |
| REFUNDED | Payment fully returned to the customer. |
| PARTIALLY_REFUNDED | One or more partial refunds have been applied. Further refunds are still possible until the cumulative refunded amount equals the order total, at which point the status transitions to REFUNDED. |
Sales Tax
If TaxJar is configured for this store, the order total includes sales tax calculated at checkout based on the customer's shipping address. The tax amount is shown as a separate line on the order receipt embed. For orders placed before TaxJar was enabled, taxAmountCents defaults to 0.
Updating an Order
- Click on the order you want to update.
- Change any of the editable fields: status, shipping status, tracking number, notes, or line items.
- Click Save.
Common update scenarios:
- Mark as paid — Change status from
PENDING_PAYMENTtoPAIDafter verifying payment. - Add tracking — Enter the tracking number and set shipping status to
SHIPPED. - Cancel — Set status to
CANCELLED. If inventory tracking is enabled, reserved stock is released.
Shipping Statuses
| Status | Meaning |
|---|---|
| PENDING | No shipping action taken yet. |
| LABEL_CREATED | Shipping label generated. |
| SHIPPED | Package handed off to carrier. |
| DELIVERED | Package delivered to customer. |
| FAILED | Delivery failed or returned. |
Confirming Payments
For manual payment methods (Venmo, Cash App, Zelle, etc.), you confirm payment once you have verified funds:
- Open the order.
- Change the status to PAID.
- Save the order.
Payment confirmation can also be done from Discord using the /payment-confirm command.
Refunding an Order
Ledgerline supports full and partial refunds. Partial refunds may be applied multiple times until the cumulative refunded amount equals the order total, at which point the order transitions to REFUNDED.
Refund Modes
| Mode | What it does |
|---|---|
| Full refund | Refunds the entire remaining balance, reverts all inventory, revokes all entitlements. |
| Partial by amount | Reduces the payment's refunded amount by the specified cents. No inventory change — use when the customer keeps the product (e.g. damage compensation). |
| Partial by items | Reverts the specified items in inventory, revokes entitlements for those product IDs, and derives the refund amount from quantity × unitPriceCents for each item. |
| Both | Available via AdminJS panel: specify both a custom amount and items to revert. The item list drives inventory/entitlements; the amount overrides the derived price sum. |
Via Admin Panel
- Open the order in the admin panel.
- Click the Refund action button.
- In the refund form, choose:
- Full — refund the entire remaining balance (default).
- Partial by amount — enter the amount in cents.
- Partial by items — enter item
productId:quantitypairs (comma-separated).
- Enter a reason and submit.
The order status is updated to PARTIALLY_REFUNDED or REFUNDED depending on the refunded total. Payment record and inventory are updated accordingly.
Via Discord
Admin users can refund an order with:
/refund order:<orderId> reason:<text>
Optional partial-refund parameters (provide at most one):
/refund order:<orderId> reason:<text> amount:<cents>
/refund order:<orderId> reason:<text> items:<productId:qty,productId:qty>
amount— amount in cents to refund (no inventory change).items— comma-separatedproductId:quantitypairs (e.g.prod-1:2,prod-2:1). Quantity defaults to 1 when omitted.- Providing both
amountanditemsin the same Discord command is rejected with an error; use the AdminJS panel for combined refunds.
The reason defaults to "Admin-initiated refund" when omitted.
After a refund:
- Inventory is restored for the affected line items.
- The
order.refundedevent is emitted, which triggers entitlement revocation (Discord role removal) for the affected products. - Subsequent partial refunds can be applied until the order is fully refunded.
Deleting an Order
To remove an order entirely, open the order detail view and click Delete. This permanently removes the order record. Use with caution — consider cancelling instead.
Sending a Pay-by-Invoice Link
When a customer placed an order through Discord but needs to pay via a browser (for example, because they want to use a card or Bitcoin), you can generate a shareable invoice link.
API: POST /api/orders/:id/invoice-link
The link is a time-limited, HMAC-signed URL that the customer can open in any browser. It shows the order summary and payment buttons for the processor-backed methods your tenant has enabled. Manual P2P methods (Venmo, Zelle, etc.) do not appear on the invoice page.
Requires: INVOICE_LINK_SIGNING_SECRET environment variable must be set on the server. Links expire after 7 days by default; pass expiresInSeconds in the request body to override.