post

/catalog/products/{product_id}/metafields

Creates a Product Metafield.

Required Fields:

  • permission_set
  • namespace
  • key
  • value

Read-Only Fields

  • id

Note: The max number of metafields allowed on each product, category, variant, or brand is fifty. For more information, see Platform Limits in the Help Center.

Authorization

apiKey - X-Auth-Token

Request Parameters

1 Path Parameter
2 Headers

Request Body

1 Example
Schema
object

Metafield for products, categories, variants, and brands. The max number of metafields allowed on each product, category, variant, or brand is fifty. For more information, see Platform Limits in the Help Center.

date_created
string

Date and time of the metafield’s creation. Read-Only.

2 validations
date_modified
string

Date and time when the metafield was last updated. Read-Only.

2 validations
description
string

Description for the metafields.

3 validations
id
integer

Unique ID of the Metafield. Read-Only.

1 validation
key
string

The name of the field, for example: location_id, color. Required for POST.

4 validations + required
namespace
string

Namespace for the metafield, for organizational purposes. This is set set by the developer. Required for POST.

4 validations + required
permission_set
string

Determines the visibility and writeability of the field by other API consumers.

Value Description
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
1 validation + required
resource_id
integer

The ID for the resource with which the metafield is associated.

4 validations
resource_type
string

The type of resource with which the metafield is associated.

3 validations
value
string

The value of the field, for example: 1, blue. Required for POST.

4 validations + required

Responses

1 Example
Schema
object
data
object

Properties for updating metafields.

meta
object

Empty meta object; may be used later.

Send a Test Request

Send requests directly from the browser (CORS must be enabled)
Path Params
1 path param not set
product_id
$$.env
1 variable not set
store_hash
X-Auth-Token