Playground API
DocsStatsBlogStudio
Documentation Tree
Technical BlogFeature Deep Dives
  • Introduction
  • Quickstart
    5 min
  • How It Works
  • Recipes & Cookbooks
  • Platform Comparisons
  • Real-World Showcase
  • Interactive Studio
    Studio
  • GraphiQL IDE
    IDE
  • Session Quotas & Activity
  • Network Chaos Simulator
  • Atomic Sandbox Reset
  • Overview & Models
    Hub
  • Users Resource
  • Posts Resource
  • Comments Resource
  • Todos Resource
  • Custom Collections
    Custom
  • Multipart File Uploads
    Upload
  • Dynamic SVG Avatars
    SVG
  • Image Thumbnails
    CDN
  • Relational Filtering
  • Full-Text Search
  • Dynamic Sorting
  • Offset Pagination
  • Cursor Pagination
    Scroll
  • CSV & Excel Export & Import
    IO
  • Custom Collections
    CRUD
  • Overview & Architecture
    Hub
  • JWT Auth Flow
  • Refresh Token Rotation
    Mutex
  • RBAC Permission Matrix
    Roles
  • Expiry Simulation
  • Clock Skew Drift
  • Password Recovery Loop
  • Dual-Mode Sandboxing
  • GraphiQL IDE
    IDE
  • Relational Queries
  • Stateful Mutations
  • Realtime Subscriptions
  • Overview & Flowcharts
    Hub
  • Hosted Checkout
    Stripe
  • Payment Intents API
  • 3DS Challenge Modal
    Modal
  • Customers Vault
  • Charges & Refunds
  • Test Cards Catalog
  • Overview & Channels
    Hub
  • Virtual Email Mailbox
    Mailtrap
  • Virtual SMS Terminal
    Phone
  • In-App Notifications
  • Message Dispatcher
  • Realtime Studio
    Studio
  • Native WebSocket (/ws)
  • Socket.io Gateway
  • Presence & Echo Bot
  • Server-Sent Events (SSE)
    SSE
  • Analytics Telemetry
  • Webhook Subscriptions
  • HMAC SHA-256 Signatures
  • Delivery Logs
  • Manual Retry Simulator
  • Network Latency Delay
  • HTTP Status Codes
  • Rate-Limit Simulator
    429
  • Flaky Network & Jitter
    Chaos
  • Session Quotas & Activity
  • JSON Snapshots
    JSON
  • Headless CI/CD Testing
    CI
  • Mobile QR Code Sync
  • System Metrics & Health
  • Atomic Sandbox Reset
  • Official TypeScript SDK
  • Multi-Language Generators
  • DevTools Extension
  • OpenAPI 3.1 Spec
    JSON
  • Postman Collection v2.1
  • Bruno Collection
  • Insomnia Workspace
  • TypeScript .d.ts
    .d.ts
  • AI Prompt Rules
    Rules
  • Context Index (llms.txt)
  • Full Schema (llms-full.txt)
  • Manifest (product.json)
  • All Feature Articles
    Blog
  • React CRUD Without Backend
    Deep Dive
  • Why Static APIs Fail
  • Mocking Stateful Auth
  • WebSockets & SSE Guide
Technical Blog
Articles

In-depth articles explaining stateful mock APIs, WebSockets, payments, and frontend resilience.

Read Articles
PreviousRealtime Subscriptions
NextHosted Checkout
Commerce & Billing Engine

Mock Commerce & Billing Architecture

An enterprise-grade, Stripe-compatible billing sandbox supporting multi-step Payment Intent state transitions, 3D Secure modal challenges, deterministic test cards, idempotency protection, and automatic invoice receipt dispatch.

Test Cards

14+

Deterministic outcomes
State Machine

6 Stages

requires_action, capture, etc.
3DS Support

PSD2 / SCA

Simulated challenge modal
Receipts

Auto Email

Integrated sandbox mailbox
Payment Intent Lifecycle & 3D Secure (SCA) State Machine
Billing Lifecycle
Playground API Payment Intent Lifecycle and 3D Secure State Machine Workflow Diagram
Click to expand full architecture
Multi-stage checkout flow: Intent creation, requires_payment_method, dynamic 3DS challenge step-up, and automated webhook capture.Interactive High-Resolution Flowchart
1Intent Init

