Accéder directement au contenu
Créez un compte
ou
connecter-vous
Logo de la documentation Stripe
/
Demander à l'assistant IA
Créez un compte
Connectez-vous
Démarrer
Paiements
Revenus
Plateformes et places de marché
Gestion de fonds
Ressources pour les développeurs
Aperçu
Gestion des versions
Journal des modifications
Mettre à niveau votre version de l'API
Actualiser votre version du SDK
Essentials
SDK
API
Tests
CLI Stripe
    Présentation
    Installer la CLI :
    Utiliser la CLI
    Activer l'autocomplétion
    Clés de l'interface de ligne de commande
    Déclencher des événements
    Mettre à niveau la CLI
Exemples de projets
Outils
Workbench
Dashboard des développeurs
Shell Stripe
Stripe pour Visual Studio Code
Fonctionnalités
Workflows
Destinations d'événements
Alertes d'intégrité de StripeChargements de fichiers
Solutions d'IA
Boîte à outils des agents
Modèle de protocole contextuel
Sécurité et confidentialité
Sécurité
Robot d'exploration Web Stripebot
Confidentialité
Extensions Stripe
Créer des applications Stripe
Utiliser les applications de Stripe
Partenaires
Partner ecosystem
Certification des partenaires
AccueilRessources pour les développeursStripe CLI

Remarque

Cette page n'est pas encore disponible dans cette langue. Nous faisons tout notre possible pour proposer notre documentation dans davantage de langues et nous vous fournirons la version traduite dès qu'elle sera disponible.

Use the Stripe CLI

Build, test, and manage your Stripe integration from the command line.

The Stripe CLI lets you build, test, and manage your Stripe integration from the command line. With the CLI, you can create and manage Stripe resources, trigger webhook events, stream real-time API request logs, and forward events to your local development environment.

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-08-27.basilUse the --stripe-version flag in any CLI request to specify an API version.stripe products create --name=“My Product” --stripe-version 2025-08-27.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 (--help) 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"
  2. 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",
  3. 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}}
  4. 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!
Cette page vous a-t-elle été utile ?
OuiNon
  • Besoin d'aide ? Contactez le service Support.
  • Rejoignez notre programme d'accès anticipé.
  • Consultez notre log des modifications.
  • Des questions ? Contactez l'équipe commerciale.
  • LLM ? Lire llms.txt.
  • Propulsé par Markdoc