Home Knowledge Base Stripe

Stripe is the leading payment processing API enabling businesses to accept online payments, manage subscriptions, and handle complex financial operations programmatically, trusted by hundreds of thousands of companies to process $1 trillion+ in transactions annually.

What Is Stripe?

Why Stripe Matters

Key Products

Stripe Payments (One-Time Payment):

const paymentIntent = await stripe.paymentIntents.create({
  amount: 2000,  // $20.00
  currency: "usd",
  payment_method_types: ["card"]
});

Use cases: E-commerce purchases, SaaS subscriptions, donations

Stripe Billing (Recurring):

const subscription = await stripe.subscriptions.create({
  customer: "cus_abc123",
  items: [{price: "price_xyz"}]
});

Use cases: SaaS, subscriptions, memberships

Stripe Connect (Marketplace):

const account = await stripe.accounts.create({
  type: "express",
  country: "US",
  email: "[email protected]"
});

Use cases: Marketplaces, platforms, multi-party payments

Stripe Checkout (Pre-Built Page):

const session = await stripe.checkout.sessions.create({
  line_items: [{price: "price_xyz", quantity: 1}],
  mode: "payment",
  success_url: "https://example.com/success",
  cancel_url: "https://example.com/cancel"
});

Use cases: Quick payment pages, no custom UI needed

Stripe Invoicing:

Stripe Financial Tooling:

Implementation Flow

Backend Setup:

const stripe = require("stripe")("sk_test_...");

// Create payment intent
const intent = await stripe.paymentIntents.create({
  amount: 1000,
  currency: "usd",
  payment_method_types: ["card", "apple_pay"]
});

Frontend Handling:

const stripe = Stripe("pk_test_...");
const elements = stripe.elements();
const cardElement = elements.create("card");
cardElement.mount("#card-element");

// Confirm payment
const {error} = await stripe.confirmCardPayment(intent.client_secret, {
  payment_method: {card: cardElement}
});

Webhook Processing:

app.post("/webhook", async (req, res) => {
  const sig = req.headers["stripe-signature"];
  const event = stripe.webhooks.constructEvent(
    req.body, sig, webhookSecret
  );
  
  if (event.type === "payment_intent.succeeded") {
    // Fulfill order
    await fulfillOrder(event.data.object);
  }
  
  res.json({received: true});
});

Pricing Model

Standard Rates:

Examples:

Volume Discounts:

Payment Methods Supported

Cards:

Digital Wallets:

Bank Transfers:

Regional Methods:

Use Cases

E-Commerce Stores:

SaaS & Subscriptions:

Marketplaces:

Crowdfunding:

On-Demand Services:

Nonprofits:

Security & Compliance

Stripe vs Alternatives

FeatureStripePayPalSquareBraintree
API Quality⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐
DocumentationBestGoodGoodGood
Payments
SubscriptionsLimited
PayoutsLimitedLimitedLimited
Price2.9%+2.2%+2.7%+2.9%+
EaseVery EasyMediumMediumEasy

Best Practices

1. Webhook Reliability: Always handle webhook retries 2. Idempotency: Use idempotent keys for retry safety 3. Error Handling: Implement proper error recovery 4. Testing: Use test mode before production 5. PCI Compliance: Never handle raw card data 6. Monitoring: Monitor webhook delivery and payment status 7. Documentation: Document your payment flow 8. Customer Communication: Clear payment status messaging

Integration Patterns

E-Commerce Workflow: 1. Shopping cart built 2. Checkout page created 3. Create payment intent 4. Collect payment 5. Fulfill order via webhook 6. Send confirmation

Subscription Setup: 1. Create customer 2. Create subscription with price 3. Attach payment method 4. Handle status changes 5. Manage billing issues

Marketplace Payout: 1. Collect payment from buyer 2. Hold funds temporarily (escrow) 3. Order fulfilled 4. Transfer to seller's Stripe account 5. Seller receives payout to bank

Common Integration Patterns

Stripe is the gold standard for online payments — combining developer-friendly APIs, world-class security, global reach, and excellent documentation to make payments the easiest part of your product.

stripepaymentapi

Explore 500+ Semiconductor & AI Topics

From EUV lithography to CUDA optimization — search the full knowledge base or chat with our AI assistant.