CommerceForAI

Add a store to your app with an AI coding agent

Give your agent a commerce backend built for it, and it adds a working store in one session: products, a cart, Stripe checkout, stock that can't oversell, and orders. The same backend then lets an agent run the store through tools.

The prompt

Add a store to this app using CommerceForAI. Read https://commerceforai.com/llms.txt first.
Run "npx commerceforai init" yourself to get a test store. Prove checkout works with a simulated order.

That's enough. The agent creates a free test store without asking you to sign up anywhere, and you get a link to claim it.

What the agent does

  1. npx commerceforai init creates a test store and saves an API key to .env.local. In a Next.js app, --template nextjs also adds a working storefront.
  2. It creates your products with the SDK, then builds product pages and a cart in your own design.
  3. Checkout is one call. The customer pays on Stripe's page; stock is held until they pay.
  4. It checks its own work: setupStatus() lists what's left, and simulateOrder() runs a full purchase without a browser.
  5. When you're ready, it gives you one link that copies the store to live mode and connects your Stripe account.
import { Commerce } from "commerceforai";
const commerce = new Commerce(process.env.COMMERCEFORAI_API_KEY);

const { data: tee } = await commerce.products.create({
  name: "Trail Tee",
  variants: [{ name: "M", price: 3600, inventory: 20 }, { name: "L", price: 3600, inventory: 20 }],
});

const { data: checkout } = await commerce.checkouts.create({
  items: [{ variant_id: tee.variants[0].id, quantity: 1 }],
  success_url: "https://yoursite.com/thanks",
});
// redirect the customer to checkout.url

Python works the same way: pip install commerceforai. Other languages use the REST API and its OpenAPI description.

What you don't have to build

  • An orders table, or webhook code to mark orders paid. Orders are created from Stripe's payment events.
  • Stock counters. Stock is reserved at checkout, committed on payment and released if the checkout expires.
  • Order emails, refunds, returns, discount codes, sales tax, or a customer login. Customers get a private account page by email link.

Running it afterwards

Connect the MCP server and an agent can answer "which orders haven't shipped?", buy labels, restock and refund, inside limits you set. Install it in Claude Code with the plugin:

/plugin marketplace add https://commerceforai.com/.claude-plugin/marketplace.json
/plugin install commerceforai@commerceforai

Cost: free in test mode and for your first 100 orders a month, then 1% per order, never more than $29 a month. See pricing.