Ecommerce Template
Modern ecommerce template built with Next.js 16, React 19, Drizzle, Better Auth, Supabase, and Stripe.
CommerceBackend is the open-source infrastructure for agent-native marketplaces. Use the public sandbox to test listings, offers, and Stripe test-mode checkout through a hardened API.
CommerceTypeScript · HTMLGitHub @weareseeedOnlineOwner unconfirmed
Have you tried it? One tap is enough. No sign-in needed.
Owners of public repositories under a personal GitHub account can sign in to verify ownership and manage the introduction themselves. No administrator approval is needed.
Sign in, generate a verification file, and commit it to this repository’s default branch within 30 minutes. Files on other branches or forks do not count. Then check the file below to manage the project without administrator approval. Keep the file to retain your access.
If needed, you will go to sign-in. After signing in, return here and press your chosen verification button again.
Run /nomorevibe verify in your project folder to verify ownership and manage the introduction yourself.
Verify in one minuteAsk about other verification options
Open-source agent-first commerce backend for AI agents: listings, offers, Stripe checkout, fulfillment, and llms.txt discovery.
Taken from the repository README
Loading the full README. The saved excerpt is shown below.
CommerceBackend is an open-source, agent-first commerce backend. It allows AI agents to list, discover, buy, and sell products through APIs, with Stripe Checkout facilitating payments.
Think "eBay or Amazon for agents," rather than a human-first storefront layout.
Use this path when you want the fastest local signal before making changes:
Use this path when you want the deterministic sandbox fixtures, Prisma-managed PostgreSQL state, and the operator reset/smoke tooling:
In another shell, verify the sandbox end to end:Read the full README ↗CommerceBackend is an open-source, agent-first commerce backend. It allows AI agents to list, discover, buy, and sell products through APIs, with Stripe Checkout facilitating payments.
Think "eBay or Amazon for agents," rather than a human-first storefront layout.
Use this path when you want the fastest local signal before making changes:
git clone https://github.com/weareseeed/commercebackend.git
cd commercebackend
pnpm install
cp .env.example .env
NODE_ENV=test pnpm test
pnpm build
Use this path when you want the deterministic sandbox fixtures, Prisma-managed PostgreSQL state, and the operator reset/smoke tooling:
cp .env.sandbox.example .env
docker compose -f infra/docker-compose.yml up -d
pnpm db:migrate
pnpm db:seed
pnpm dev
In another shell, verify the sandbox end to end:
pnpm sandbox:reset
pnpm sandbox:smoke
Run the buyer-agent walkthrough after the API is available at http://localhost:4000:
node examples/agent-buyer-flow/buyer-offer-flow.mjs
If you want to drive the sandbox from Gemini or another Google AI Studio client, set GOOGLE_API_KEY in your shell or local agent project. CommerceBackend itself does not require Google AI Studio to run the API; the key is only for the external agent you point at the sandbox.
Agent entry points:
/llms-full.txtexamples/agent-buyer-flowagent-skill-kit/prompts/AGENTS.md/.well-known/agents.jsonpackages/mcp (@commercebackend/mcp), spec at docs/api/mcp-tool-spec.md/docs/sandbox/If you change llms.txt, llms-full.txt, .well-known/*.json, or other agent-discovery assets, run:
pnpm verify:discovery:strict
This checks repository parity, required public content types, and public production parity for the canonical discovery files so maintainers can catch stale repo copies, incorrect headers, stale website deployments, and newline-only byte drift before merge.
AgentQueryLog. Supports pagination.checkout.session.completed) using transaction row-level locking, signature checking, duplicate idempotency, and inventory checks.docs/api/protocol-acp.md./v1/protocols/ucp/*); see docs/api/protocol-ucp.md for the supported subset. Not a claim of conformance to any named external "UCP" standard.docs/api/connectors-square.md), Shopify (docs/api/connectors-shopify.md), BigCommerce (docs/api/connectors-bigcommerce.md), and WooCommerce (docs/api/connectors-woocommerce.md). All are fixture-driven by default and optionally live against the operator's own sandbox/store account — neither reaches a third-party merchant's live store, and no automatic/scheduled sync exists for any of them.Seller Agent Buyer Agent
│ │
│ POST /v1/listings │ POST /v1/search
▼ ▼
┌──────────────────────────────────────────────────┐
│ CommerceBackend API │
│ │
│ ┌───────────────┐ ┌─────────────────┐ │
│ │ Agent Auth │ │ Search Service │ │
│ └───────────────┘ └─────────────────┘ │
│ │
│ ┌───────────────┐ ┌─────────────────┐ │
│ │ Checkout │ │ Orders & Fulfill│ │
│ └───────┬───────┘ └────────▲────────┘ │
└───────────┼─────────────────────────┼────────────┘
│ │
│ Creates Session │ Webhook Event
▼ │ (checkout.session.completed)
┌──────────────────────┐ ┌─────────┴────────────┐
│ Stripe Checkout ├───►│ Stripe Webhook │
│ (Hosted Credit Card) │ └──────────────────────┘
└──────────────────────┘
We maintain standard commands in the root workspace to manage compilation, quality checks, migrations, seeding, and execution:
pnpm install
cp .env.example .env
# Run Postgres database migrations
pnpm db:migrate
# Reset database (wipes tables)
pnpm db:reset
# Seed database with sample buyer, seller, and listings
pnpm db:seed
pnpm dev
# Run unit and integration tests (with Stripe mocks)
NODE_ENV=test pnpm test
# Check code style with ESLint
pnpm lint
# Check type safety with TypeScript
pnpm typecheck
# Compile and build all monorepo workspaces
pnpm build
We provide a self-contained local self-test tool to verify the entire atomic commerce loop.
# Mode A: Mock Mode (does not connect to Stripe API, bypasses signatures)
pnpm selftest
# or
pnpm selftest:mock
# Mode B: Stripe Mode (connects to real Stripe test APIs, requires valid keys)
pnpm selftest:stripe
# Mode C: Square Mode (imports a catalog via the Square connector; uses the
# fixture unless SQUARE_ACCESS_TOKEN is set, in which case it hits your own
# Square Developer Sandbox — see docs/api/connectors-square.md)
pnpm selftest:square
# Mode D: Shopify Mode (imports a catalog via the Shopify connector; uses the
# fixture unless SHOPIFY_SHOP_DOMAIN and SHOPIFY_ACCESS_TOKEN are set, in
# which case it hits your own Shopify development store — see
# docs/api/connectors-shopify.md)
pnpm selftest:shopify
# Mode E: BigCommerce Mode (imports a catalog via the BigCommerce connector;
# uses the fixture unless BIGCOMMERCE_STORE_HASH and BIGCOMMERCE_ACCESS_TOKEN
# are set, in which case it hits your own BigCommerce store — see
# docs/api/connectors-bigcommerce.md)
pnpm selftest:bigcommerce
# Mode F: WooCommerce Mode (imports a catalog via the WooCommerce connector;
# uses the fixture unless WOOCOMMERCE_SITE_URL, WOOCOMMERCE_CONSUMER_KEY, and
# WOOCOMMERCE_CONSUMER_SECRET are set, in which case it hits your own
# WooCommerce store — see docs/api/connectors-woocommerce.md)
pnpm selftest:woocommerce
CommerceBackend ships a production container image (Dockerfile) that runs on Cloud Run, Railway, Fly, or any container platform. It listens on $PORT, runs as a non-root user, and applies migrations on boot when RUN_MIGRATIONS=true.
docker build -t commercebackend-api .
# Prod-like local stack (Postgres + API):
docker compose -f infra/docker-compose.app.yml up --build
See the deploy runbook for the Cloud Run and Railway paths, required environment/secrets (.env.hosted.example), and the launch checklist.
| Variable | Default | Purpose |
|---|---|---|
CORS_ORIGIN | * | * or a comma-separated origin allowlist (browser callers only). |
RATE_LIMIT_MAX | 300 | Per-IP request ceiling applied globally outside tests. |
RATE_LIMIT_WINDOW | 1 minute | Window for the rate limit. |
TRUST_PROXY | true | Trust X-Forwarded-For for the real client IP behind a reverse proxy, so per-IP rate limiting keys correctly. Set to false only with no proxy in front. |
RUN_MIGRATIONS | — | true applies pending migrations on container start. |
RUN_SEED | — | true resets and seeds sandbox fixtures on start (demo only). |
/health, /ready, and the Stripe webhook are exempt from rate limiting.
All endpoints conform to the standard error response layout and require request IDs.
| Method | Endpoint | Auth | Description |
|---|---|---|---|
GET | /health | Public | Liveness status (version 0.2.2) |
GET | /ready | Public | Readiness status (verifies database & Stripe config) |
POST | /v1/agents | Public | Register a buyer/seller agent (returns API key once) |
GET | /v1/agents/me | Bearer | Get details of authenticated agent |
POST | /v1/listings | Bearer | Create a fixed-price listing (Sellers only) |
GET | /v1/listings/:id | Bearer | Read listing details |
PATCH | /v1/listings/:id | Bearer | Update listing properties (Owner only) |
POST | /v1/listings/:id/pause | Bearer | Pause a listing (Owner only) |
POST | /v1/listings/:id/activate | Bearer | Re-activate a listing (Owner only) |
POST | /v1/listings/:id/offers | Bearer | Submit an offer on a listing (Buyers only) |
POST | /v1/search | Bearer | Query catalog matching search terms and filters |
GET | /v1/offers | Bearer | List offers associated with the agent (filter by role) |
GET | /v1/offers/:id | Bearer | View specific offer details and audit trail |
POST | /v1/offers/:id/accept | Bearer | Accept offer terms (Listing owner/sellers only) |
POST | /v1/offers/:id/reject |
docs/api/connectors-square.md, fixture-driven by default, optionally live against the operator's own Square Developer Sandbox), Shopify (docs/api/connectors-shopify.md, fixture-driven by default, optionally live against the operator's own Shopify development store), BigCommerce (docs/api/connectors-bigcommerce.md, fixture-driven by default, optionally live against the operator's own BigCommerce store), and WooCommerce (docs/api/connectors-woocommerce.md, fixture-driven by default, optionally live against the operator's own WooCommerce store). No OAuth-based merchant onboarding or automatic sync for any of them.docs/api/protocol-acp.md for unsupported fields — not a certified/full spec implementation.docs/api/protocol-ucp.md) supports single-listing order create/read mapped onto the existing Stripe-hosted-checkout-URL redirect model only — no delegated/tokenized payment handoff, order update/cancel, multi-item carts, tax, discounts, or refunds.payment_inventory_conflict state requiring manual review.CommerceBackend is built for agents first. If you are an autonomous coding, commerce, research, or procurement agent, start here:
AGENTS.md for contribution rules, safety boundaries, and the architecture map.docs/api/native-api.md.pnpm lint
pnpm typecheck
pnpm build
NODE_ENV=test pnpm test
If you changed llms.txt, llms-full.txt, .well-known/*.json, or related discovery docs, also run:
pnpm verify:discovery:strict
Agent safety notes:
To assist autonomous AI agents in discovering, understanding, and integrating with this API system, we publish canonical metadata:
The canonical maintainer for agent skills and adapters is Joshua / Seeed AI Operations, under Seeed LLC oversight. See agent-skill-kit/MAINTAINERS.md.
Update the skill kit whenever API behavior, schemas, examples, prompts, supported capabilities, or safety boundaries change.
Detailed documentation on development guides, security, testing, and payment setups:
CommerceBackend is owned and maintained by Seeed LLC. Copyright ©️ 2026 Seeed LLC. Licensed under the Apache License 2.0.
Licensed under the Apache License 2.0. See LICENSE for details.
| Bearer |
| Reject offer/counter-offer terms |
POST | /v1/offers/:id/counter | Bearer | Submit a counter offer (Listing owner/sellers only) |
POST | /v1/offers/:id/accept-counter | Bearer | Accept seller's counter-offer (Buyers only) |
POST | /v1/offers/:id/cancel | Bearer | Cancel pending/countered offer (Buyers only) |
POST | /v1/checkout-intents | Bearer | Initiate checkout session for a listing/offer (Buyers) |
POST | /v1/webhooks/stripe | Public | Webhook verifying payment sessions and creating orders |
GET | /v1/orders | Bearer | Query list of orders for the agent (filtered by role) |
GET | /v1/orders/:id | Bearer | Read specific order details (Buyer or Seller only) |
POST | /v1/orders/:id/fulfillment | Bearer | Update order fulfillment status (Seller only) |