# List all subscription items

Returns a list of your subscription items for a given subscription.

## Prerequisites

Before you can run the following code snippet, you need to call these APIs with the provided parameters to set up the prerequisite API object(s).

1. Create a payment method
POST /v1/payment_methods {"type":"card","card":{"token":"tok_visa"}}
2. Create a customer and attach the payment method
POST /v1/customers {"name":"Jenny Rosen","email":"jennyrosen@example.com","payment_method":"${node.prerequisites.createPaymentMethod.createPaymentMethod:id}","invoice_settings":{"default_payment_method":"${node.prerequisites.createPaymentMethod.createPaymentMethod:id}"}}
3. Create a product
POST /v1/products {"name":"Gold Plan"}
4. Create a price
POST /v1/prices {"product":"${node.prerequisites.createProduct.createProduct:id}","unit_amount":2000,"currency":"usd","recurring":{"interval":"month"}}
5. Create a subscription
POST /v1/subscriptions {"customer":"${node.prerequisites.createCustomer.createCustomer:id}","items":[{"price":"${node.prerequisites.createPrice.createPrice:id}"}]}

## Request

```curl
curl -G https://api.stripe.com/v1/subscription_items \
  -u "<<YOUR_SECRET_KEY>>" \
  -d limit=3 \
  -d subscription={{SUBSCRIPTION_ID}}
```

### Response

```json
{
  "object": "list",
  "url": "/v1/subscription_items",
  "has_more": false,
  "data": [
    {
      "id": "si_OCgWsGlqpbN4EP",
      "object": "subscription_item",
      "created": 1688507587,
      "metadata": {},
      "price": {
        "id": "price_1NQH9iLkdIwHu7ix3tkaSxhj",
        "object": "price",
        "active": true,
        "billing_scheme": "per_unit",
        "created": 1688507586,
        "currency": "usd",
        "custom_unit_amount": null,
        "livemode": false,
        "lookup_key": null,
        "metadata": {},
        "nickname": null,
        "product": "prod_OCgWE6cbwiSu27",
        "recurring": {
          "interval": "month",
          "interval_count": 1,
          "trial_period_days": null,
          "usage_type": "licensed"
        },
        "tax_behavior": "unspecified",
        "tiers_mode": null,
        "transform_quantity": null,
        "type": "recurring",
        "unit_amount": 1000,
        "unit_amount_decimal": "1000"
      },
      "quantity": 1,
      "subscription": "sub_1NQH9iLkdIwHu7ixxhHui9yi",
      "tax_rates": []
    }
  ]
}
```

## Returns

A dictionary with a `data` property that contains an array of up to `limit` subscription items, starting after subscription item `starting_after`. Each entry in the array is a separate subscription item object. If no more subscription items are available, the resulting array will be empty.

## Parameters

- `subscription` (string, required)
  The ID of the subscription whose items will be retrieved.

- `ending_before` (string, optional)
  A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.

- `limit` (integer, optional)
  A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.

- `starting_after` (string, optional)
  A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.
