## Stripe Samples

[Stripe Samples](https://stripe.dev/samples) are complete examples that make it easy to get started with a new Stripe integration. Samples are available for different integration patterns, languages, and frameworks.

The Stripe CLI allows you to download, build, and serve samples to a local directory from your command line.

## samples create

Create a local copy of a sample, choosing which integration pattern and
programming language to use for the client and server. The configuration is
automatically bootstrapped when possible.

**Command:** `stripe samples create`

### Arguments

- `<sample>`
  Name of the sample used to create a local copy.

- `<path>`
  Destination path for the created sample.

### Flags

- `--force-refresh`
  Force a refresh of the cached list of Stripe Samples.

### Examples

**Create a local copy of a sample**

```sh
stripe samples create accept-a-payment
```

**Specify a destination path**

```sh
stripe samples create accept-a-payment ./accept-a-payment-sample
```

## samples list

A list of available [Stripe Samples](https://stripe.dev/samples) that can be
created and bootstrapped by the CLI.

> See the complete list of [Stripe Samples](https://stripe.dev/samples).

**Command:** `stripe samples list`

### Examples

**List available Stripe Samples**

```sh
stripe samples list
```

```
A list of available Stripe Samples:

accept-a-payment
Learn how to accept a payment
Repo: https://github.com/stripe-samples/accept-a-payment

card-brand-choice
Supporting Card Brand Choice with Stripe.
Repo: https://github.com/stripe-samples/card-brand-choice

charging-a-saved-card
Learn how to charge a saved card
Repo: https://github.com/stripe-samples/charging-a-saved-card
...
```

## serve

Start an HTTP server to serve static files. By default, the current working directory will be used.

This command works well alongside [Stripe Samples](https://stripe.dev/samples),
so you can easily serve files from any local copy of a Sample.

**Command:** `stripe serve`

### Arguments

- `<base_path>`
  Path of the directory to serve files from.

### Flags

- `--port <port_number>`
  Port the HTTP server should use.

### Examples

**Basic Usage**

```sh
stripe serve ./sales-tax-sample
```

```
Starting stripe server at address http://localhost:4242
::1 - - [28/Jan/2022:14:00:00 -0800] "GET / HTTP/1.1" 200 175
...
```
