# Stripe CLI: Resources and HTTP Commands

The Stripe CLI offers two primary ways to interact with Stripe API resources: **resource commands** and **HTTP commands**.

## Resources

Resource commands allow you to directly manage API resources through the CLI. Each resource command is tailored with specific arguments, flags, and functionality relevant to the API resource it interacts with.

The Stripe CLI provides commands to interact with all Stripe API resources. For a comprehensive list and examples, refer to the [API Reference Guide](https://docs.stripe.com/api.md). When viewing the API Reference, select "Stripe CLI" from the language dropdown to see CLI-specific examples for each resource.

You can discover the available operations for any resource by using the `help` command. For instance, running `stripe customers --help` will display the operations available for the Customers resource. To see a complete list of all available resources, use the `stripe resources` command.

**Note:** All commands support making live requests by including the `--live` flag.

**Command:** `stripe {resource command}`

### Arguments

*   **`<operation>`**: The action to perform on the API object. Each resource type supports a set of operations such as `create`, `delete`, `list`, and `retrieve`.

### Flags

*   **`--param=value`**: Parameters to be attached to the operation.
*   **`-d, --data <data>`**: Additional data to send with an API request. This flag supports setting nested values (e.g., `nested[param]=value`).

### Examples

**Listing supported operations for a resource:**

```sh
stripe customers --help
```

This will output available operations like:

```
Available Operations:
  create
  delete
  list
  ...
```

**Creating a resource:**

```sh
stripe customers create \
  --email=billing@example.com \
  --name="Jenny Rosen" \
  --description="My First Test Customer"
```

**Updating a resource:**

```sh
stripe customers update cus_9s6XKzkNRiz8i3 \
  -d "metadata[key]=value"
```

**Retrieving a resource:**

```sh
stripe customers retrieve cus_9s6XKzkNRiz8i3
```

## HTTP Commands

HTTP commands provide a convenient shorthand for making HTTP requests directly to the Stripe API. These commands can be used to operate on individual API objects or lists of objects.

## Resources & HTTP Commands

The Stripe CLI supports two ways to create, update, and list objects based on API resources: resource commands and HTTP commands.

**Resource commands** directly manage API resources and provide different arguments, flags, and functionality based on which API resource is used.

**HTTP commands** are convenient shorthand for HTTP requests to the Stripe API. These requests can operate on individual API objects or lists of objects.

## resources

Resource commands make API requests using the CLI for a given resource. The Stripe CLI has commands to interact with all types of Stripe API resources. A complete list of available resources and examples are included in the [API Reference Guide](https://docs.stripe.com/api.md). Select **Stripe CLI** from the language dropdown to see a complete example for each resource. Use the `help` command on any resource to see what operations you can perform. For example, run `stripe customers --help` to see help for the [Customers](https://docs.stripe.com/api/customers.md) resource. Use `stripe resources` to see a complete list of available resources.

> All commands support making live requests with the `--live` flag.

**Command:** `stripe {resource command}`

### Arguments

*   `` Operation to perform on API object. Each type of API resource includes a set of operations that you can perform (such as `delete`, `list`, and `retrieve`).

### Flags

*   `--param=value` Parameters to attach to the operation being performed.
*   `-d, --data ` Additional data to send with an API request. Supports setting nested values (e.g `nested[param]=value`).

### Examples

**Listing supported operations**

```sh
stripe customers --help
```

```
Available Operations: create delete list ...
```

**Create a resource**

```sh
stripe customers create \
--email=billing@example.com \
--name="Jenny Rosen" \
--description="My First Test Customer"
```

**Update a resource**

```sh
stripe customers update cus_9s6XKzkNRiz8i3 \
-d "metadata[key]=value"
```

**Retrieve a resource**

```sh
stripe customers retrieve cus_9s6XKzkNRiz8i3
```

**Response**

```json
{
  "id": "cus_9s6XKzkNRiz8i3",
  "object": "customer",
  "address": null,
  "balance": 0,
  "created": 1680893993,
  "currency": null,
  "default_source": null,
  "delinquent": false,
  "description": "My First Test Customer",
  "discount": null,
  "email": "billing@example.com",
  "invoice_prefix": "0759376C",
  "invoice_settings": {
    "custom_fields": null,
    "default_payment_method": null,
    "footer": null,
    "rendering_options": null
  },
  "livemode": false,
  "metadata": {},
  "name": "Jenny Rosen",
  "next_invoice_sequence": 1,
  "phone": null,
  "preferred_locales": [],
  "shipping": null,
  "tax_exempt": "none",
  "test_clock": null
}
```