Skip to content

Introduction

Bagisto's REST and GraphQL APIs come from one Composer package, bagisto/bagisto-api, built on API Platform for Laravel and kept outside the core repository. Each resource is declared once and served over both transports by the same providers and processors, so the data and the business rules match. This page helps you choose a surface (Shop or Admin) and a transport (REST or GraphQL).

Choosing the Shop or Admin API

Shop APIAdmin API
Built forStorefronts, mobile shopping apps, headless front endsBack-office apps and server-to-server integrations
REST/api/shop/*/api/admin/*
GraphQLPOST /api/graphqlPOST /api/admin/graphql
CredentialA storefront key, plus a customer or guest-cart token for account, cart and checkout callsAn Integration token issued for one admin user
Where it runsAnywhere: the storefront key is public by design, and a customer's token scopes account calls to that customerOn a server only: the token carries its admin's permissions
PlaygroundsSwagger UI at /api/shop, GraphiQL at /api/graphiqlSwagger UI at /api/admin, GraphiQL at /api/admin/graphiql

The surfaces share neither credentials nor schemas: a Shop operation isn't reachable on the Admin GraphQL endpoint, and the other way round. The Admin API mirrors what the admin can do, and a token never does more than its admin's role allows. An AI agent that acts inside the shopper's browser needs neither surface: the storefront declares its actions as WebMCP tools, with no package and no token.

Choosing REST or GraphQL

Both transports reach the same resources, so choose by how your client works:

PickWhen
RESTEach screen reads or changes one resource at a time; you want HTTP status codes, paging headers and GET requests a cache can store; you upload files such as product images or import files, which only REST accepts
GraphQLA screen needs many related fields in one round trip; you want to select only the fields you render; your front end already uses a GraphQL client

One client can use both with the same key and tokens, for example GraphQL for catalog pages and REST for an upload.

Packages for Older Releases

Before bagisto/bagisto-api, Bagisto's APIs were two separate packages. Their last releases are for Bagisto 2.3:

PackageLatest releaseBuilt onRequirement in its README
bagisto/rest-apiv2.3.1L5-Swagger and Laravel SanctumBagisto 2.3.x
bagisto/graphql-apiv2.3.2Lighthouse and JWT authenticationBagisto 2.3.0

Their endpoints, install commands and authentication differ from bagisto/bagisto-api, so instructions written for them don't apply to it.

Next Step

Installation installs the package and issues the credentials each surface needs.

Released under the MIT License.