> This page is for Developer.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.bigcommerce.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.bigcommerce.com/_mcp/server.

# Metafields and Product Reviews

Plan: Developer Foundations

Lesson 17 of 21 · 30 min

In this lesson, you will learn to add a metafield to a product, GET metafields by product ID, and understand the use cases for metafields. You'll also learn how to create and GET a product review.

So why do we use metafields?

Metafields allow a developer to set up key and value pairs to store data against a resource, like a product. The data does not appear in the storefront or the control panel by default, but can be surfaced on the storefront depending on permissions and use of GraphQL. This is useful for when information needs to be passed back and forth between an app and the store. Metafields can be added to variants, products, categories, and brands. It is another way of allowing you to tag a product with additional data; acting as an advanced custom field in a way.

## Create a Product Metafield

```http showLineNumbers={false}
POST /catalog/products/{product_id}/metafields
```

Creates a product metafield.

**Required Fields**

* `permission_set` (Determines the visibility and writeability of the field by other API consumers.)
  * `app_only` - Private to the app that owns the field
  * `read` - Visible to other API consumers
  * `write` - Open for reading and writing by other API consumers
  * `read_and_sf_access` - Visible to other API consumers, including on storefront
  * `write_and_sf_access` - Open for reading and writing by other API consumers, including on storefront
* `namespace` - Namespace for the metafield, for organizational purposes. This is set by the developer.
* `key` - The name of the field, for example: `location_id`, `color`.
* `value` - The value of the field, for example: 1, blue.

Use this same endpoint to **GET** all product metafields.

![Example Request: Create a Product Metafield](/_fern-img/20549492df968265428c9b67128303d5bb66a650435326026a6766acc2f2a9bd.webp)

![Example Response: Create a Product Metafield](/_fern-img/7dafe0eb07277871da72d4816dd48707d44d15cf33c1909e84a6f5208646c596.webp)

> **Info**
>
> Using the [GraphQL attribute](/developer/docs/storefront/stencil/themes/context/frontmatter-reference) in frontmatter is the simplest way to include product data in your Stencil storefront.

### Update a Product Metafield

```http showLineNumbers={false}
PUT /catalog/products/{product_id}/metafields/{metafield_id}
```

Updates a product metafield.

Use this same endpoint to **GET** and/or **DELETE** a product metafield.

### Product Variant Metafields

```http showLineNumbers={false}
POST /catalog/products/{product_id}/variants/{variant_id}/metafields
```

Creates a product variant metafield.

**Required Fields:**

* `permission_set`
* `namespace`
* `key`
* `value`

Use this same endpoint to **GET** Product variant metafields.

#### Example Request Body:

Variant metafields

![Example Request: Variant Metafields](/_fern-img/75ab4b468309d694b3468bf350a8575216e7545d405220336bd1f3395ecb2f1b.webp)

### Update Product Variant Metafields

```http showLineNumbers={false}
PUT /catalog/products/{product_id}/variants/{variant_id}/metafields/{metafield_id}
```

Updates a product variant metafield.

Use this same endpoint to **GET** and/or **DELETE** a variant metafield.

### Create a Brand Metafield

```http showLineNumbers={false}
POST /catalog/brands/\{brand_id\}/metafieldsCreates a brand metafield.
```

**Required Fields:**

* `permission_set`
* `namespace`
* `key`
* `value`

Use this same endpoint to **GET** brand metafields.

### Update a Brand Metafield

```http showLineNumbers={false}
PUT /catalog/brands/{brand_id}/metafields/{metafield_id}
```

Updates a brand metafield.

Use this same endpoint to **GET** and/or **DELETE** a brand metafield.

### Create a Category Metafield

```http showLineNumbers={false}
POST /catalog/categories/{category_id}/metafields
```

Creates a category metafield.

Use this same endpoint to **GET** category metafields.

### Update a Category Metafield

```http showLineNumbers={false}
PUT /catalog/categories/{category_id}/metafields/{metafield_id}
```

Updates a category metafield.

Use this same endpoint to **GET** and/or **DELETE** a category metafield.

## What about Product Reviews?

A product review contains ratings and feedback from shoppers who have purchased a product. Reviews are displayed on product pages. Reviews cannot be created in the control panel, but they can be created via API. Creating them via API is useful if you are migrating to BigCommerce from another platform and do not want to lose existing reviews. While product reviews are a native platform feature, they can be turned off in favor of a custom setup.

### GET Product Reviews

```http showLineNumbers={false}
GET /catalog/products/{product_id}/reviews
```

Returns a list of all product reviews.

#### Example Response:

GET product reviews

![Example Response: GET Product Reviews](/_fern-img/126041c60752e6c20cb9a443ee2068564386cc8dc6654623ccb4f615faa490be.webp)

### Create a Product Review

```http showLineNumbers={false}
POST /catalog/products/{product_id}/reviews
```

Creates a product review.

**Required Fields:**

* `title`
* `date_reviewed`

![Example Request: Create a Product Review](/_fern-files/bigcommerce.docs.buildwithfern.com/d96b0af422dd110d2bcc0b6b30d2c81f3f481f2bbe6543d7a9ab3c625e189ffc/assets/learn/catalog-rest-api/ReviewRequest.png)

![Example Response: Create a Product Review](/_fern-files/bigcommerce.docs.buildwithfern.com/b5ab95c9e7d974dfb31465d46fa02c24bdd236e2c0974d197d4a2313324aef81/assets/learn/catalog-rest-api/reviewResponse.png)

### Update a Product Review

```http showLineNumbers={false}
PUT /catalog/products/{product_id}/reviews/{review_id}
```

Updates a product review.

Use this same endpoint to **GET** and/or **DELETE** a product review.

## Resources

* [Product Metafields](/developer/api-reference/rest/admin/catalog/products/metafields/get-product-metafields)
* [Product Reviews](/developer/api-reference/rest/admin/catalog/products/reviews/get-product-reviews)