# Ordercore Examples

> Give your AI agent a retry-safe checkout tool in 5 minutes. Runnable examples for OrderCore — the commerce API + MCP server for AI agents. Offline, no signup.

- **Type:** MCP server
- **Install:** `agentstack add mcp-rulezzzor-ordercore-examples`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [RulezZzOr](https://agentstack.voostack.com/s/rulezzzor)
- **Installs:** 0
- **Category:** [AI & ML](https://agentstack.voostack.com/c/ai-and-ml)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [RulezZzOr](https://github.com/RulezZzOr)
- **Source:** https://github.com/RulezZzOr/ordercore-examples

## Install

```sh
agentstack add mcp-rulezzzor-ordercore-examples
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Give your AI agent a checkout tool — retries never double-charge

[](#try-it-in-30-seconds)
[](#try-it-in-30-seconds)
[](https://ordercore.ai/what-is-an-mcp-commerce-server)
[](https://ordercore.ai/openapi.yaml)
[](LICENSE)

**An agent is a retry machine pointed at your API.** It retries on a timeout, on
a rate limit, when its own loop restarts. If your checkout isn't idempotent,
that retry is a second order and a second charge on a real person's card.

These are runnable examples for [OrderCore](https://ordercore.ai) — the commerce
API and MCP server for AI agents: catalog, prices, inventory, and **idempotent
checkout**. Every one of them deliberately retries the payment call and exits `0`
only if **one** order came back.

## Try it in 30 seconds

No API key. No signup. No dependencies to install.

```bash
git clone https://github.com/RulezZzOr/ordercore-examples.git
cd ordercore-examples/agent-commerce-demo

node run.mjs        # Node 18+
python3 run.py      # or Python 3.8+
```

```
→ complete_checkout_session({"session_id":"cs_sku_espresso"})
  {"order_id":"order_1","status":"confirmed"}
→ complete_checkout_session({"session_id":"cs_sku_espresso"})   ← the retry
  {"order_id":"order_1","status":"confirmed"}                   ← same order

✅ 2 completion calls -> 1 order. Idempotency held.
```

Exit code `0` means the retried checkout returned the **same order, not two**.

## Wire it into your agent in one command

```bash
claude mcp add ordercore --env ORDERCORE_API_KEY=oc_live_xxx -- /path/to/ordercore-mcp
```

Binaries for macOS/Linux/Windows: [ordercore.ai/downloads](https://ordercore.ai/downloads) ·
Claude Desktop / Cursor config: [`mcp/`](mcp/)

## What's here

| Example | What it shows |
| --- | --- |
| [`agent-commerce-demo/`](agent-commerce-demo/) | The core flow: create a checkout session → complete it → retry → same order. Node + Python. |
| [`sandbox-quickstart/`](sandbox-quickstart/) | First **real, authenticated** call with **no signup, no key** — issue a read-only sandbox key from `POST /bootstrap/sandbox-key`, then read the live catalog. Run `node run.mjs --live`. |
| [`catalog-read/`](catalog-read/) | The "shop" phase: `search_products`, `get_product`, `get_prices`, `get_inventory` as plain REST GETs. |
| [`idempotent-orders/`](idempotent-orders/) | `Idempotency-Key` on `POST /v1/orders`: 201 new / 200 replay / 409 conflict. |
| [`claude-checkout-agent/`](claude-checkout-agent/) | **Full Claude agentic loop** — tool_use → execute → tool_result; the agent retries checkout and gets the same order. Offline scripted-model mode or live with `ANTHROPIC_API_KEY`. |
| [`openai-checkout-agent/`](openai-checkout-agent/) | **GPT function-calling loop** over the same tools (raw fetch, zero deps). Offline or live with `OPENAI_API_KEY`. |
| [`langchain-checkout-agent/`](langchain-checkout-agent/) | **LangChain `@tool` functions** + agent loop; drop `TOOLS` into any LangChain/LangGraph agent. |
| [`vercel-ai-checkout-agent/`](vercel-ai-checkout-agent/) | **Vercel AI SDK `tool()` definitions** + one `generateText` call; offline via `MockLanguageModelV3`. |
| [`mcp/`](mcp/) | Register the `ordercore-mcp` server with Claude Code, Claude Desktop, or Cursor. |

## Go live

1. Get an API key at [ordercore.ai/bootstrap](https://ordercore.ai/bootstrap) — two fields, no payment.
2. Re-run any example with `ORDERCORE_API_KEY=oc_live_xxx`.
3. Wire the same tools into your agent:
   - **MCP**: [`mcp/`](mcp/) — one command for Claude Code
   - **OpenAPI 3.1**: [`ordercore.ai/openapi.yaml`](https://ordercore.ai/openapi.yaml) — import into GPT Actions, Postman, or a codegen
   - **Ready-made tool schemas** for OpenAI / Claude / Gemini / DeepSeek / Grok: [`api.ordercore.ai/direct-ai/tooling`](https://api.ordercore.ai/direct-ai/tooling)

## SDKs

Official, dependency-free clients that make idempotency the default and retry
safely. Each has a one-line **`sandbox()`** that issues a read-only key for you —
no signup:

| SDK | Install | First call, no signup |
| --- | --- | --- |
| [`sdk/js`](sdk/js) — Node 18+ | `npm i @ordercore/sdk` | `const oc = await OrderCore.sandbox();` |
| [`sdk/python`](sdk/python) — Python 3.8+ | `pip install ordercore` | `oc = OrderCore.sandbox()` |

Full read/write keys (for checkout) at [ordercore.ai/bootstrap](https://ordercore.ai/bootstrap).

## Why idempotency matters for agents

Agents retry. Networks fail mid-checkout. Without idempotency, a retried
`complete_checkout` charges twice; with OrderCore the same completion call always
returns the same order, and the same `Idempotency-Key` with a *different* payload
returns `409` instead of silently creating a second order.
[Full write-up](https://ordercore.ai/idempotent-orders-for-ai-agents).

## Links

- Docs: https://ordercore.ai/docs
- Browser demo (no signup): https://ordercore.ai/agent-commerce-demo
- MCP guide: https://ordercore.ai/what-is-an-mcp-commerce-server
- OrderCore vs Stripe Agent Toolkit: https://ordercore.ai/ordercore-vs-stripe-agent-toolkit

## License

MIT — see [LICENSE](LICENSE). (The OrderCore service and backend are proprietary;
these examples and docs are free to copy into your own agent.)

## Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [RulezZzOr](https://github.com/RulezZzOr)
- **Source:** [RulezZzOr/ordercore-examples](https://github.com/RulezZzOr/ordercore-examples)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/mcp-rulezzzor-ordercore-examples
- Seller: https://agentstack.voostack.com/s/rulezzzor
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
