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

Bootstrap the Stripe CLI and inspect available commands.

Show CLI version

Print the installed Stripe CLI version.

bashANYversionhelpsetup
bash
stripe version
Notes

Useful when checking compatibility in CI or debugging CLI behavior.

Show top-level help

List top-level commands and global flags.

bashANYhelpsetup
bash
stripe help

Show help for a specific command

Inspect a command or resource-specific subcommand.

bashANYhelpdocs
bash
stripe listen --help

Log in with the browser flow

Authenticate the CLI with your Stripe account.

bashANYauthsetup
bash
stripe login

Log out the CLI

Remove the current CLI session.

bashANYauthsetup
bash
stripe logout

List current config

Display account context and config values.

bashANYauthconfig
bash
stripe config --list
Notes

Use this to verify which profile or account context your CLI commands will use.

Run a command in live mode

Target your live Stripe account explicitly.

bashANYmodeliveauth
bash
stripe customers list --live

Use an explicit API key

Override the configured account with a supplied API key.

bashANYauthapi-key
bash
stripe customers list --api-key sk_test_xxx

Use a named profile

Run a command using a configured Stripe CLI profile.

bashANYauthprofileconfig
bash
stripe customers list --profile my-sandbox

Call an explicit Stripe API version

Override the API version for a single request.

bashANYapi-versioncompatibility
bash
stripe products create --name="My Product" --stripe-version 2026-02-25.clover

Call the latest API version

Test a request against the latest available API version.

bashANYapi-versiontesting
bash
stripe products create --name="My Product" --latest

Core CLI Usage Patterns

Global flags, JSON output, and shell-friendly usage patterns.

List resources with a limit

Limit the number of returned objects.

bashANYlistpagination
bash
stripe customers list --limit 5

Expand nested objects in the response

Request expanded objects directly from Stripe.

bashANYexpandapi
bash
stripe subscriptions list --expand data.customer

Pipe JSON output to jq

Extract specific fields from a CLI response.

bashANYjqjsonautomation
bash
stripe customers list --limit 3 | jq ".data[] | {id, email}"

Send an idempotency key

Protect retried write requests from duplication.

bashANYidempotencypayments
bash
stripe payment_intents create --amount 5000 --currency usd --idempotency-key order_123

Attach metadata when creating resources

Store key-value metadata on supported objects.

bashANYmetadataresources
bash
stripe customers create --name "Ada Lovelace" --metadata team=backend --metadata source=cli

Expand multiple nested objects

Return several expanded fields in one request.

bashANYexpandcheckout
bash
stripe checkout sessions retrieve cs_test_123 --expand payment_intent --expand customer

Send a raw GET request

Call an arbitrary Stripe API endpoint directly.

bashANYraw-requestapi
bash
stripe get /v1/customers/cus_123

Send a raw POST request

Call an arbitrary POST endpoint directly from the CLI.

bashANYraw-requestapipost
bash
stripe post /v1/customers -d email=ada@example.com -d name="Ada Lovelace"

Send a raw DELETE request

Delete or deactivate supported resources with a raw request.

bashANYraw-requestdelete
bash
stripe delete /v1/webhook_endpoints/we_123

Use autocomplete-friendly resource help

Discover the resource namespace before drilling into subcommands.

bashANYhelpdiscoverability
bash
stripe customers --help

Webhooks, Event Testing, and Logs

Local webhook forwarding, event triggering, and streaming API request logs.

Forward webhook events to local development

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

bashANYwebhookslistenlocal-dev
bash
stripe listen --forward-to localhost:4242/webhooks

Forward only selected event types

Filter forwarded events to a focused set of names.

bashANYwebhookseventslisten
bash
stripe listen --events payment_intent.created,checkout.session.completed,charge.failed --forward-to localhost:4242/webhooks

Skip TLS verification for local endpoints

Disable HTTPS certificate verification when testing locally.

bashANYwebhookstlslocal-dev
bash
stripe listen --skip-verify --forward-to https://localhost:3000/api/webhooks/stripe

Reuse a registered webhook endpoint config

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

bashANYwebhookslistenregistered-endpoints
bash
stripe listen --load-from-webhooks-api --forward-to localhost:3000

Trigger a Checkout completion fixture

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

bashANYtriggercheckouttesting
bash
stripe trigger checkout.session.completed

Trigger a successful payment intent flow

Fire a payment_intent.succeeded fixture.

bashANYtriggerpaymentstesting
bash
stripe trigger payment_intent.succeeded

List triggerable events for a category

Inspect the available fixtures for a Stripe surface.

bashANYtriggerhelpfixtures
bash
stripe trigger checkout --help

Tail real-time API request logs

Stream API request logs from Stripe to your terminal.

bashANYlogsdebugging
bash
stripe logs tail

Tail logs and filter in your shell

Use jq to watch only error conditions.

bashANYlogsjqdebugging
bash
stripe logs tail | jq "select(.status >= 400)"

List recent events

Inspect events recorded in your account.

bashANYeventsinspect
bash
stripe events list --limit 10

Retrieve a specific event

View the payload for one event identifier.

bashANYeventsinspect
bash
stripe events retrieve evt_123

Resource CRUD Patterns

Create, list, retrieve, update, and delete common Stripe resources from the terminal.

Create a customer

Create a basic customer directly from the CLI.

bashANYcustomerscreate
bash
stripe customers create --name "Ada Lovelace" --email ada@example.com

List customers

List recent customers in your account.

bashANYcustomerslist
bash
stripe customers list --limit 10

Retrieve a customer

Fetch a single customer by ID.

bashANYcustomersretrieve
bash
stripe customers retrieve cus_123

Update a customer

Modify customer fields such as email or metadata.

bashANYcustomersupdate
bash
stripe customers update cus_123 --email new@example.com --metadata plan=pro

Delete a customer

Delete a customer object in test mode.

bashANYcustomersdelete
bash
stripe customers delete cus_123

Create a product

Create a one-time or recurring product entry.

bashANYproductscreate
bash
stripe products create --name "Starter Plan" --description "Created with Stripe CLI"

Create a one-time price

Attach a price to a product.

bashANYpricescreateproducts
bash
stripe prices create --unit-amount 3000 --currency usd --product prod_123

Create a recurring monthly price

Attach a monthly recurring price to a product.

bashANYpricessubscriptionscreate
bash
stripe prices create --unit-amount 1500 --currency usd --product prod_123 --recurring interval=month

Create a payment intent

Create a test payment intent from the terminal.

bashANYpayment-intentspaymentscreate
bash
stripe payment_intents create --amount 5000 --currency usd

Confirm a payment intent

Confirm an existing payment intent if your flow requires it.

bashANYpayment-intentsconfirm
bash
stripe payment_intents confirm pi_123

Create a refund

Refund a successful charge or payment intent.

bashANYrefundspayments
bash
stripe refunds create --payment-intent pi_123

Create a Checkout Session

Generate a hosted Checkout session for a price.

bashANYcheckoutsessionspayments
bash
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

Recommended next

No recommendations yet.