Stripe CLI Cheat Sheet

Core Stripe CLI commands for login, auth, help, webhooks, testing, logs, and common resource operations.

View
StandardDetailedCompact
Export
Copy the compact sheet, download it, or print it.
Download
`D` dense toggle · `C` copy all
## Install, Authenticate, and Help
Show CLI version
stripe version

# Print the installed Stripe CLI version.

Show top-level help
stripe help

# List top-level commands and global flags.

Show help for a specific command
stripe listen --help

# Inspect a command or resource-specific subcommand.

Log in with the browser flow
stripe login

# Authenticate the CLI with your Stripe account.

Log out the CLI
stripe logout

# Remove the current CLI session.

List current config
stripe config --list

# Display account context and config values.

Run a command in live mode
stripe customers list --live

# Target your live Stripe account explicitly.

Use an explicit API key
stripe customers list --api-key sk_test_xxx

# Override the configured account with a supplied API key.

Use a named profile
stripe customers list --profile my-sandbox

# Run a command using a configured Stripe CLI profile.

Call an explicit Stripe API version
stripe products create --name="My Product" --stripe-version 2026-02-25.clover

# Override the API version for a single request.

Call the latest API version
stripe products create --name="My Product" --latest

# Test a request against the latest available API version.

## Core CLI Usage Patterns
List resources with a limit
stripe customers list --limit 5

# Limit the number of returned objects.

Expand nested objects in the response
stripe subscriptions list --expand data.customer

# Request expanded objects directly from Stripe.

Pipe JSON output to jq
stripe customers list --limit 3 | jq ".data[] | {id, email}"

# Extract specific fields from a CLI response.

Send an idempotency key
stripe payment_intents create --amount 5000 --currency usd --idempotency-key order_123

# Protect retried write requests from duplication.

Attach metadata when creating resources
stripe customers create --name "Ada Lovelace" --metadata team=backend --metadata source=cli

# Store key-value metadata on supported objects.

Expand multiple nested objects
stripe checkout sessions retrieve cs_test_123 --expand payment_intent --expand customer

# Return several expanded fields in one request.

Send a raw GET request
stripe get /v1/customers/cus_123

# Call an arbitrary Stripe API endpoint directly.

Send a raw POST request
stripe post /v1/customers -d email=ada@example.com -d name="Ada Lovelace"

# Call an arbitrary POST endpoint directly from the CLI.

Send a raw DELETE request
stripe delete /v1/webhook_endpoints/we_123

# Delete or deactivate supported resources with a raw request.

Use autocomplete-friendly resource help
stripe customers --help

# Discover the resource namespace before drilling into subcommands.

## Webhooks, Event Testing, and Logs
Forward webhook events to local development
stripe listen --forward-to localhost:4242/webhooks

# Listen for Stripe events and forward them to a local endpoint.

Forward only selected event types
stripe listen --events payment_intent.created,checkout.session.completed,charge.failed --forward-to localhost:4242/webhooks

# Filter forwarded events to a focused set of names.

Skip TLS verification for local endpoints
stripe listen --skip-verify --forward-to https://localhost:3000/api/webhooks/stripe

# Disable HTTPS certificate verification when testing locally.

Reuse a registered webhook endpoint config
stripe listen --load-from-webhooks-api --forward-to localhost:3000

# Load event configuration from a Stripe-registered endpoint and forward locally.

Trigger a Checkout completion fixture
stripe trigger checkout.session.completed

# Create the object graph for checkout.session.completed testing.

Trigger a successful payment intent flow
stripe trigger payment_intent.succeeded

# Fire a payment_intent.succeeded fixture.

List triggerable events for a category
stripe trigger checkout --help

# Inspect the available fixtures for a Stripe surface.

Tail real-time API request logs
stripe logs tail

# Stream API request logs from Stripe to your terminal.

Tail logs and filter in your shell
stripe logs tail | jq "select(.status >= 400)"

# Use jq to watch only error conditions.

List recent events
stripe events list --limit 10

# Inspect events recorded in your account.

Retrieve a specific event
stripe events retrieve evt_123

# View the payload for one event identifier.

## Resource CRUD Patterns
Create a customer
stripe customers create --name "Ada Lovelace" --email ada@example.com

# Create a basic customer directly from the CLI.

List customers
stripe customers list --limit 10

# List recent customers in your account.

Retrieve a customer
stripe customers retrieve cus_123

# Fetch a single customer by ID.

Update a customer
stripe customers update cus_123 --email new@example.com --metadata plan=pro

# Modify customer fields such as email or metadata.

Delete a customer
stripe customers delete cus_123

# Delete a customer object in test mode.

Create a product
stripe products create --name "Starter Plan" --description "Created with Stripe CLI"

# Create a one-time or recurring product entry.

Create a one-time price
stripe prices create --unit-amount 3000 --currency usd --product prod_123

# Attach a price to a product.

Create a recurring monthly price
stripe prices create --unit-amount 1500 --currency usd --product prod_123 --recurring interval=month

# Attach a monthly recurring price to a product.

Create a payment intent
stripe payment_intents create --amount 5000 --currency usd

# Create a test payment intent from the terminal.

Confirm a payment intent
stripe payment_intents confirm pi_123

# Confirm an existing payment intent if your flow requires it.

Create a refund
stripe refunds create --payment-intent pi_123

# Refund a successful charge or payment intent.

Create a Checkout Session
stripe checkout sessions create --mode payment --success-url https://example.com/success --cancel-url https://example.com/cancel --line-items price=price_123,quantity=1

# Generate a hosted Checkout session for a price.

Recommended next

No recommendations yet.