Admin API
The Admin API provides full access to manage your Switchyard store, including products, orders, inventory, customers, and more.Base URL
Authentication
All Admin API endpoints require authentication. You can authenticate using:- Session Cookie: Automatically included when logged into the admin dashboard
- Bearer Token: Supabase JWT in the Authorization header
Actively Used Endpoints
These are the endpoints actively used in Switchyard operations:Core Operations
| Category | Endpoints | Purpose |
|---|---|---|
| Products | /admin/products/* | Manage product catalog from retailer scraping |
| Inventory | /admin/inventory-items/* | Track stock levels at RFC and retailers |
| Stock Locations | /admin/stock-locations/* | Manage RFC warehouse zones and retailer locations |
| Orders | /admin/orders/* | View and manage customer orders |
| Draft Orders | /admin/draft-orders/* | Create test orders manually |
| Customers | /admin/customers/* | Manage customer accounts |
| Users | /admin/users/* | Manage admin users and roles |
Secondary Operations
| Category | Endpoints | Purpose |
|---|---|---|
| Price Lists | /admin/price-lists/* | Manage retailer cost prices and selling prices |
| Sales Channels | /admin/sales-channels/* | Configure storefronts |
| Regions | /admin/regions/* | Geographic configuration |
| Notifications | /admin/notifications/* | View system notifications |
Not Used
These endpoints are included for completeness but are not used in Switchyard operations:- Cart endpoints (cart handled in mobile app)
- Payment endpoints (payments in mobile app via Stripe)
- Gift Card endpoints
- Tax endpoints
- Promotion/Campaign endpoints
Permissions
Admin API endpoints require specific permissions based on the RBAC system. See the RBAC documentation for details on roles and permissions. Common permission requirements:| Resource | Read | Write | Delete |
|---|---|---|---|
| Products | products.read | products.write | products.delete |
| Orders | orders.read | orders.write | orders.delete |
| Inventory | inventory.read | inventory.write | inventory.scan |
| Customers | customers.read | customers.write | customers.delete |
Response Format
All responses are JSON with consistent structure:Success Response
Error Response