Metafields and Product Reviews
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
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 fieldread- Visible to other API consumerswrite- Open for reading and writing by other API consumersread_and_sf_access- Visible to other API consumers, including on storefrontwrite_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.


Using the GraphQL attribute in frontmatter is the simplest way to include product data in your Stencil storefront.
Update a Product Metafield
Updates a product metafield.
Use this same endpoint to GET and/or DELETE a product metafield.
Product Variant Metafields
Creates a product variant metafield.
Required Fields:
permission_setnamespacekeyvalue
Use this same endpoint to GET Product variant metafields.
Example Request Body:
Variant metafields

Update Product Variant Metafields
Updates a product variant metafield.
Use this same endpoint to GET and/or DELETE a variant metafield.
Create a Brand Metafield
Required Fields:
permission_setnamespacekeyvalue
Use this same endpoint to GET brand metafields.
Update a Brand Metafield
Updates a brand metafield.
Use this same endpoint to GET and/or DELETE a brand metafield.
Create a Category Metafield
Creates a category metafield.
Use this same endpoint to GET category metafields.
Update a Category Metafield
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
Returns a list of all product reviews.
Example Response:
GET product reviews

Create a Product Review
Creates a product review.
Required Fields:
titledate_reviewed


Update a Product Review
Updates a product review.
Use this same endpoint to GET and/or DELETE a product review.