Got it—you already use
as “My invoices” (i.e., the invoices that belong to the tenant who is currently logged-in). Now you need an admin-level page that shows every invoice from every tenant.
Below are a few naming patterns that keep things clear for both humans and code, starting with the most idiomatic REST option and then some pragmatic fallbacks if you can’t touch the existing route.
────────────────────────────────────────
- Best-practice, if you’re willing to introduce tenant IDs
────────────────────────────────────────
• Global list (all tenants):
/invoices ← becomes the master collection
• Per-tenant list:
/tenants/{tenantId}/invoices or /customers/{customerId}/invoices
• “My invoices” shortcut (optional):
/my/invoices → internally redirects to /tenants/{currentTenantId}/invoices
Why this rocks
– Fits the “collection → sub-collection” model.
– Leaves /invoices in its most intuitive meaning (“all invoices”).
– Lets you expand later (/tenants/{id}/payments, /tenants/{id}/users, …).
Migration tip
Keep /invoices pointing to the tenant-scoped list for now, add a deprecation banner, and move tenant users to /my/invoices with a 301 redirect after a grace period.
────────────────────────────────────────
2. If /invoices MUST stay tenant-scoped
────────────────────────────────────────
Give the global view its own clear namespace:
Option A – “admin” prefix
/admin/invoices (or /admin/customers/invoices)
Option B – adjective in the slug
/all-invoices (hyphen because it’s one concept)
/global-invoices
Option C – trailing segment
/invoices/all (reads as “invoices → all”)
Most teams pick /admin/invoices when the visibility is strictly role-based.
────────────────────────────────────────
3. Query-param toggle (quick but not as clean)
────────────────────────────────────────
/invoices?scope=all (admin only)
/invoices?scope=mine (default)
Works in a pinch, but mixes resource identity (“which collection?”) with filtering, so it’s sometimes frowned upon for long-term URLs.
────────────────────────────────────────
Recommendation cheat-sheet
────────────────────────────────────────
👍 Use path segments, not query params, to express different collections.
👍 Reserve the bare plural noun (/invoices) for the broadest list, if you can.
👍 Prefix by role (/admin/…), tenant (/tenants/{id}/…), or adjective (/all-invoices) to disambiguate.
👎 Avoid underscores; use hyphens inside a single slug, slashes for hierarchy.