Welcome to the official API documentation for the GOBE E-Commerce platform.
All API endpoints are relative to the following base URL:
Local: http://localhost:8000/api
Prod: https://goba-ecommerce.sunmedagency.com/api
Most routes are protected and require a bearer token for access. To authenticate, obtain a token by using the /auth/login or /auth/register endpoints. Include this token in the Authorization header for subsequent requests.
Authorization: Bearer <your-api-token>
To populate the database with dummy data, run the following command:
php artisan db:seed
This will seed products (with tags), categories, order requests, and more.
POST /auth/register — Register a new userPOST /auth/login — LoginPOST /auth/logout — LogoutPOST /auth/refresh — Refresh tokenGET /auth/user-profile — Get current user profileGET /products — List products
GET /products/{product} — Get product details
GET /products/search — Search products
GET /products/{product}/related — Related products
GET /products/{product}/reviews — List reviews for product
POST /products/{product}/reviews — Add review for product
GET /products/{product}/similar — Similar products
GET /top-selling-products — Top selling products
GET /featured-products — Featured products
GET /offers — Products on offer
GET /new-arrivals — New arrivals
GET /best-sellers — Best sellers
GET /products/tags — All product tags
GET /products/tags/stats — Tag stats
GET /products/tags/suggestions — Tag suggestions
GET /best-sellers
limit: sometimes | integer | min:1 | max:100period: sometimes | in:all,month,weekGET /categories — List categoriesGET /categories/{category} — Get category detailsGET /categories/{category}/products — Products in categoryPOST /orders — Create orderGET /orders/{order} — Get order detailsGET /wishlist — List wishlistPOST /wishlist/{product} — Add to wishlistDELETE /wishlist/{product} — Remove from wishlistGET /cart — Get cartPOST /cart/{product} — Add to cartPATCH /cart/{product} — Update cart itemDELETE /cart/{product} — Remove from cartGET /posts — List postsGET /posts/{post} — Get post detailsGET /active-popup — Get active popupPOST /contact — Send contact messageGET /sliders — List slidersGET /testimonials — List testimonialsGET /testimonials/random — Random testimonialGET /testimonials/by-rating — Testimonials by ratingGET /about — About infoPOST /order-requests — Request out-of-stock productGET /tags — List tagsGET /tags/{tag} — Get tag detailsPOST /tags — Create tagPUT /tags/{tag} — Update tagDELETE /tags/{tag} — Delete tagGET /tags/{tag}/products — Products by tagAll incoming API requests are validated according to predefined rules. If a request fails validation, the API will return a 422 Unprocessable Entity status code with a JSON response detailing the validation errors. The error response will typically look like this:
{
"message": "The given data was invalid.",
"errors": {
"field_name": [
"The field_name field is required.",
"The field_name must be at least 8 characters."
]
// ... other fields with their respective errors
}
}
/auth/register
name: required | string | between:2,100email: required | string | email | max:100 | unique:userspassword: required | string | confirmed | min:6/auth/login
email: required | emailpassword: required | string | min:6GET /products/search
q: required | string | min:3GET /products/tags/suggestions
query: required | string | min:2GET /best-sellers
limit: sometimes | integer | min:1 | max:100period: sometimes | in:all,month,week/orders
items: required | arrayitems.*.product_id: required | exists:products,iditems.*.product_size_id: nullable | exists:product_sizes,iditems.*.quantity: required | integer | min:1shipping_name: required | string | max:255shipping_address: required | string | max:255shipping_city: required | string | max:255shipping_state: required | string | max:255shipping_zip: required | string | max:255shipping_country: required | string | max:255shipping_email: required | emailcoupon_code: nullable | string | exists:coupons,code/orders/{order}
guest_token in the request.guest_token: sometimes | string | size:32 (Required for unauthenticated access)POST /contact
name: required | string | max:255email: required | email | max:255subject: required | string | max:255message: required | stringPOST /order-requests
product_id: required | exists:products,idfirst_name: required | stringlast_name: required | stringemail: required | emailphone: required | stringquantity: required | integer | min:1message: nullable | string/cart/{product}
product_size_id: nullable | exists:product_sizes,idquantity: required | integer | min:1/cart/{product}
product_size_id: nullable | exists:product_sizes,idquantity: required | integer/cart/{product}
product_size_id: nullable | exists:product_sizes,id/posts
title: required | string | max:255content: required | stringimage: nullable | string/posts/{post}
title: sometimes | required | string | max:255content: sometimes | required | stringimage: nullable | string/products/{product}/reviews
name: required | string | max:255email: required | email | max:255rating: required | integer | min:1 | max:5comment: required | string/wishlist/{product}
/wishlist/{product}
/users
name: required | string | max:255email: required | string | email | max:255 | unique:userspassword: required | string | min:8/users/{user}
name: sometimes | required | string | max:255email: sometimes | required | string | email | max:255 | unique:users,email,{user_id}password: sometimes | required | string | min:8/tags
name: required | arrayname.*: required | string | max:255description: nullable | arraydescription.*: nullable | string/tags/{tag}
name: required | arrayname.*: required | string | max:255description: nullable | arraydescription.*: nullable | string/tags
name: required | arrayname.*: required | string | max:255description: nullable | arraydescription.*: nullable | string/tags/{tag}
name: required | arrayname.*: required | string | max:255description: nullable | arraydescription.*: nullable | stringAll endpoints require admin authentication. Base path: /api/admin
GET /dashboard — Admin dashboard stats/products
tag: nullable | string (to filter by tag)per_page: nullable | integer (number of items per page, default: 10)/products
name: required | string | max:255description: required | stringnote: nullable | stringprice: required | numeric | min:0stock: required | integer | min:0category_id: required | exists:categories,idproduct_type_id: nullable | exists:product_types,idis_featured: booleanstatus: in:pending,approved,rejectedattachment: nullable | file | mimes:pdf,doc,docx | max:10240images: required | arrayimages.*: image | mimes:jpeg,png,jpg,gif | max:2048sizes: nullable | arraysizes.*.name: required | stringsizes.*.price: required | numericsizes.*.stock: required | integer | min:0tags: nullable | arraytags.*: string | max:50/products/{product}
name: sometimes | required | string | max:255description: sometimes | required | stringnote: nullable | stringprice: sometimes | required | numeric | min:0stock: sometimes | required | integer | min:0category_id: sometimes | required | exists:categories,idproduct_type_id: nullable | exists:product_types,idis_featured: sometimes | booleanstatus: sometimes | in:pending,approved,rejectedimages: nullable | arrayimages.*: image | mimes:jpeg,png,jpg,gif | max:2048tags: nullable | arraytags.*: string | max:50/products/tags/bulk-update
product_ids: required | arrayproduct_ids.*: exists:products,idtags: required | arraytags.*: string | max:50action: required | in:add,remove,replace/categories
name: required | string | max:255 | unique:categoriesslug: required | string | max:255 | unique:categoriesimage: required | image | mimes:jpeg,png,jpg,gif,svg | max:2048parent_id: nullable | exists:categories,id/categories/{category}
name: filled | string | max:255 | unique:categories,name,{category_id}slug: filled | string | max:255 | unique:categories,slug,{category_id}image: filled | image | mimes:jpeg,png,jpg,gif,svg | max:2048parent_id: nullable | exists:categories,id/product-types
name: required | string | max:255category_id: required | exists:categories,id/product-types/{productType}
name: sometimes | required | string | max:255category_id: sometimes | required | exists:categories,id/orders/{order}
status: required | string | in:pending,processing,shipped,delivered,cancelled/orders/bulk-delete
ids: required | arrayids.*: exists:orders,idGET /invoices — List invoicesGET /customers — List customersPOST /customers — Create customerGET /customers/{customer} — Get customer detailsPATCH /customers/{customer} — Update customerDELETE /customers/{customer} — Delete customerDELETE /customers/bulk-delete — Bulk delete customersGET /coupons — List couponsPOST /coupons — Create couponGET /coupons/{coupon} — Get coupon detailsPATCH /coupons/{coupon} — Update couponDELETE /coupons/{coupon} — Delete couponDELETE /coupons/bulk-delete — Bulk delete coupons/popups
name: required | string | max:255title: required | string | max:255content: required | stringdisplay_type: nullable | string | max:50css_class: nullable | string | max:50size: nullable | string | max:50animation: nullable | string | max:50position: nullable | string | max:50is_active: boolean/popups/{popup}
name: sometimes | required | string | max:255title: sometimes | required | string | max:255content: sometimes | required | stringdisplay_type: nullable | string | max:50css_class: nullable | string | max:50size: nullable | string | max:50animation: nullable | string | max:50position: nullable | string | max:50is_active: sometimes | boolean/sliders
title: required | string | max:255description: nullable | stringimage: required | stringlink: nullable | stringis_active: boolean/sliders/{slider}
title: sometimes | required | string | max:255description: nullable | stringimage: sometimes | required | stringlink: nullable | stringis_active: sometimes | booleanGET /reviews — List reviews (filter/search/paginate)GET /reviews/{review} — Get review details/reviews/{review}
status: sometimes | required | in:pending,approved,rejectedcomment: sometimes | required | stringrating: sometimes | required | integer | min:1 | max:5DELETE /reviews/{review} — Delete reviewGET /tags — List tags with statsGET /tags/statistics — Tag usage statisticsGET /tags/analytics — Tag analyticsGET /tags/suggestions — Tag suggestionsGET /tags/cleanup — Unused tagsGET /tags/{tag}/products — Products by tagPOST /tags/bulk-update — Bulk update tagsPOST /tags/merge — Merge tagsGET /tags/export — Export tags to CSVGET /tags/recommendations — Tag recommendations for product/settings
settings: required | array/profile
name: sometimes | required | string | max:255email: sometimes | required | email | max:255 | unique:users,email,{user_id}phone: sometimes | nullable | string | max:32location: sometimes | nullable | string | max:255bio: sometimes | nullable | string | max:1000avatar: sometimes | nullable | image | max:2048/profile/password
current_password: required | stringpassword: required | string | min:8 | confirmedNote: All endpoints require authentication unless otherwise specified. For file uploads (e.g., avatar), use multipart/form-data.
For more details on request/response formats, see the controller code or ask for specific examples.