API Ecommerce uses Laravel’s built-inDocumentation 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.
ThrottleRequests middleware (aliased as throttle) to protect sensitive endpoints from abuse. The middleware tracks request counts in a sliding 1-minute window keyed by the caller’s IP address. Once the configured limit is reached all subsequent requests within that window are rejected with an HTTP 429 Too Many Requests response, and the caller must wait until the window resets before trying again.
Limits by group
| Endpoint group | Affected routes | Limit |
|---|---|---|
Auth group (/api/auth/*) | All auth routes: register, login, login_ecommerce, logout, logout_device, refresh, me, verified_auth, verified_email, verified_code, new_password | 10 req / min |
Admin mutating operations (/api/admin/*) | store, update, destroy (and delete_imagen where applicable) on ProductController, SliderController, and CuponeController | 10 req / min |
Cart mutating operations (/api/ecommerce/cart) | store, update, destroy on CartController | 20 req / min |
Public storefront GET endpoints (/api/ecommerce/*) | home, menu, product/, config-filter-advance, filter-advance-product | No throttle |
DiscountController does not declare a constructor-level throttle. Its write routes (store, update, destroy) are protected by auth:api only. If you need throttling on discount writes, add the middleware in DiscountController::__construct().- Route group level — the auth prefix group sets
'middleware' => 'throttle:10,1'inroutes/api.php. - Controller constructor level — selected admin and cart controllers call
$this->middleware('throttle:N,1')->only([...])so the limit applies only to write methods:
throttle:N,1 signature means N requests per 1 minute. Laravel stores the counter in whichever cache driver is configured (file by default; Redis recommended — see Caching).
429 response
When a client exceeds its rate limit, Laravel returns the following response:Retry-After header contains the number of seconds remaining until the rate-limit window resets. Clients must respect this value and back off before retrying.
Best practices
- Cache responses client-side. Public storefront endpoints (
/api/ecommerce/home,/api/ecommerce/menu,/api/ecommerce/product/{slug}) are already cached server-side for 30 days (2592000 seconds). Store the response in your client application and re-fetch only when the cached copy is stale. - Avoid polling. Do not repeatedly call authenticated endpoints (cart index, order status) on a timer. Trigger refetches on user actions instead.
- Use bulk operations. The cart
delete_allendpoint (DELETE /api/ecommerce/cart/delete_all) removes the entire cart in a single request, rather than issuing individualdestroycalls for each item — keeping you well within the 20 req/min cart limit. - Handle 429 gracefully. Read the
Retry-Afterheader value and schedule the retry after the indicated number of seconds. Display a user-friendly message in the UI rather than silently retrying in a tight loop.