Every response from API Ecommerce isDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/JuanSCaicedo/Api-Ecommerce/llms.txt
Use this file to discover all available pages before exploring further.
application/json. The API uses two broad response patterns found throughout the codebase: envelope responses that wrap the payload in named keys (e.g. "product", "carts", "sales"), and status-message responses that return a message key with an integer application-level code. Understanding both patterns is essential for correct client-side error handling.
Success responses
Resource created
Returned by write operations that create a new record. The HTTP status is200 (except for user registration, which returns 201). The response includes the integer application code 200 in the message field and, where relevant, the new record’s database id.
Source: Admin\Product\ProductController::store
Application-level status code.
200 indicates success.The auto-incremented primary key of the newly created record. Present on product creation; omitted on other resource types.
Paginated resource list
Returned by admin index endpoints. The HTTP status is200.
Source: Admin\Product\ProductController::index
Total number of records across all pages, as returned by Laravel’s paginator.
Array of product resource objects for the current page (10 items per page).
Single object returned
Returned by show/detail endpoints. The HTTP status is200.
Source: Admin\Product\ProductController::show
Full product resource object serialised by
ProductResource.Simple acknowledgement
Returned by write operations that do not need to return a payload — for example, completing checkout, deleting a cart item, or updating a profile. Source:Ecommerce\SaleController::store, Ecommerce\CartController::destroy
Application-level status code.
200 indicates the operation completed successfully.Error responses
Business logic error
When the API rejects an operation for a domain reason (e.g. duplicate product, item already in cart, stock exceeded, invalid coupon), it returns a JSON body with an integermessage code and a human-readable message_text. The HTTP status code is 200 — the error is signalled at the application level, not the transport level.
The
"message": 403 pattern is an application-level code embedded in a standard 200 OK HTTP response. It is not an HTTP 403 Forbidden. Your client must check the message field value, not only the HTTP status, to detect these business logic errors. This convention is consistent across all controllers in the codebase.Ecommerce\CartController::store (product already in cart)
Admin\Product\ProductController::store (duplicate title)
Application-level error code.
403 is used for business logic rejections across all controllers.Human-readable description of the error. Admin controller messages are in English (e.g.
"The product already exists"); storefront controller messages are in Spanish (e.g. "El producto ya se encuentra en el carrito...").AuthController::update is the one exception: when the current password supplied is incorrect it returns a genuine HTTP 403 status (not a 200 with message: 403), along with the message/message_text body. All other message: 403 patterns in the codebase use HTTP 200.Validation error
When request input fails Laravel’sValidator rules, the response has HTTP status 400 and a JSON body containing field-level error messages.
Source: AuthController::register
Unauthorized
Returned when the JWT is missing, expired, or was issued for a different user type (e.g. a storefront token on an admin endpoint), or when a customer’s email has not been verified.Maintenance mode
Returned when thevista_mantenimiento home view has state = 1. All endpoints that check maintenance status return this response.
HTTP status codes used
| HTTP Status | Meaning | When returned |
|---|---|---|
200 OK | Success | All successful responses, including business-logic errors that use "message": 403 inside a 200 body |
201 Created | Resource created | POST /api/auth/register (user registration only) |
400 Bad Request | Validation failure | Request input fails Laravel Validator rules |
401 Unauthorized | Authentication failure | Missing, expired, or invalid JWT; unverified email on storefront login |
403 Forbidden | Password mismatch | POST /api/ecommerce/profile_client when current_password is wrong (AuthController::update). The 403 code also appears inside JSON bodies as an application-level signal on HTTP 200 responses everywhere else. |
429 Too Many Requests | Rate limit exceeded | Caller has exceeded the throttle middleware limit for the current 1-minute window |
503 Service Unavailable | Maintenance mode | vista_mantenimiento home view is active |