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

# Shopify Lists

> Implement wishlists, gift registries, and shareable lists on Shopify using the Omneo Lists API.

This guide shows how to read a customer's Omneo lists, generate a share code for a list, and fetch a shared list using that code, from a Shopify Liquid theme or App UI Extension.

<Info>
  This guide assumes you already have an Omneo ID Proxy token. See [Shopify Authentication](/extensions/shopify/authentication) for how to obtain one.
</Info>

## Prerequisites

| Requirement     | Details                                                                                                                                              |
| --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| ID Proxy token  | Obtained from `/apps/cx` in a Liquid theme, or your Remix route in a UI Extension. See [Shopify Authentication](/extensions/shopify/authentication). |
| List Definition | At least one list definition (for example, a wishlist) configured in Omneo. See [List Definitions](/concepts/lists/list-definitions).                |
| SDK             | The `@omneo/omneo-sdk` package installed in your Shopify app or theme bundle.                                                                        |

## Initialise the SDK

Construct an `ID` client with the token, tenant, and expiry returned from the auth flow.

```javascript theme={null}
import { ID } from '@omneo/omneo-sdk'

const client = new ID({
  tenant,
  IDToken: token,
  IDTokenExpiry: expiry
})
```

All `client.profile.*` calls are scoped to the customer the token was issued for.

## Fetch a customer's lists

Return all lists associated with the logged-in profile.

```javascript theme={null}
const lists = await client.profile.lists.list()
```

`lists` is an array of list objects. Each list includes its `id`, list definition handle, items, and metadata. If the customer has no lists yet, the array is empty.

## Generate a share code

Generate a unique, shareable handle for a list by posting to its `shares` endpoint. The handle can be embedded in a URL and used by another browser to view the list.

```javascript theme={null}
const [firstList] = lists

const { data } = await client.call({
  endpoint: `/profiles/me/lists/${firstList.id}/shares`,
  method: 'POST'
})

const shareCode = data.handle
```

Each call creates a new share record. Store the returned handle if you want to render a stable shareable URL for the customer.

## Fetch a list by share code

A list opened by share code reads from the public `/lists/shares/{handle}` endpoint. This call works with an anonymous token, so recipients without an Omneo profile can still open the list.

```javascript theme={null}
const sharedList = await client.call({
  endpoint: `/lists/shares/${shareCode}`,
  method: 'GET'
})
```

## End-to-end example

```javascript theme={null}
import { ID } from '@omneo/omneo-sdk'

// token, tenant and expiry come from the auth flow
const client = new ID({
  tenant,
  IDToken: token,
  IDTokenExpiry: expiry
})

const lists = await client.profile.lists.list()
const [firstList] = lists

const { data } = await client.call({
  endpoint: `/profiles/me/lists/${firstList.id}/shares`,
  method: 'POST'
})

const shareCode = data.handle

const sharedList = await client.call({
  endpoint: `/lists/shares/${shareCode}`,
  method: 'GET'
})
```

## Further reading

<CardGroup cols={2}>
  <Card title="Lists overview" href="/concepts/lists/overview" icon="list">
    What lists are and how they work across surfaces.
  </Card>

  <Card title="List Definitions" href="/concepts/lists/list-definitions" icon="sliders">
    Configure list types and their rules.
  </Card>

  <Card title="Shopify Authentication" href="/extensions/shopify/authentication" icon="key">
    How to obtain the ID Proxy token used by this guide.
  </Card>

  <Card title="Lists API reference" href="/api-reference/product-list/overview" icon="code">
    Endpoint-level reference for lists, items, and shares.
  </Card>
</CardGroup>
