tools/integrations/stripe.md
Payment processing, subscriptions, and billing for internet businesses.
| Integration | Available | Notes |
|---|---|---|
| API | ✓ | Comprehensive REST API |
| MCP | ✓ | Available via Stripe MCP server |
| CLI | ✓ | stripe CLI for testing and webhooks |
| SDK | ✓ | Official SDKs for most languages |
Authorization: Bearer sk_live_xxx or sk_test_xxxGET https://api.stripe.com/v1/customers?limit=10
GET https://api.stripe.com/v1/[email protected]
GET https://api.stripe.com/v1/subscriptions/{subscription_id}
GET https://api.stripe.com/v1/subscriptions?customer={customer_id}
POST https://api.stripe.com/v1/checkout/sessions
customer={customer_id}
&line_items[0][price]={price_id}
&line_items[0][quantity]=1
&mode=subscription
&success_url=https://example.com/success
&cancel_url=https://example.com/cancel
POST https://api.stripe.com/v1/billing_portal/sessions
customer={customer_id}
&return_url=https://example.com/account
GET https://api.stripe.com/v1/invoices?customer={customer_id}&limit=10
GET https://api.stripe.com/v1/payment_intents/{payment_intent_id}
Key events to handle:
| Event | When | Action |
|---|---|---|
checkout.session.completed | Successful checkout | Provision access |
customer.subscription.created | New subscription | Update user record |
customer.subscription.updated | Plan change | Update entitlements |
customer.subscription.deleted | Cancellation | Revoke access |
invoice.payment_failed | Payment failed | Notify user, retry |
invoice.paid | Invoice paid | Confirm payment |
const event = stripe.webhooks.constructEvent(
payload,
sig,
webhookSecret
);
# Listen to webhooks locally
stripe listen --forward-to localhost:3000/webhooks
# Trigger test events
stripe trigger checkout.session.completed
# List recent events
stripe events list --limit 10
# Get resource
stripe customers retrieve cus_xxx