API v1 Laravel Sanctum Dashboard

One API to run your store from the first product to the final order

This API powers a full e-commerce workflow, covering authentication, users, products, categories, brands, cart, addresses, coupons, and orders, with clear access levels for admins and sellers.

Base: /api/v1 Role-based access Mobile-first

Multilingual catalog

Products, categories, and brands support Arabic and English with active, featured, discount, and rating summary states.

Checkout-ready flow

The checkout flow now includes cart, addresses, governorates, coupons, and richer order details.

Clearer permissions

The current structure clearly separates user, seller, and super admin access with banning protection.

Analytics and management

The admin dashboard and analytics endpoints now represent the latest management flow in the project.

Latest Shape

What has been reflected in the page

Instead of the older limited documentation page, the current content now follows the real project structure and the latest UI additions.

Full brands support

The catalog now includes full brand management across both the API and dashboard.

Governorates and addresses

Orders now support governorates and addresses, making the checkout flow closer to production behavior.

Coupon workflow

Coupon validation and management endpoints are now part of the flow shown on the page.

Seller interfaces

Dedicated seller routes are now represented without mixing them with super admin actions.

Reviews and moderation

Verified-purchase reviews, approval workflow, and public review visibility are now part of the documented flow.

Discount-aware pricing

Product responses now expose price, discount amount, final price, and active discount timing logic.

Stronger user protection

The page now reflects not_banned protection and role-based middleware more accurately.

Admin analytics

Summary and analytics endpoints for users, products, orders, and categories are now included.

Release Spotlight

Reviews and discounts now shape the catalog response

The latest backend additions let customers submit verified reviews and let products expose live discount pricing without changing the existing product endpoints.

Verified reviews

Customers can create one review per product after a completed purchase, optionally attach a variant, and wait for admin moderation before it becomes public.

POST /api/v1/products/{id}/reviews
PUT /api/v1/products/{id}/reviews
DELETE /api/v1/products/{id}/reviews
GET /api/v1/products/{id}/reviews

Discount-safe pricing

Products now calculate has_discount, discount_amount, and final_price inside the valid date range while preventing negative prices.

discount_type: percentage | fixed
discount_value: number
discount_start_at: nullable datetime
discount_end_at: nullable datetime

Product response snapshot

{
  "price": 500,
  "final_price": 450,
  "has_discount": true,
  "average_rating": 4.5,
  "reviews_count": 12
}
Dashboard Flow

Current dashboard flow

The landing page now mirrors the spirit of the dashboard that exists in the project, so the public entry screen no longer feels disconnected.

Owner dashboard

Quick stats, recent orders, users, products, and categories appear in one central owner view.

Products management

Products now include brand, primary image, featured state, and active state management.

Categories management

Arabic and English category fields are now reflected with cleaner publishing and description states.

Orders management

The current dashboard allows easier tracking, status updates, and richer order detail views.

API Groups

Current API groups

These cards are based on the real routes in routes/api.php, not the old static documentation, so they match the latest project structure.

Updated routes Sanctum + Middleware Cards optimized for mobile

Authentication and user

Register, login, update profile, logout, and account deletion endpoints.

Public Sanctum not_banned
  • POST
    /api/v1/register

    Create a new account

  • POST
    /api/v1/login

    Login with rate limiting applied

  • POST
    /api/v1/logout

    End the active session

  • POST
    /api/v1/update

    Update the current user profile

  • DELETE
    /api/v1/deleteUser

    Delete the current account

  • GET
    /api/v1/users

    List users for super admin only

Public catalog

Browse products, categories, brands, and governorates through the current public catalog layer.

Authenticated user Super Admin for write actions
  • GET
    /api/v1/products

    List public products

  • GET
    /api/v1/products/{id}/reviews

    List public approved reviews for a product

  • POST
    /api/v1/products/{id}/reviews

    Create a verified-purchase review

  • GET
    /api/v1/categories

    List current categories

  • GET
    /api/v1/brands

    List available brands

  • GET
    /api/v1/governorates

    List governorates and shipping areas

  • POST
    /api/v1/products

    Create a main product as super admin with optional discount fields

  • PUT
    /api/v1/products/{id}

    Update a main catalog product and pricing rules

Cart and checkout

Cart, addresses, coupons, and orders are now represented as one clearer checkout flow.

Sanctum not_banned
  • GET
    /api/v1/cart

    Load the current cart items

  • POST
    /api/v1/cart

    Add a product or variant to cart

  • PUT
    /api/v1/cart/{id}

    Update quantity or item state

  • GET
    /api/v1/addresses

    Manage shipping addresses

  • POST
    /api/v1/coupons/validate

    Validate a coupon code

  • POST
    /api/v1/orders

    Create a new order

Seller area

Dedicated seller endpoints for products and orders without colliding with admin actions.

seller middleware
  • GET
    /api/v1/seller/products

    List seller products

  • POST
    /api/v1/seller/products

    Create a seller product

  • PUT
    /api/v1/seller/products/{id}

    Update a seller product

  • DELETE
    /api/v1/seller/products/{id}

    Delete a seller product

  • GET
    /api/v1/seller/orders

    Follow seller orders

Admin and analytics

Super admin actions now include analytics, role assignment, pending products, and advanced order control.

super_admin
  • GET
    /api/v1/admin/analytics/summary

    Load a system summary

  • GET
    /api/v1/admin/products/pending

    List pending products

  • PUT
    /api/v1/admin/products/{id}/activate

    Activate a pending product

  • PATCH
    /api/v1/admin/products/{productId}/reviews/{reviewId}/status

    Approve or reject a product review

  • POST
    /api/v1/roles/assign

    Assign a role to a user

  • GET
    /api/v1/orders/Admin/GetAll

    Load all orders for admin review

  • POST
    /api/v1/users/{id}/ban

    Ban a user from protected routes

No matching results were found for the current search.
Quick Start

Quick start

Short snippets to start testing the API quickly while keeping the page clean and readable.

1. Set the base URL

BASE_URL=http://127.0.0.1:8000
API_PREFIX=/api/v1

2. Login and get the token

POST /api/v1/login
{
  "email": "owner@example.com",
  "password": "secret"
}

3. Use the token in protected requests

Authorization: Bearer {token}
Accept: application/json
Resources

Quick links and assets

Direct links to the currently available project files and the dashboard entry point.