bagisto/rest-api
REST API for Bagisto e-commerce: exposes storefront and admin data—products, categories, carts, customers, orders, and more—via token-authenticated JSON endpoints, so Laravel developers can build headless storefronts, mobile apps, and integrations on top of Bagisto's backend.
bagisto/rest-api is the dependency that decides whether Bagisto can back non-Bagisto surfaces — native apps, SPAs, PWAs, kiosks, partner portals, marketplace connectors. If "launch a mobile app" or "decouple the storefront" is on the roadmap, this package reframes the question from platform rebuild to sequencing: what ships first, on which channel, against which endpoints.304 Not Modified. Frame it as a lever on CDN egress, origin load, and mobile latency on read-heavy catalog traffic — speed you buy without a client migration. Deliberately scope it to catalog/category/product detail, not cart, checkout, customer, or orders, where personalized responses make the correctness risk outweigh the bandwidth win.Adopt when:
patches or a fork) ready.Look elsewhere when:
For executives: This is the cheapest credible path to selling through channels other than the website. Without it, "expose our store to external clients" is a multi-quarter internal program — resource design, authentication, checkout serialization, versioning, docs, and ongoing support. With it, that scope collapses into configuration plus integration work. That is not a vendor-lock claim; it is a build-vs-buy call where the buy side is dramatically smaller, and we should record the decision and the counterfactual cost explicitly.
For engineering: It is a REST layer over the existing Bagisto domain, released roughly in lockstep with core — so the real risk is version skew, not integration complexity. Plan for a tight Composer constraint, a Bagisto-upgrade checklist that includes re-running API smoke tests, and a local patch workflow. Extend the package's controllers and JsonResource classes rather than writing parallel ones, so response envelopes, pagination shape, and ETag middleware behavior stay consistent across built-in and custom routes. Wrap the API in a single client service with shared base URL, token handling, and ETag caching — do not scatter Http:: calls across consumers. Feature-test against a seeded store plus a small contract suite; fakes will not catch eager-loading serialization bugs.
For security and compliance: Route-level access control in this package is configuration, and the default exposure is a decision we inherit unless we change it. Before any partner key is issued, we review which capabilities are exposed — read-only catalog versus cart mutation versus customer data — and we make different partner tiers different configurations, not different code branches. On the ETag work in v2.3.1: authenticated responses must carry Cache-Control: private and a Vary including Authorization. We verify with two different tokens on a cart endpoint that tags differ; if they do not, we disable ETag on personalized routes rather than reason about it. ETags are never emitted on 4xx/5xx.
For support and customer-facing teams: One paragraph in integrator onboarding removes a recurring ticket class — cache the body, send If-None-Match, reuse the body on 304. 304 is a success, not an error. Give on-call a documented lever to disable the ETag middleware mid-incident; not having that lever converts a cache bug into an outage. Triage stale-data reports in order: client cache, proxy cache, origin.
The honest caveat to state up front: 28 stars and zero known dependents means we are the support tier. That is acceptable for first-party infrastructure we would otherwise build — but we plan for it deliberately rather than discover it mid-incident.
How can I help you explore Laravel packages today?