@checkoutkit/core
v0.2.0
Published
Protocol types, Zod schemas, errors and constants for the Agentic Commerce Protocol
Maintainers
Readme
@checkoutkit/core
Protocol types, Zod schemas, errors and constants for the Agentic Commerce Protocol. Every other CheckoutKit package builds on this one; you rarely install it directly.
pnpm add @checkoutkit/coreThe schemas are generated from the upstream spec, not hand-transcribed. The
JSON Schema and OpenAPI documents are vendored under spec/2026-04-17/ and
compiled into Zod, so a spec bump is a regeneration and a diff review.
import { CheckoutSessionSchema, InvalidRequestError, SPEC_VERSIONS } from "@checkoutkit/core";
const session = CheckoutSessionSchema.parse(payload);Two behaviours worth knowing:
- Unknown fields are preserved, not stripped. Upstream declares
additionalProperties: false, but a newer peer's payload has to survive a round trip. Usestrict(Schema)when you want the closed behaviour. - Some enums are deliberately open. Where the spec says servers should accept unrecognized values, the schema does.
Errors serialise to the spec's Error envelope:
new InvalidRequestError({ code: "invalid_email", message: "...", param: "$.buyer.email" }).toBody();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
