add-stripe-checkout
Adds Stripe Checkout for one-off payments or subscriptions with a server route that creates the session and a verified webhook that fulfils the order. Use when the user wants to take payments, charge cards, sell a product, add a pricing page, subscriptions, or a buy button.
Version 1.0 · Updated 2026-10-30
Install in Claude Code, Cursor or Codex (optional)
Only for AI coding tools that read skill folders. Run one line in a terminal, in your project folder. It downloads this skill's text files from TheSkillVault and nothing else; you can read them first with “View raw SKILL.md”.
Claude Code (all your projects)
curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/add-stripe-checkout/raw' -o ~/'.claude/skills/add-stripe-checkout/SKILL.md'Cursor (this project)
curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/add-stripe-checkout/raw' -o '.cursor/skills/add-stripe-checkout/SKILL.md'Codex and other Agent Skills tools (this project)
curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/add-stripe-checkout/raw' -o '.agents/skills/add-stripe-checkout/SKILL.md'
Or connect the whole library over MCP
Add TheSkillVault to Cursor or add this to your app's MCP settings (read-only; help):
{
"mcpServers": {
"theskillvault": {
"url": "https://theskillvault.ai/mcp"
}
}
}Add Stripe Checkout
When to use
- Selling something without building a custom card form.
Steps
- Create the Product and Price in the Stripe dashboard (test mode); copy the
price_...ID. npm i stripe; setSTRIPE_SECRET_KEYandSTRIPE_WEBHOOK_SECRETserver-side only.- Server route
POST /api/checkout:stripe.checkout.sessions.create({ mode: "payment" | "subscription", line_items: [{ price, quantity: 1 }], success_url, cancel_url, client_reference_id: userId }), returnsession.url, redirect the browser to it. - Webhook route
POST /api/stripe/webhook: read the raw body,stripe.webhooks.constructEvent(raw, sig, secret), handlecheckout.session.completed(andcustomer.subscription.*for subs). Fulfil here, not on the success page. - Make fulfilment idempotent: store
event.idorsession.idand skip duplicates. - Test locally:
stripe listen --forward-to localhost:3000/api/stripe/webhookandstripe trigger checkout.session.completed. Card4242 4242 4242 4242.
Gotchas
- Parsing the body as JSON before verifying breaks the signature check.
- Prices come from Stripe, never from the client request.
- The success page can be reached without paying; never grant access there.
Example prompt
"Add a $29 buy button that unlocks the pro features after payment."
Licence: CC BY 4.0. Attribution when you reuse it: From TheSkillVault, https://theskillvault.ai, CC BY 4.0