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

# .get()

> Fetch a single product

```javascript theme={null}
openbridge.products.get(idOrHandle)
openbridge.products.get(idOrHandle).select(fields)
```

Fetches a single product by handle or Shopify GID. Supports chaining `.select()` to limit fields.

## Parameters

| Param        | Type     | Required | Description           |
| ------------ | -------- | -------- | --------------------- |
| `idOrHandle` | `string` | Yes      | Product handle or GID |

### Supported formats

| Format      | Example                                 |
| ----------- | --------------------------------------- |
| Handle      | `'blue-shirt'`                          |
| Shopify GID | `'gid://shopify/Product/8834792939738'` |

## Returns

[`ShopifyProduct`](/api/types/products#shopifyproduct) `| null`

Returns `null` if product not found.

## Examples

### By handle

```javascript theme={null}
const product = await openbridge.products.get('classic-cotton-shirt')

if (product) {
    console.log(product.title)
    console.log(product.priceRange.minVariantPrice.amount)
}
```

### By GID

```javascript theme={null}
const product = await openbridge.products.get(
    'gid://shopify/Product/8834792939738'
)
```

### With field selection

```javascript theme={null}
const product = await openbridge.products
    .get('classic-cotton-shirt')
    .select(['title', 'handle', 'priceRange', 'variants', 'options'])
```

### Access variants

```javascript theme={null}
const product = await openbridge.products
    .get('classic-cotton-shirt')
    .select(['title', 'variants'])

product?.variants.forEach((variant) => {
    console.log(variant.id)
    console.log(variant.title)
    console.log(variant.price.amount)
    console.log(variant.availableForSale)
})
```

### Find specific variant

```javascript theme={null}
const product = await openbridge.products
    .get('classic-cotton-shirt')
    .select(['variants'])

const variant = product?.variants.find(
    (v) =>
        v.selectedOptions.some(
            (opt) => opt.name === 'Size' && opt.value === 'M'
        ) &&
        v.selectedOptions.some(
            (opt) => opt.name === 'Color' && opt.value === 'Blue'
        )
)

console.log(variant?.id) // Use for cart
console.log(variant?.price.amount)
```

### Access options

```javascript theme={null}
const product = await openbridge.products
    .get('classic-cotton-shirt')
    .select(['options'])

product?.options.forEach((option) => {
    console.log(option.name) // "Size", "Color"
    console.log(option.values) // ["S", "M", "L"], ["Blue", "Red"]
})
```

### Handle not found

```javascript theme={null}
const product = await openbridge.products.get('non-existent-product')

if (!product) {
    console.log('Product not found')
}
```

### Get selling plans (pre-orders)

Fetch a product's selling plans to enable pre-order or subscription purchases.

```javascript theme={null}
const product = await openbridge.products
    .get('limited-edition-sneaker')
    .select(['title', 'variants', 'sellingPlanGroups'])

// Check if product has selling plans
if (product?.sellingPlanGroups.length > 0) {
    const group = product.sellingPlanGroups[0]
    const plan = group.sellingPlans[0]

    console.log(plan.id)   // 'gid://shopify/SellingPlan/123'
    console.log(plan.name) // '$50 deposit'

    // Add to cart with selling plan
    await openbridge.cart.add(product.variants[0].id, {
        quantity: 1,
        sellingPlanId: plan.id
    })
}
```

### Display selling plan options

```javascript theme={null}
const product = await openbridge.products
    .get('subscription-box')
    .select(['sellingPlanGroups'])

product?.sellingPlanGroups.forEach((group) => {
    console.log('Group:', group.name)

    group.sellingPlans.forEach((plan) => {
        console.log('  Plan:', plan.name)
        console.log('  ID:', plan.id)

        // Checkout charge info (deposit amount)
        if (plan.checkoutCharge.type === 'PERCENTAGE') {
            console.log('  Deposit:', plan.checkoutCharge.value.percentage + '%')
        } else {
            console.log('  Deposit:', plan.checkoutCharge.value.amount?.amount)
        }
    })
})
```
