Skip to content
Create account
or
Sign in
The Stripe Docs logo
/
Ask AI
Create account
Sign in
Get started
Payments
Finance automation
Platforms and marketplaces
Money management
Developer tools
Get started
Payments
Finance automation
Get started
Payments
Finance automation
Platforms and marketplaces
Money management
Overview
Versioning
Changelog
Upgrade your API version
Upgrade your SDK version
Developer tools
SDKs
API
Testing
Workbench
Event Destinations
Workflows
Stripe CLI
    Overview
    Get started
    Autocompletion
    CLI keys
    Trigger events
    Upgrade
    Reference
Stripe Shell
Developers Dashboard
Agent toolkit
Stripe health alertsBuild with LLMsStripe for Visual Studio CodeFile uploads
Security
Security
Extend Stripe
Stripe Apps
Stripe Connectors
Partners
Partner ecosystem
Partner certification
HomeDeveloper toolsStripe CLI

Stripe CLI

Manage your Stripe resources in a sandbox directly from the command line.

Copy page

The Stripe CLI is a developer tool to help you build, test, and manage your integration with Stripe directly from the command line. With the Stripe CLI, it’s easy to perform many common tasks like calling Stripe APIs, testing your webhooks integration, and creating an application.

Start with a guide

Get started with the Stripe CLI

Install the Stripe CLI on macOS, Windows, and Linux and get started with a YouTube video from Developer Advocacy.

Enable autocompletion for the Stripe CLI

Enable autocompletion so that the Stripe CLI automatically completes your commands.

Stripe CLI keys and permissions

Learn about Stripe CLI keys, where they’re stored locally, and where to find their permissions.

Upgrade the Stripe CLI

Take advantage of the latest features of the Stripe CLI.

Reference guides

Use these reference guides to explore the CLI and Stripe APIs.

Log into Stripe to authenticate requests

Log in and authenticate your Stripe user account to generate a set of restricted keys. To learn more, see Stripe CLI keys and permissions.

Command Line
stripe login

Press the Enter key on your keyboard to complete the authentication process in your browser.

Output
Your pairing code is: enjoy-enough-outwit-win This pairing code verifies your authentication with Stripe. Press Enter to open the browser or visit https://dashboard.stripe.com/stripecli/confirm_auth?t=THQdJfL3x12udFkNorJL8OF1iFlN8Az1 (^C to quit)

Specify an API version while running requests

When you call Stripe APIs in the CLI, it uses your default API version in all requests, which you can identify in Workbench. To try out different API versions in the CLI, use the following flags:

FlagDescriptionExample
–stripe-version 2025-04-30.basilUse the --stripe-version flag in any CLI request to specify an API version.stripe products create --name=“My Product” --stripe-version 2025-04-30.basil
--latestUse the --latest flag in any CLI request to specify the latest API version.stripe products create --name="My Product" --latest

You can also view a list of API versions.

Stream request logs

Use the stripe logs tail command to stream API request logs. Keep this window open. If you have an error in your API calls, this terminal returns the API error message and a reason for the error.

Command Line
stripe logs tail

Forward events to your local webhook endpoint

Use the --forward-to flag to send all Stripe events in a sandbox to your local webhook endpoint. To disable HTTPS certificate verification, use the --skip-verify flag.

Command Line
stripe listen --forward-to localhost:4242/webhooks
Output
Ready! Your webhook signing secret is '{{WEBHOOK_SIGNING_SECRET}}' (^C to quit)

To forward specific events in a comma separated list, use the --events flag.

Command Line
stripe listen --events payment_intent.created,customer.created,payment_intent.succeeded,charge.succeeded,checkout.session.completed,charge.failed \ --forward-to localhost:4242/webhook

If you’ve already registered your endpoint in Stripe, you can use the --load-from-webhooks-api and --forward-to flags.

Command Line
stripe listen --load-from-webhooks-api --forward-to localhost:4242

This command forwards events sent to your Stripe-registered public webhook endpoint to your local webhook endpoint. It loads your registered endpoint, parses the path and its registered events, then appends the path to your local webhook endpoint in the --forward-to path. If you’re checking webhook signatures, use the {{WEBHOOK_SIGNING_SECRET}} from the initial output of the listen command.

List all available events

Use the –help flag to list all possible events that can occur for an event category. For example, to list all possible events for the prebuilt checkout page for Stripe Checkout:

Command Line
stripe trigger checkout --help

Create a one-time product and price

  1. Make a single API request to Create a product.
Command Line
stripe products create \ --name="My First Product" \ --description="Created with the Stripe CLI"
  1. Look for the product identifier (in id) in the response object. Save it for the next step.

If everything worked, the command-line displays the following response.

{ "id":
"prod_LTenIrmp8Q67sa"
, "object": "product",
  1. Call Create a price to attach a price of 30 USD. Swap the placeholder in product with your product identifier (for example, prod_LTenIrmp8Q67sa).
Command Line
stripe prices create \ --unit-amount=3000 \ --currency=usd \ --product=
{{PRODUCT_ID}}

If everything worked, the command-line displays the following response.

{ "id":
"price_1KzlAMJJDeE9fu01WMJJr79o"
, "object": "price",

Trigger a webhook event while testing

Trigger the checkout.session.completed event to create the API objects that result from a checkout session successfully completing.

Command Line
stripe trigger checkout.session.completed

Your stripe listen terminal displays the following output:

Command Line
Setting up fixture for: checkout_session Running fixture for: checkout_session Setting up fixture for: payment_page Running fixture for: payment_page Setting up fixture for: payment_method Running fixture for: payment_method Setting up fixture for: payment_page_confirm Running fixture for: payment_page_confirm Trigger succeeded!

To learn more about triggers, read our guide.

Was this page helpful?
YesNo
Need help? Contact Support.
Join our early access program.
Check out our changelog.
Questions? Contact Sales.
LLM? Read llms.txt.
Powered by Markdoc