# Openfront E-commerce

> Everything in Openfront E-commerce, the open-source commerce platform you own.

Everything you run, in source you own.

## At a glance

- 85 data models in one Keystone schema, from carts to claims
- 29 MCP tools so any agent can browse, build a cart and check out
- 6 payment operations per provider, each a module or your own HTTP adapter

## Links

- [Product overview](https://spec.openship.org/ecommerce): every area and feature on one page
- [Live demo](https://e-commerce.openship.org)
- [Documentation](https://docs.openship.org/docs/openfront/ecommerce)
- [Source code](https://github.com/openshiporg/openfront)
- [Feature film](https://spec.openship.org/ecommerce/video): a 27-second walk through every area

## Areas

### Agentic

- **An assistant in every dashboard page**: Ask the chat in the right sidebar to find an order, update a product or explain a refund. It calls the store's own MCP endpoint (https://docs.openship.org/docs/openfront/ecommerce/ai-assistant) and acts with exactly your permissions. (https://docs.openship.org/docs/openfront/ecommerce/ai-assistant)
- Agents can search products, read a product, create a cart, add items and apply a discount code (https://docs.openship.org/docs/openfront/ecommerce/api-reference).
- Set shipping and billing addresses, list shipping options, pick a method and start payment sessions from any MCP client.
- Schema tools let an agent list models (https://docs.openship.org/docs/openfront/ecommerce/ai-assistant), look up fields and input types, then query or write data.
- The last 20 messages go to the model, so long threads stay fast and focused.
- **MCP over OAuth for outside agents**: Claude, ChatGPT or your own client connect to the same endpoint through OAuth discovery (https://docs.openship.org/docs/openfront/ecommerce/ai-assistant). An MCP token acts as the operator who approved it, and writes need the mcp:write scope. (https://docs.openship.org/docs/openfront/ecommerce/ai-assistant)
- Connected apps can never sign in, change passwords, emails, tokens, API keys or OAuth records.
- Bring any model on OpenRouter (https://openrouter.ai) and cap tokens per reply with one variable.
- Tool results stream back into the sidebar, so you see what the assistant read and changed.
- Without mcp:write, every mutation is refused, which makes read-only agents a one-scope decision.

### Storefront

- **A storefront for every country**: Country-code routes serve home, store, product, category, collection, cart, checkout, confirmation and account pages. The storefront (https://docs.openship.org/docs/openfront/ecommerce/storefront) picks the region, currency and prices from the path. (https://e-commerce.openship.org/us/store)
- **Regions, currencies and taxes**: Regions group countries with a currency, tax rate, payment providers and shipping options. Onboarding sets up North America, Europe and the United Kingdom in one step. (https://docs.openship.org/docs/openfront/ecommerce/stores)
- **Carts that prove who owns them**: Guest carts carry a signed proof header, and signed-in carts belong to their owner, so nobody can read or change someone else's cart by ID. (https://docs.openship.org/docs/openfront/ecommerce/storefront)
- Set the store name, logo SVG (https://docs.openship.org/docs/openfront/ecommerce/stores) and colour from the dashboard. Uploaded SVGs are sanitized against an allowlist.
- Homepage title and description are store settings, not code changes.
- Build your own front end on the same cart and checkout operations (https://docs.openship.org/docs/openfront/ecommerce/storefront/custom) and keep the dashboard.
- Business customers apply for credit from the account invoicing page.

### Catalog

- **Products, variants and options**: A product carries a handle, subtitle, rich description, images and status. Options like size and colour generate variants, each with its own SKU, prices per region and stock count (https://docs.openship.org/docs/openfront/ecommerce/products). (https://docs.openship.org/docs/openfront/ecommerce/products)
- **Collections and categories**: Group products into collections for merchandising and nest categories as a tree. Shoppers only see active categories and published products. (https://docs.openship.org/docs/openfront/ecommerce/products)
- **Price lists for sales**: A price list (https://docs.openship.org/docs/openfront/ecommerce/price-lists) groups alternate prices with a start and end date. The storefront reads the calculated and original amount, so strike-through prices just work. (https://docs.openship.org/docs/openfront/ecommerce/price-lists)
- Order lines store the accepted price, so later catalog edits never rewrite an order.
- Images live in S3-compatible storage or at any external URL, with alt text and order.
- When inventory is managed, checkout only takes stock that exists and writes a stock movement.
- Tags and product types add classification without new code.

### Orders

- **Every order on one page**: The order page shows items, payments, fulfillments, returns, claims and a full event timeline. Status filters split pending, completed, canceled and orders that need action. (https://docs.openship.org/docs/openfront/ecommerce/dashboard)
- **A timeline you can audit**: Order events record who did what and when, from placement to capture to fulfillment. Fulfillments and labels require an idempotency key, so a double click never ships twice. (https://docs.openship.org/docs/openfront/ecommerce/api-reference)
- Filter the order list by status, with counts on every tab.
- transitionOrderStatus (https://docs.openship.org/docs/openfront/ecommerce/api-reference) handles cancel and archive with a reason.
- Notes on an order stay with it for the whole team.
- Customers see their own orders and details in the storefront account pages.

### Payments

- **Stripe and PayPal, built in**: Checkout and invoice payments run through payment providers (https://docs.openship.org/docs/openfront/ecommerce/payment-providers) linked to each region. Webhooks are verified with each provider's signature before Openfront acts on them. (https://docs.openship.org/docs/openfront/ecommerce/payment-providers)
- **Bring your own processor**: Point any operation at an HTTP adapter you deploy. Openfront posts the provider record and arguments as JSON and reads the reply. (https://docs.openship.org/docs/openfront/ecommerce/how-to-guides/custom-payment-provider)
- **Close the books each month**: The finance close report reconciles captured payments and refunds for any window up to 31 days, straight from the payment records. (https://docs.openship.org/docs/openfront/ecommerce/api-reference)
- Checkout captures when the provider reports requires_capture, approved or authorized, then checks the amount.
- Refunds never exceed the captured payment and carry your idempotency key.
- Only installed, configured providers linked to the cart's region appear at checkout.
- Stripe uses constructEvent (https://docs.stripe.com/webhooks) and PayPal its verification API for signed webhooks.

### Gift cards

- **Gift cards with a full ledger**: Issue a card with a code, value and expiry for a region. Every movement is a gift card transaction with its amount and tax, and the gift cards page (https://docs.openship.org/docs/openfront/ecommerce/gift-cards) shows balance and history at a glance. (https://docs.openship.org/docs/openfront/ecommerce/gift-cards)
- Status tabs separate active, turned-off and expired cards.
- Enable or disable a card in one click without losing its history.
- Values and balances are stored in minor units, so currencies never round.
- Cards link to the order they came from and the region they belong to.

### B2B

- **Credit accounts for business buyers**: Business customers apply with their company, type and monthly volume. Approve the request (https://docs.openship.org/docs/openfront/ecommerce/b2b-credit-accounts) with a credit limit and they check out on account. (https://docs.openship.org/docs/openfront/ecommerce/b2b-credit-accounts)
- **Invoices from unpaid orders**: Group unpaid account lines by region into an invoice with a due date. Customers pay it by Stripe or PayPal and see paid invoices in their account. (https://docs.openship.org/docs/openfront/ecommerce/b2b-credit-accounts)
- **Customer tokens for reorders**: Approved buyers create a ctok_ token to order through the API from their own systems. Openfront shows it once and keeps only a digest. (https://docs.openship.org/docs/openfront/ecommerce/api-reference)
- Requests move through pending, approved, not approved and requires info, with review notes.
- Approval creates a business account in the store's default currency.
- Customer tokens can subscribe to fulfillment.created to track shipments.
- Staff see every business account and invoice in one place.

### Returns

- **Returns with refunds**: Create a return (https://docs.openship.org/docs/openfront/ecommerce/returns-claims) from the order page with items and reasons, move it to received, then refund it against the original payment. (https://docs.openship.org/docs/openfront/ecommerce/returns-claims)
- **Claims for damaged or missing items**: Open a refund or replace claim with items and photos, and track its payment and fulfillment status alongside the order. (https://docs.openship.org/docs/openfront/ecommerce/returns-claims)
- Return reasons are your own list, with parent reasons for detail.
- Every refund carries an idempotency key and never exceeds what was captured.
- The claims page lists every claim and its status across orders.
- Return status moves from requested to received, requires action or canceled.

### Shipping

- **Live rates and labels**: Shippo and ShipEngine (https://docs.openship.org/docs/openfront/ecommerce/shipping-providers) return live rates, validate addresses, buy labels, track shipments and cancel labels from the order page. (https://docs.openship.org/docs/openfront/ecommerce/shipping-providers)
- **Fulfill in one pass**: Pick the items, choose a provider or record a manual fulfillment with tracking number and carrier. Stock and order status follow. (https://docs.openship.org/docs/openfront/ecommerce/shipping-providers)
- **Shipping options per region**: Flat-rate, calculated or free options with minimum or maximum subtotal requirements decide what customers can pick at checkout. (https://docs.openship.org/docs/openfront/ecommerce/dashboard)
- Any shipping operation can point at an HTTP adapter you deploy.
- Labels keep their tracking number, carrier and label URL with the fulfillment.
- Onboarding creates a manual fulfillment provider so day one works without a carrier account.
- Fulfillment webhooks tell your other systems when an order ships.

### Marketing

- **Discounts that stack, or don't**: Percentage, fixed and free-shipping rules apply to the total or to items, with start and end dates, usage limits and a stackable switch. (https://docs.openship.org/docs/openfront/ecommerce/dashboard)
- **Analytics by region**: Revenue and orders over time, product performance, carts, customers and fulfillment, split by region and date range. (https://docs.openship.org/docs/openfront/ecommerce/dashboard)
- Discount conditions target products, collections, categories, types, tags or customer groups.
- Limit a discount to the regions where it applies.
- Usage limits and a running usage count stop a code at the number you choose.
- Customer groups organise wholesale, VIP and staff buyers for targeting.

### Developer

- **One GraphQL API for everything**: GraphQL (https://docs.openship.org/docs/openfront/ecommerce/api-reference) at /api/graphql exposes every model plus named cart, checkout, fulfillment and refund operations. Each list's access rules apply to every caller. (https://docs.openship.org/docs/openfront/ecommerce/api-reference)
- **OAuth apps**: Register an app with redirect URIs and scopes. Operators approve it with PKCE, and the app gets refreshable tokens. (https://docs.openship.org/docs/openfront/ecommerce/marketplace-oauth)
- **Signed webhooks**: Endpoints receive order, fulfillment and payment events signed with HMAC-SHA256 in the X-OpenFront-Webhook-Signature header. (https://docs.openship.org/docs/openfront/ecommerce/marketplace-oauth)
- API keys with scopes, expiry and IP restrictions, stored hashed.
- Four bearer types: API keys, OAuth tokens, customer tokens and MCP tokens.
- Schema visualizer (https://docs.openship.org/docs/openfront/ecommerce/schema-visualizer) maps every model relationship.
- Thin route files over feature slices, so screens are easy to find and change.
- **Run on your infrastructure**: Next.js, Keystone 6, Prisma and Postgres with S3-compatible storage. Keep your database, deployment and storefront under your control. (https://github.com/openshiporg/openfront)
- **MIT source on GitHub**: Read every line, fork it, and change the dashboard or storefront in the same repo you deploy. (https://github.com/openshiporg/openfront)
- Node 20+, one Postgres database and one migrate step per release.
- MIT licensed: fork it, host it and keep every change.
