🌐Customer Return PortalShareable, unauthenticated portal with branded UI. Customers enter order number + email to look up their order, select items to return with quantity, choose resolution, and submit.
🛡️Security-First DesignIn-memory token bucket rate limiting (10 lookups/5min per IP+slug). Strict input validation with regexes before GraphQL queries. Generic error messages to prevent order enumeration.
📋Inventory Ledger SystemBefore accepting a return, builds a per-line-item ledger: total ordered - already fulfilled - already refunded - previously claimed. Prevents double-claiming of return quantities.
📊Admin Returns DashboardFull list/filter/search of return requests with status badges, detail view, and status transition controls (Approve, Reject, Mark Received, Mark Refunded/Exchanged).
🔢RMA Number GenerationShort, human-friendly RMA numbers (e.g., RMA-A3B9K7X2) using a clean alphabet. Auto-tags Shopify orders with return-requested for easy identification.
📧Email NotificationsSends status-update emails to customers and new-return notifications to merchants via Resend. Branded HTML templates with status-specific colors.