Stellarmart API v1
Base URL: https://api.stellarmartshop.com ·
Auth: Authorization: Bearer <token> · All responses use the envelope
{success, message, data|errors}. Lists add a meta object.
Demo accounts (password: password):
admin@stellermart.test · vendor.approved@stellermart.test · vendor.pending@stellermart.test · customer@stellermart.test
Stellarmart API v1 — Documentation
Stellarmart API v1
Base URL: https://api.stellarmartshop.com ·
Auth: Authorization: Bearer <token> · All responses use the envelope
{success, message, data|errors}. Lists add a meta object.
Demo accounts (password: password):
admin@stellermart.test · vendor.approved@stellermart.test · vendor.pending@stellermart.test · customer@stellermart.test
Auth
| Method | Endpoint | Access | Description |
|---|
| POST | /api/v1/auth/register | — | Register (admin|vendor|customer). Vendors start pending. 10/min |
| POST | /api/v1/auth/login | — | Login. Returns Sanctum token. 5/min |
| POST | /api/v1/auth/logout | auth | Revoke current token |
| GET | /api/v1/auth/me | auth | Current user profile |
| POST | /api/v1/auth/forgot-password | — | Send reset link. 5/min |
| POST | /api/v1/auth/reset-password | — | Reset password with token. 5/min |
| GET | /api/v1/auth/email/verify/{id}/{hash} | signed URL | Verify email address |
| POST | /api/v1/auth/email/verification-notification | auth | Resend verification email. 6/min |
Products (public)
| Method | Endpoint | Access | Description |
|---|
| GET | /api/v1/products | — | List sellable products. Filters: search, category, min_price, max_price, sort_by, page, per_page |
| GET | /api/v1/products/{product} | — | Product detail (sellable products are public) |
Customer
| Method | Endpoint | Access | Description |
|---|
| GET | /api/v1/customer/profile | auth | Own profile |
| PATCH | /api/v1/customer/profile | auth | Update own profile |
| GET | /api/v1/customer/addresses | auth | List addresses |
| POST | /api/v1/customer/addresses | auth | Create address |
| GET | /api/v1/customer/cart | auth | Current cart with totals |
| POST | /api/v1/customer/cart/items | auth | Add item { product_id, quantity }. 60/min |
| PATCH | /api/v1/customer/cart/items/{item} | auth | Update quantity { quantity } |
| DELETE | /api/v1/customer/cart/items/{item} | auth | Remove item |
| POST | /api/v1/customer/checkout | auth | Place order. Server calculates all totals. 10/min |
| GET | /api/v1/customer/orders | auth | Own order history |
| GET | /api/v1/customer/orders/{order} | auth | Order detail (own only) |
| POST | /api/v1/customer/orders/{order}/cancel | auth | Cancel in early states |
Vendor
| Method | Endpoint | Access | Description |
|---|
| GET | /api/v1/vendor/profile | vendor | Vendor profile (own) |
| PATCH | /api/v1/vendor/profile | vendor | Update vendor profile (own) |
| GET | /api/v1/vendor/products | approved vendor | Own products. Filters: status, search |
| POST | /api/v1/vendor/products | approved vendor | Create product (+ inventory via initial_quantity) |
| GET | /api/v1/vendor/products/{product} | owner/admin | Product detail with stock |
| PATCH | /api/v1/vendor/products/{product} | owner/admin | Update product |
| DELETE | /api/v1/vendor/products/{product} | owner/admin | Soft-delete product |
| PATCH | /api/v1/vendor/products/{product}/inventory | owner/admin | Adjust stock { delta, reason? } — transaction-safe |
| GET | /api/v1/vendor/orders | approved vendor | Orders containing own items only |
| GET | /api/v1/vendor/orders/{order} | vendor w/ items | Order scoped to own items |
| PATCH | /api/v1/vendor/orders/{order}/status | vendor w/ items | Update status { status, note? } via state machine |
Admin
| Method | Endpoint | Access | Description |
|---|
| GET | /api/v1/admin/dashboard | admin | Aggregate counts + revenue |
| GET | /api/v1/admin/vendors | admin | List vendors. Filters: status, search |
| PATCH | /api/v1/admin/vendors/{vendor}/approve | admin | Approve vendor. 30/min |
| PATCH | /api/v1/admin/vendors/{vendor}/suspend | admin | Suspend vendor { reason }. 30/min |
| GET | /api/v1/admin/orders | admin | Monitor orders. Filters: status, payment_status, search |
| GET | /api/v1/admin/orders/{order} | admin | Full order incl. audit history |
| GET | /api/v1/admin/payments | admin | Payment records. Filters: status, provider |
| GET | /api/v1/admin/payments/order/{order} | admin | Payments for an order |
| GET | /api/v1/admin/analytics | admin | Revenue trends + top vendors/products (5-min cache) |
Order state machine
pending → confirmed → processing → shipped → delivered
↓ ↓ ↓
cancelled cancelled cancelled
Stellarmart Backend — Laravel modular monolith · Supabase PostgreSQL · Sanctum auth
Order state machine
pending → confirmed → processing → shipped → delivered
↓ ↓ ↓
cancelled cancelled cancelled
Stellarmart Backend — Laravel modular monolith · Supabase PostgreSQL · Sanctum auth