PostHog Handbook Library / Engineering

381 words. Estimated reading time: 2 min.

# Merch store development

> Read this primer on how our merch store works.

### Adding new products

Products need to be first created in Brilliant, then added to Shopify.

#### Create the product in Brilliant

Brilliant handles adding products in inventory. Once the product appears in inventory, it needs to be linked to the product in Shopify.

After the product is created, you'll need to find the `variant_id`. If the product has no variants (ie: a sticker), you'll only need to enter one `variant_id` to Shopify. If the product has variants (ie: a t-shirt with sizes like S, M, L, etc.), you'll need to enter one `variant_id` per variant.

To find the `variant_id`, click Download CSV from the inventory page.

#### Create the product in Shopify

1. Give the product a name
2. Description appears when the product sidebar is opened
3. Add photos
4. Set the product category
5. Set the product status to Active
6. For sales channels, make sure it's available in Shop, Headless PostHog Merch Store, and Shopify GraphQL API.
7. Set the price
8. Uncheck Track quantity as this is handled through the Brilliant API.
9. Under Metafields, add a Product subtitle. This appears in the index view for the product.
10. Save the product

#### Link the product to Brilliant

1. Reference the CSV downloaded from Brilliant and look for the `variant_id` column.

- For single variant products, find the Variant metafields section and enter it in the `BrilliantID` field.
- For multi-variant products, first create the variants and save the product. Then click into the variant, scroll to the Metafields section and enter the `BrilliantID` from the CSV. Do this for each variant, as the `variant_id` will be unique for each variant.

1. Add the product to the Home page collection.
2. Save the product
3. Note: the website needs to be rebuilt for the product to appear. Run the `/rebuild-website` command in Slack. The site is typically rebuilt within 20 minutes.

### Running the merch store locally

You'll need to set environment variables to source products from Shopify and build the merch store.

    SHOPIFY_APP_PASSWORD=
    GATSBY_SHOPIFY_STOREFRONT_TOKEN=

We don't include these by default as sourcing the products from Shopify takes an absurd amount of time. Ask the if you need these values.

Canonical URL: https://posthog.com/handbook/engineering/posthog-com/merch-store

GitHub source: contents/handbook/engineering/posthog-com/merch-store.mdx

Content hash: `08b257231db6a9c0`

Static reader notes

- `MDX_COMPONENT_STATIC_ADAPTER`: Adapted interactive MDX components for static reading: SmallTeam.