# Stripe CLI
> Test and manage Stripe integrations from the terminal

## Summary
Test and manage Stripe payment integrations from the terminal. Forward webhooks to localhost, trigger test events, tail API logs, and manage Stripe resources like customers, subscriptions, and invoices.

## Capabilities
- Forward webhook events to a local development server
- Trigger specific webhook test events
- Tail real-time API request logs
- Create and manage Stripe resources (customers, products, prices)
- Test payment flows without a running frontend
- View and resend past webhook events

## When to Use
- Developing and testing Stripe payment integrations locally
- Need to receive Stripe webhooks on localhost during development
- Debugging failed webhook deliveries or API calls
- Creating test data for Stripe integrations

## When NOT to Use
- Production Stripe operations (use the Dashboard for critical actions)
- Not using Stripe for payments (use provider-specific tools)
- Automated production billing scripts (use the Stripe API directly)

## Key Flags
- `listen`: Forward webhook events to a local endpoint
- `trigger`: Trigger a specific webhook event for testing
- `logs tail`: Stream real-time API request and response logs
- `resources`: Interact with Stripe API resources directly
- `--forward-to`: Specify the local URL to forward webhooks to

## Usage Patterns
### Forward webhooks to local server
```
stripe listen --forward-to localhost:3000/api/webhooks
```
Forwards all Stripe webhook events to the local development server

### Trigger a test event
```
stripe trigger payment_intent.succeeded
```
Creates a test PaymentIntent and fires the succeeded webhook event

### Tail API logs
```
stripe logs tail
```
Streams real-time API request and response logs from Stripe

### Create a test customer
```
stripe customers create --email test@example.com --name 'Test User'
```
Creates a new customer in the Stripe test environment

## Input / Output
- **stdin**: Not typically used
- **stdout**: Webhook events, API logs, and resource details

## Installation
- **homebrew**: `brew install stripe/stripe-cli/stripe`

## Related Tools
- [httpie](/tools/httpie) (complementary): HTTPie for general API testing; Stripe CLI is Stripe-specific with auth built in
- [jq](/tools/jq) (complementary): jq processes the JSON output from Stripe CLI commands

---
Source: https://littlescripts.sh/tools/stripe-cli
