- How do I install bagisto/bagisto-api in a Laravel Bagisto app?
- Run composer require bagisto/bagisto-api, then php artisan bagisto-api-platform:install. This sets up the API layer and gives you the /api landing page, REST documentation, and GraphQL Playground endpoints. Use the manual installation path only if you need custom API Platform configuration.
- What PHP, Bagisto, and Laravel versions are required for bagisto/bagisto-api?
- The README lists PHP 8.3+, Composer 2, MySQL 8.0+ or PostgreSQL 14+, and Bagisto v2.4.7 as the CI-tested version; the technical evaluation describes design support for Bagisto v2.3.8+. It depends on api-platform/laravel and api-platform/graphql at ~4.3.8. The evaluation notes Laravel 10+ compatibility, but confirm the exact Laravel version against your Bagisto core before upgrading.
- Does bagisto/bagisto-api provide both REST and GraphQL APIs?
- Yes. It is an API Platform-based layer for Bagisto with separate shop and admin REST and GraphQL endpoints. REST endpoints are Swagger/OpenAPI documented, while GraphQL is schema-first and Playground-ready.
- Where can I find the REST API docs and GraphQL Playground after installation?
- REST documentation is available at /api/shop/docs and /api/admin/docs. GraphQL Playground is available at /api/graphiql for shop and /api/admin/graphiql for admin. The API landing page is at /api.
- How does authentication differ between shop and admin APIs in bagisto-api?
- Shop APIs use key-based storefront authentication with rate limiting and cache optimization. Admin APIs use token-based authentication with RBAC, IP whitelisting, and audit trails. Admin token generation and revocation may be manual in the UI, but the evaluation suggests automating it through an API such as POST /api/admin/integrations.
- Can bagisto/bagisto-api be used for headless or composable commerce?
- Yes. The package exposes shop and admin REST plus GraphQL endpoints for Bagisto, making it suitable for headless, omnichannel, and composable commerce frontends. Use REST for simpler CRUD flows and GraphQL for complex catalog or order queries, while accounting for frontend caching of nested GraphQL responses.
- How do I configure rate limits and caching for storefront APIs?
- Set environment values such as STOREFRONT_DEFAULT_RATE_LIMIT, STOREFRONT_CACHE_TTL, STOREFRONT_KEY_PREFIX, and the playground key settings in your .env file. The evaluation references a default storefront rate limit of 100 and a cache TTL of 60 seconds. Use Redis or Memcached for caching and tune limits for high-throughput integrations.
- Does bagisto-api support Bagisto features like product variants, bundles, bookings, and multi-channel?
- The evaluation states that Bagisto-specific features such as product variants, bundles, bookings, and multi-channel support are natively exposed. Admin CSV exports for datagrids also enable bulk operations without UI dependency. Verify the exact endpoints and schema for your Bagisto version in the shop and admin documentation.
- Is bagisto/bagisto-api production-ready and what performance risks should I test?
- It can be production-ready for Bagisto API workloads, but benchmark deeply nested GraphQL queries and admin audit log volume before rollout. Storefront rate limits and caching are configurable through STOREFRONT_DEFAULT_RATE_LIMIT and STOREFRONT_CACHE_TTL, while admin APIs lack built-in caching headers. Use Redis or Memcached, prune audits with bagisto-api:prune-audits, and test on a staging clone with a realistic dataset.
- What alternatives should I consider to bagisto/bagisto-api?
- If you need Bagisto-specific commerce features, bagisto/bagisto-api is the direct fit. If you are not tied to Bagisto, consider spatie/laravel-api-resources or building directly on API Platform for Laravel. Evaluate REST versus GraphQL needs and admin compliance requirements before choosing.