Skip to content
Development
Skill

/api-commerce-stripe

Stripe payment processing — Checkout Sessions, Payment Intents, subscriptions, webhooks, Connect, customer management, error handling

From plugin
skills
26200 skills

Claude Code

$ npx -y skills add agents-inc/skills --skill api-commerce-stripe --agent claude-code

SKILL.md

api-commerce-stripe.SKILL.md
name: api-commerce-stripe
description: Stripe payment processing — Checkout Sessions, Payment Intents, subscriptions, webhooks, Connect, customer management, error handling

Stripe Patterns

> **Quick Guide:** Use the `stripe` npm package for all server-side Stripe operations. Always verify webhook signatures with `constructEvent()` using the raw request body, never the parsed body. Use idempotency keys on all mutating requests. Keep the secret key server-side only. Handle errors with `instanceof Stripe.errors.StripeError`. Amounts are always in the smallest currency unit (e.g., cents for USD).

---

<critical_requirements>

CRITICAL: Before Using This Skill

**(You MUST NEVER expose `STRIPE_SECRET_KEY` in client-side code — it stays on the server only)**

**(You MUST verify webhook signatures with `stripe.webhooks.constructEvent()` using the RAW request body — never parsed JSON)**

**(You MUST use idempotency keys on all mutating (POST) requests to prevent duplicate charges)**

**(You MUST handle all Stripe errors with `instanceof Stripe.errors.StripeError` — never swallow payment errors)**

**(You MUST express monetary amounts in the smallest currency unit — cents for USD, not dollars)**

</critical_requirements>

---

**Auto-detection:** Stripe, stripe, stripe.checkout.sessions, stripe.paymentIntents, stripe.customers, stripe.subscriptions, stripe.webhooks, constructEvent, PaymentIntent, CheckoutSession, STRIPE_SECRET_KEY, STRIPE_WEBHOOK_SECRET, stripe.prices, stripe.products, stripe.refunds, stripe.transfers, stripe.accounts, Stripe.errors, idempotencyKey, payment_intent.succeeded, checkout.session.completed

**When to use:**

  • Creating Checkout Sessions for one-time or subscription payments
  • Building custom payment flows with Payment Intents
  • Handling webhook events for asynchronous payment lifecycle
  • Managing customers, payment methods, and subscriptions
  • Building marketplace platforms with Stripe Connect
  • Processing refunds and handling disputes
  • Setting up products and prices for a catalog

**Key patterns covered:**

  • Stripe client initialization with TypeScript types
  • Checkout Sessions (one-time payments, subscriptions, setup mode)
  • Payment Intents (custom flows, confirmation, capture)
  • Webhook signature verification and event handling
  • Customer creation, update, and payment method attachment
  • Subscription lifecycle (create, update, cancel, trials, proration)
  • Products and Prices (catalog management)
  • Stripe Connect (account creation, transfers, destination charges)
  • Error handling with typed Stripe errors
  • Idempotency keys for safe retries

**When NOT to use:**

  • Client-side Stripe.js or Stripe Elements (use your frontend framework skill)
  • Stripe CLI commands or dashboard configuration
  • Non-Stripe payment processors (use their dedicated skill)

**Detailed Resources:**

  • For decision frameworks and anti-patterns, see [reference.md](reference.md)

**Core Setup & Payments:**

  • [examples/core.md](examples/core.md) — Client setup, Checkout Sessions, Payment Intents, error handling

**Webhooks & Events:**

  • [examples/webhooks.md](examples/webhooks.md) — Signature verification, event handling, idempotent processing

**Subscriptions & Billing:**

  • [examples/subscriptions.md](examples/subscriptions.md) — Subscription lifecycle, trials, proration, metered billing

**Connect & Platforms:**

  • [examples/connect.md](examples/connect.md) — Connected accounts, transfers, destination charges, platform fees

---

<philosophy>

Philosophy

Stripe is a payment infrastructure platform. The `stripe` npm package is the server-side SDK for interacting with the Stripe API. All payment processing happens server-side for security.

**Core principles:**

1. **Server-side only** — The secret key and all payment-creating operations must never run in the browser. Client-side uses Stripe.js (a separate concern) only for collecting payment details. 2. **Amounts in smallest unit** — All monetary values are integers in the smallest currency unit (cents for USD, pence for GBP). `1000` means $10.00, not $1000. 3. **Idempotency for safety** — Every mutating request should include an idempotency key to prevent duplicate charges on network retries. Stripe's SDK auto-generates keys for retries, but you should provide explicit keys for application-level retries. 4. **Webhooks are the source of truth** — Payment status should be confirmed via webhooks, not by polling. Webhook events are the only reliable indicator that a payment succeeded, failed, or requires action. 5. **Error as typed exceptions** — Stripe errors are thrown (not returned as values). Catch with `instanceof Stripe.errors.StripeError` and handle by type for appropriate user responses. 6. **API versioning matters** — Pin your API version. Types reflect the latest API version. Use `apiVersion` in the constructor to lock behavior.

**When to use Stripe:**

  • Accepting payments (one-time, recurring, marketplace splits)
  • Building subscription billing systems
  • Platform/marketplace payment splitting with Connect
  • Saving payment methods for future charges

**When NOT to use:**

  • Client-side payment form rendering (Stripe.js / Elements is a separate domain)
  • Payment processing without a server (Stripe requires server-side secret key)
  • Simple donation buttons (Stripe Payment Links may suffice without code)

</philosophy>

---

<patterns>

Core Patterns

Pattern 1: Stripe Client Initialization

Create a singleton Stripe client. Secret key from env, API version pinned. See [examples/core.md](examples/core.md) for full setup.

export const stripe = new Stripe(process.env.STRIPE_SECRET_KEY!, {
  apiVersion: "2026-02-25.clover",
});

Never hardcode the secret key or omit `apiVersion` (behavior changes silently on Stripe API upgrades).

---

Pattern 2: Checkout Sessions

Use `mode: "payment"` for one-time, `mode: "subscription"` for recurring. Stripe hosts the payment page. Always include `{CHEC

Read more
@agents-inc
Ships withskills

The official skills marketplace for Agents Inc. 230+ skills covering everything from React and Prisma to Redis, ElevenLabs, and infrastructure tooling. Pick the skills that match your stack and install them via Claude Code. Need more control?

Stars on GitHub

Momentum

stars in total
26
Star history of agents-inc/skills on GitHub, a chart by star-history.com

Other skills on skills.

ai-infrastructure-litellm

ai-infrastructure-lite…

LiteLLM proxy server setup, TypeScript client patterns via OpenAI SDK, model routing, fallbacks, load balancing, spend tracking,…

@agents-inc@agents-incInstall Skill
ai-infrastructure-modal

ai-infrastructure-moda…

Serverless GPU compute platform for AI model deployment — web endpoints, GPU functions, model serving, and TypeScript client…

@agents-inc@agents-incInstall Skill
ai-infrastructure-ollama

ai-infrastructure-olla…

Local LLM inference with the Ollama JavaScript client -- chat, streaming, tool calling, vision, embeddings, structured output,…

@agents-inc@agents-incInstall Skill

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills11d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc13d293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react2d252k
@facebook@facebookInstall Skill

Questions about api-commerce-stripe.

Which coding agents can use api-commerce-stripe?
api-commerce-stripe installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.