Skip to main content

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:

StatusMeaning
PENDING_PAYMENTOrder submitted, waiting for payment.
PAIDPayment confirmed.
FULFILLINGOrder is being prepared for shipment.
SHIPPEDOrder has been shipped; tracking number may be available.
COMPLETEOrder delivered and closed.
CANCELLEDOrder was cancelled before fulfillment.
REFUNDEDPayment fully returned to the customer.
PARTIALLY_REFUNDEDOne 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

  1. Click on the order you want to update.
  2. Change any of the editable fields: status, shipping status, tracking number, notes, or line items.
  3. Click Save.

Common update scenarios:

  • Mark as paid — Change status from PENDING_PAYMENT to PAID after 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

StatusMeaning
PENDINGNo shipping action taken yet.
LABEL_CREATEDShipping label generated.
SHIPPEDPackage handed off to carrier.
DELIVEREDPackage delivered to customer.
FAILEDDelivery failed or returned.

Confirming Payments

For manual payment methods (Venmo, Cash App, Zelle, etc.), you confirm payment once you have verified funds:

  1. Open the order.
  2. Change the status to PAID.
  3. 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

ModeWhat it does
Full refundRefunds the entire remaining balance, reverts all inventory, revokes all entitlements.
Partial by amountReduces 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 itemsReverts the specified items in inventory, revokes entitlements for those product IDs, and derives the refund amount from quantity × unitPriceCents for each item.
BothAvailable 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

  1. Open the order in the admin panel.
  2. Click the Refund action button.
  3. 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:quantity pairs (comma-separated).
  4. 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-separated productId:quantity pairs (e.g. prod-1:2,prod-2:1). Quantity defaults to 1 when omitted.
  • Providing both amount and items in 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.refunded event 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.

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.