Skip to main content

Welcome to Stripe Payments API

A production-ready Node.js + Express API for integrating Stripe payment processing into your applications. This API provides a complete payment gateway with customer management, card tokenization, payment processing, and webhook handling.

Quickstart

Get up and running with the API in minutes

API Reference

Explore all available endpoints

Complete Workflow

Learn the end-to-end payment flow

Docker Deployment

Deploy using Docker or pull from Docker Hub

Key Features

Customer Management

Create, update, retrieve, and delete Stripe customers

Card Tokenization

Securely tokenize and manage customer payment methods

Payment Processing

Create payment intents, confirm charges, and handle refunds

Webhook Events

Receive and verify Stripe webhook events with signature validation

Architecture Highlights

Modular Design

Domain-based organization with customers, cards, payments, and webhooks modules

Error Handling

Centralized error handling with standardized API responses

OpenAPI Docs

Complete Swagger documentation available at /doc endpoint

Quick Example

Create a customer and process a payment:
// 1. Create a customer
const customer = await fetch('/api/customers/create', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    email: '[email protected]',
    name: 'John Doe',
    phone: '+1234567890'
  })
});

// 2. Create and assign a card token
const card = await fetch('/api/cards/create', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    number: '4242424242424242',
    exp_month: '12',
    exp_year: '2025',
    cvc: '123'
  })
});

// 3. Create a payment intent (amount in euros, not cents)
const payment = await fetch('/api/payments/create', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    amount: 50, // €50.00 (API multiplies by 100 internally)
    customer_id: customer.data.id,
    payment_method: card.data.token_id
  })
});

Build docs developers (and LLMs) love