Payment Intent Creation

Client initiates checkout with amount and currency, receiving a client secret.

2PSD2 / SCA

3DS SCA Challenge

Test cards trigger requires_action status with simulated biometric/OTP modals.

3Fulfillment

Capture & Webhook Fulfillment

Funds captured into merchant balance and payment_intent.succeeded webhook dispatched.

Commerce & Billing Subsystems

Choose a focused module to explore interactive simulators, request consoles, and production code recipes:

Stripe API

Payment Intents API

The asynchronous payment lifecycle state machine. Create client secrets, attach payment methods, inspect payment errors, and test two-step authorization & capture.

Primary Endpoint:
POST /api/v1/payments/intents
14+ Cards

Deterministic Test Cards

Instant success, insufficient funds, expired cards, incorrect CVC, stolen cards, and velocity limits. Includes dynamic date and CVC evaluations without mock setup.

Primary Endpoint:
POST /api/v1/payments/charge
PSD2 / SCA

3D Secure & SCA Challenge

Simulate Strong Customer Authentication (SCA). Handles requires_action status, redirect_to_url challenges, biometric/OTP modals, and post-challenge completion.

Primary Endpoint:
POST /api/v1/payments/intents/:id/confirm-3ds
Pre-built UI

Hosted Checkout Sessions

Pre-built Stripe Checkout redirect workflows. Model multi-item carts, quantity multipliers, success and cancel callback URLs, and session fulfillment webhooks.

Primary Endpoint:
POST /api/v1/checkout/sessions
Idempotent

Charges & Partial Refunds

Single-step legacy charges, full amount refunds, and incremental partial refunds. Enforces balance caps, reason logging, and Idempotency-Key duplicate guards.

Primary Endpoint:
POST /api/v1/payments/charge
Tokenization

Customers & Vault

Persist customer profiles, track transaction history, and attach reusable payment method tokens for recurring SaaS subscription simulations.

Primary Endpoint:
POST /api/v1/customers

Payment Intent Asynchronous Lifecycle

How status moves through creation, card confirmation, 3DS challenge action, delayed capture, and success.

STAGE 1

requires_payment_method

Intent created with amount and currency. A client_secret is returned for safe frontend form handling.

STAGE 2 (CONDITIONAL)

requires_action (3DS)

Triggered if the card requires step-up authentication. Contains next_action.redirect_to_url for modal verification.

STAGE 3 (OPTIONAL)

requires_capture

When capture_method: 'manual' is used, funds are authorized and held until explicitly captured by your server.

TERMINAL

succeeded

Payment is fully charged. Webhook payment_intent.succeeded is triggered and receipt email is dispatched.

Billing Integration Strategies Compared

Compare integration approaches to choose the right architecture for your checkout flow:

Evaluation DimensionHosted CheckoutPayment Intents APIDirect 1-Step Charge
Recommended Use CaseSaaS self-serve upgrades, quick checkoutsCustom in-app checkout forms, Stripe ElementsBackend-to-backend migrations, batch jobs
PCI Compliance ScopeSAQ A (Zero card data touches your servers)SAQ A-EP (Tokenized by client SDK)Requires tokenization or backend proxying
3D Secure (SCA) HandlingHandled automatically within checkout redirectDynamic requires_action step-up flowNot supported (Immediate failure if 3DS card)
Authorization & Delayed CaptureAutomatic capture upon checkout completionSupported (capture_method: manual)Automatic 1-step capture only
Client Secret TokenizationSession ID URL redirectpi_test_..._secret_... for browser SDKsDirect card payload submission

Currency & Amount Conventions

All amounts must be passed in the smallest currency unit (e.g. cents for USD, pence for GBP).

amount: 2900, currency: 'usd' → $29.00 USD

amount: 4950, currency: 'eur' → €49.50 EUR

amount: 1000, currency: 'jpy' → ¥1,000 JPY (zero-decimal)

Idempotency & Replay Protection

Pass an Idempotency-Key: <uuid> header on payment confirmations or direct charges. Repeated requests return cached results with an Idempotent-Replay: true response header.

Idempotency-Key: 7b34f2d1-98a0-4b8c-b01e-c2f689e4719b