canonical: https://jentic.com/apis/bagisto.com/bagisto

# Bagisto Shop REST API

Bagisto is an open-source Laravel-based e-commerce platform. The Shop REST API exposes 38 endpoints for the customer-facing storefront: product and category browsing, search, customer authentication, cart and checkout flows, address management, customer orders, and product reviews. JWT bearer tokens issued from `/customers/login` authenticate customer-scoped routes, while catalog and locale routes are publicly readable. The API targets a self-hosted Bagisto instance, so the base URL includes a configurable host.

## For AI agents

Browse products and categories, manage carts and customer accounts, place orders, and submit reviews on a Bagisto storefront via 38 REST endpoints.

## Scope

Does not handle vendor admin tasks, payment gateway integration, or custom storefront theming - use for storefront catalog browsing, cart, customer accounts, and checkout only.

## Capabilities

- Search products and browse categories on a Bagisto storefront
- Authenticate customers with JWT and surface their saved addresses and order history
- Build, mutate, and coupon a cart through dedicated /cart and `/cart/items` endpoints
- Retrieve available shipping and payment methods and place an order via `/checkout/place-order`
- Submit, update, and moderate product reviews with full CRUD on /product-reviews
- Localise responses across channels and locales using the /channels and /locales endpoints

## Use cases

### Headless Storefront

Front-end teams build a Next.js or Vue storefront against a Bagisto backend by consuming the REST API directly. Catalog browsing uses /products, /categories, and `/products/search`; cart and checkout use /cart and `/checkout/place-order.` Bagisto handles inventory, pricing, and order persistence server-side, so the frontend stays a thin presentation layer that ships independently.

Example prompt: Search products with GET `/products/search`?query=hoodie, add the top result to the cart via POST `/cart/items`, then place the order with POST `/checkout/place-order.`

### Customer Self-Service Portal

Build a customer account portal where shoppers update profile details, manage saved addresses, and review past orders without going through the default Bagisto theme. Endpoints under /customers/* cover registration, login, profile, addresses, and order history. JWT tokens scope every call to the authenticated customer.

Example prompt: Authenticate via POST `/customers/login`, then GET `/customers/orders` and surface the five most recent orders in a profile dashboard.

### Reviews and Catalog Sync

Pipe product catalog and review data out of Bagisto into search, recommendation, or review-aggregation systems. /products and /product-reviews provide read-only feeds; the review endpoints also support create, update, and delete for moderation workflows. Use /channels and /locales to handle multi-channel, multi-language stores correctly.

Example prompt: Page through GET /products to export the catalog, then GET /product-reviews to attach review counts and average ratings per product.

### AI Agent Integration via Jentic

An agent built on Jentic can act as a shopping assistant: search Bagisto for items matching a user's request, add the chosen item to a cart, apply a coupon, and complete checkout. Jentic stores the customer JWT in your Jentic One instance, so the agent never holds the raw token.

Example prompt: Search Jentic for 'add an item to a bagisto cart', load the schema for POST `/cart/items`, then execute it with the chosen product ID and quantity.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| GET | `/products` | Get products list |
| GET | `/products/search` | Search products |
| POST | `/cart/items` | Add item to cart |
| POST | `/cart/coupon` | Apply coupon to cart |
| POST | `/checkout/place-order` | Place order at checkout |
| POST | `/customers/login` | Customer login |
| GET | `/customers/orders` | Get customer orders |
| POST | `/product-reviews` | Create a product review |

## Key resources

- **Products** — List, retrieve, and search products
- **Categories** — Browse product categories
- **Customers** — Register, login, profile and address management, plus customer order history
- **Cart** — Create cart, add and update items, apply and remove coupons
- **Checkout** — Available shipping and payment methods, and place-order endpoint
- **Product Reviews** — Read, create, update, and delete product reviews
- **Locales and Channels** — Multi-locale and multi-channel metadata for storefront localisation

## Why Jentic

- **Setup:** Wiring Bagisto by hand means pointing at your self-hosted instance's configurable host, running the `/customers/login` call, and refreshing the returned JWT bearer token across the cart, checkout, and order endpoints. Through Jentic you install once, import the Bagisto Shop REST API from the API Directory, store the host and customer token once, and your agent calls it.
- **Permission scoping:** Bagisto carries the product, cart-item, and coupon details in the request body or query rather than the URL path, and the JWT already scopes calls to the authenticated customer, so scoping is by operation: limit the agent to the operations it needs, such as GET `/products/search` and POST `/cart/items.` You choose those operations, so destructive ones like DELETE on /product-reviews are not included unless you add them.
- **Credential handling:** Your Bagisto customer JWT and host configuration are stored once, encrypted, by your own Jentic One instance and injected at execution time. They never enter the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'search a storefront for products' or 'add an item to the cart', and Jentic returns the matching Bagisto operation with its input schema so the agent picks the right endpoint without reading the OpenAPI spec.

## Related APIs

- **Backendless API** — Backend-as-a-Service platform that can power a companion mobile app for a Bagisto store
- **Bambora Payments** — Payment gateway used during Bagisto checkout for card processing
- **Bacon Ipsum** — Placeholder text generator for seeding Bagisto product descriptions during demos

## FAQ

### What authentication does the Bagisto Shop REST API use?

Customer-scoped routes use HTTP Bearer auth with a JWT obtained from POST `/customers/login` (the bearerAuth scheme). Catalog and locale endpoints are public. Through Jentic, the JWT is held in the encrypted vault and is injected at execution time so the agent never sees it.

### Can I place an order through the Bagisto API?

Yes. Build the cart with POST /cart and POST `/cart/items`, optionally apply a coupon via POST `/cart/coupon`, fetch eligible methods from GET `/checkout/shipping-methods` and GET `/checkout/payment-methods`, then call POST `/checkout/place-order` with the chosen methods to create the order.

### What are the rate limits for the Bagisto Shop REST API?

Bagisto is self-hosted, so rate limits depend on the operator's deployment (Laravel throttling middleware). The OpenAPI spec does not declare global limits. Check https://api-docs.bagisto.com/ and your deployment's nginx or Laravel rate-limit configuration.

### How do I search for a product through Jentic?

Search Jentic for 'search bagisto products', load the schema for GET `/products/search`, then execute it with the query string. Jentic injects the host configuration and any required auth headers, so the agent can run the call without bookkeeping.

### Can customers manage their own addresses through this API?

Yes. GET `/customers/addresses` lists the customer's saved addresses, POST creates a new one, PUT `/customers/addresses/{id}` updates an existing entry, and DELETE removes it. All four require an authenticated JWT.

### Does Bagisto support multiple languages and stores in this API?

Yes. GET /locales returns supported locales and GET /channels returns the configured sales channels for the Bagisto instance. Use these to localise product titles and to scope catalog browsing per channel.

### Can I limit what my agent is allowed to do with the Bagisto Shop REST API?

Yes. Because you run your own self-hosted Jentic One instance, your own rules decide which Bagisto operations and credentials the agent can use. Since the customer JWT already scopes calls to the authenticated shopper and Bagisto carries product, cart, and coupon details in the request body rather than the URL, you scope by operation: grant only what the agent needs, such as GET `/products/search` and POST `/cart/items.` Destructive operations like DELETE on /product-reviews are excluded unless you explicitly add them.
