> For the complete documentation index, see [llms.txt](https://updev-1.gitbook.io/cashier-for-connect/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://updev-1.gitbook.io/cashier-for-connect/subscriptions/products-and-prices.md).

# Products & Prices

## Overview

In order to use direct subscriptions which are against connected accounts. Your connected account must first have a product and price against it. This may be a fixed product that you create for the connected account, or it may be one you allow them to create themselves (via an endpoint).

Either way, they need a product and price and the below functions allow you to create those against any Stripe Connectable Model.

{% hint style="warning" %}
**Note:** The Stripe Connectable Model must have been created in stripe before products and prices are added against it. For more information see [Connected Accounts](/cashier-for-connect/setting-up-models/connected-accounts.md).
{% endhint %}

For this example we will use a store model, and the product will be a monthly warranty support product.

## Products

### Create a product

Any product data can be included in this function as outlined in the Stripe API Documentation.

[Link to stripe product create docs](https://stripe.com/docs/api/products/create)

```php
$store->createConnectedProduct([
    'name' => 'Product Warranty Support'
]);
```

### Editing a product

<pre class="language-php"><code class="lang-php"><strong>$store->editConnectedProduct($id, [
</strong>    'name' => 'New Product Name'
]);
</code></pre>

### Getting Products

#### Single Product

<pre class="language-php"><code class="lang-php"><strong>$store->getSingleConnectedProduct($id);
</strong></code></pre>

#### All products for connected account

<pre class="language-php"><code class="lang-php"><strong>$store->getAllProductsForAccount();
</strong></code></pre>

## Prices

### Create a price

A product must first exist to create a price against it. Any pricing data can be provided to this function as per the Stripe API Documentation

[Link to stripe price create docs](https://stripe.com/docs/api/prices/create)

```php
$store->createPriceForConnectedProduct($productID, [
    'unit_amount' => 2000,
    'currency' => 'gbp',
    'recurring' => ['interval' => 'month']
]);
```

### Editing a price

<pre class="language-php"><code class="lang-php"><strong>$store->editConnectedPrice($id, [
</strong>    'unit_amount' => 4000,
]);
</code></pre>

### Getting prices

#### Single Price

<pre class="language-php"><code class="lang-php"><strong>$store->getSingleConnectedPrice($priceID);
</strong></code></pre>

#### Get all prices for a product

<pre class="language-php"><code class="lang-php"><strong>$store->getPricesForConnectedProduct($productID);
</strong></code></pre>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://updev-1.gitbook.io/cashier-for-connect/subscriptions/products-and-prices.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
