@checkoutkit/client
v0.2.0
Published
Agent-side typed client for the Agentic Commerce Protocol
Maintainers
Readme
@checkoutkit/client
The agent side of the Agentic Commerce Protocol — for AI apps that need to buy.
pnpm add @checkoutkit/clientimport { AcpClient } from "@checkoutkit/client";
const merchant = new AcpClient({
baseUrl: "https://store.example.com/acp",
auth: { bearer: process.env.AGENT_KEY! },
});
let session = await merchant.checkout.create({
line_items: [{ id: "sku_123" }],
currency: "usd",
capabilities: {},
});
if (!session.canComplete) {
console.log(session.blockingMessages.map((m) => m.content));
}Responses are validated against the protocol schema, idempotency keys and request
ids are generated for you, and 5xx / 429 / idempotency_in_flight are retried with
backoff — reusing the same key, which is what makes retrying safe.
Wiring it into a model
const tools = merchant.asTools({ format: "anthropic" }); // or "openai" | "vercel"
const result = await merchant.executeTool(toolCall.name, toolCall.input);The tool schemas come from the same generated protocol schemas the client validates against, so a well-formed tool call is a valid request by construction.
Plaintext http:// base URLs are refused for non-loopback hosts — a checkout
session carries buyer PII and payment tokens.
CheckoutKit is an independent community implementation of the Agentic Commerce Protocol. It is not affiliated with, sponsored by, or endorsed by OpenAI or Stripe.
Part of CheckoutKit · Apache-2.0
