> ## Documentation Index
> Fetch the complete documentation index at: https://openloop.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Product & Price IDs

> Canonical vs. provider IDs for Products and Prices, and how to chain them together

## Two IDs, two purposes

Every product and price carries two different identifiers:

> [card] Canonical ID
>
> The `id` field. Assigned by OpenLoop. **This is what `GET /products/{product_id}` and `GET /prices/{price_id}` expect.**

> [card] Provider ID
>
> The `provider_product_id` / `provider_price_id` field. Assigned by the payment provider (e.g. a Stripe `prod_...` or `price_...` id). **Required at checkout:** `POST /v0.1/checkouts/sessions` takes `provider_price_id` (not the canonical `id`). It is not accepted by the single-resource lookup endpoints below, which return a `404` for it.

> [!WARNING]
>
> `GET /products/{product_id}` and `GET /prices/{price_id}` only accept the canonical `id`. If you have a `provider_product_id` or `provider_price_id` from elsewhere (a webhook payload, a provider dashboard), look the resource up by its canonical `id` instead — there is no lookup-by-provider-id endpoint for Products or Prices on the Partners API.

## Workflow: from a product's price reference to full price detail

A product's `current_price_id` is already the canonical price ID — pass it straight to Get Price, no lookup step in between.

**1. List products**

```bash cURL theme={null}
curl --request GET \
  --url 'https://api.openloophealth.com/v0.1/products' \
  --header 'Authorization: Bearer <access_token>'
```

Each item carries its own canonical `current_price_id`:

```json theme={null}
{
  "items": [
    {
      "id": "01M0WJ8KBZ3TV8J1VHPHPQRY95",
      "provider_product_id": "test_provider_product_id",
      "name": "MWL Monthly Subscription",
      "current_price_id": "01M0WJ8KXS1QGWPJGMCS5C8TZJ",
      "...": "..."
    }
  ]
}
```

**2. Fetch that price directly**

```bash cURL theme={null}
curl --request GET \
  --url 'https://api.openloophealth.com/v0.1/prices/01M0WJ8KXS1QGWPJGMCS5C8TZJ' \
  --header 'Authorization: Bearer <access_token>'
```

```json theme={null}
{
  "data": {
    "id": "01M0WJ8KXS1QGWPJGMCS5C8TZJ",
    "provider_price_id": "test_provider_price_id",
    "product_id": "01M0WJ8KBZ3TV8J1VHPHPQRY95",
    "amount_cents": 9999,
    "currency": "USD",
    "billing_interval": "month",
    "...": "..."
  }
}
```

No search step needed — the `current_price_id` from step 1 *is* the `price_id` this endpoint expects.

## Workflow: from a list to one specific product

The same canonical `id` that identifies a product in a list response is what `GET /products/{product_id}` expects.

**1. List products**

```bash cURL theme={null}
curl --request GET \
  --url 'https://api.openloophealth.com/v0.1/products' \
  --header 'Authorization: Bearer <access_token>'
```

```json theme={null}
{
  "items": [
    {
      "id": "01M0WJ8KBZ3TV8J1VHPHPQRY95",
      "provider_product_id": "test_provider_product_id",
      "name": "MWL Monthly Subscription",
      "...": "..."
    }
  ]
}
```

**2. Fetch that one product's full detail**

Take the canonical `id` of the product you want — not `provider_product_id` — and call Get Product with it:

```bash cURL theme={null}
curl --request GET \
  --url 'https://api.openloophealth.com/v0.1/products/01M0WJ8KBZ3TV8J1VHPHPQRY95' \
  --header 'Authorization: Bearer <access_token>'
```

```json theme={null}
{
  "data": {
    "id": "01M0WJ8KBZ3TV8J1VHPHPQRY95",
    "provider_product_id": "test_provider_product_id",
    "name": "MWL Monthly Subscription",
    "current_price_id": "01M0WJ8KXS1QGWPJGMCS5C8TZJ",
    "prices": [
      {
        "id": "01M0WJ8KXS1QGWPJGMCS5C8TZJ",
        "amount_cents": 9999,
        "currency": "USD",
        "...": "..."
      }
    ],
    "...": "..."
  }
}
```

Get Product also returns the full `prices` array for that product, each with its own canonical `id` — usable the same way with Get Price.

Using `provider_product_id` or `provider_price_id` in either single-resource call above returns a `404` — those fields identify the resource at the payment provider, not within OpenLoop's own catalog.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.