Metafields
Get Product Metafields
GET https://api.bigcommerce.com/stores/{store_hash}/v3/catalog/products/{product_id}/metafieldsRequest
Authentication
- X-Auth-Token in header
Parameters
- store_hash in path - string
- Accept in header with default of application/json - stringrequiredThe MIME type of the response body.
- product_id in path - integerrequired
The ID of the
Product
to which the resource belongs. - page in query - integer
Specifies the page number in a limited (paginated) list of products.
- limit in query with default of 50 - integer
Controls the number of items per page in a limited (paginated) list of products.
- key in query - stringFilter based on a metafieldʼs key.
- namespace in query - stringFilter based on a metafieldʼs namespaces.
- include_fields in query - arrayFields to include, in a comma-separated list. The ID and the specified fields will be returned.Type: array[string]
Allowed: name | type | sku | description | weight | width | depth | height | price | cost_price | retail_price | sale_price | map_price | tax_class_id | product_tax_code | calculated_price | categories | brand_id | option_set_id | option_set_display | inventory_level | inventory_warning_level | inventory_tracking | reviews_rating_sum | reviews_count | total_sold | fixed_cost_shipping_price | is_free_shipping | is_visible | is_featured | related_products | warranty | bin_picking_number | layout_file | upc | mpn | gtin | date_last_imported | search_keywords | availability | availability_description | condition | is_condition_shown | order_quantity_minimum | order_quantity_maximum | page_title | meta_keywords | meta_description | date_created | date_modified | view_count | preorder_release_date | preorder_message | is_preorder_only | is_price_hidden | price_hidden_label | custom_url | base_variant_id | open_graph_type | open_graph_title | open_graph_description | open_graph_use_meta_description | open_graph_use_product_name | open_graph_use_image
- exclude_fields in query - arrayFields to exclude, in a comma-separated list. The specified fields will be excluded from a response. The ID cannot be excluded.Type: array[string]
example
Response
Body
dataarray[object]
example
Create a Product Metafield
POST https://api.bigcommerce.com/stores/{store_hash}/v3/catalog/products/{product_id}/metafieldsRequest
Creates a Product Metafield.
Required Fields:
- permission_set
- namespace
- key
- value
Note: The maxiumum number of metafields allowed on each order, product, category, variant, or brand is 250 per client ID. For more information, see Platform Limits in the Help Center.
Authentication
- X-Auth-Token in header
Parameters
- store_hash in path - string
- Accept in header with default of application/json - stringrequiredThe MIME type of the response body.
- product_id in path - integerrequired
The ID of the
Product
to which the resource belongs. - Content-Type in header with default of application/json - stringrequiredThe MIME type of the request body.
Body
keystring
required>= 1 characters<= 64 charactersThe name of the field, for example:
location_id
,color
. Required for POST.Example: Locationvaluestring
required>= 1 characters<= 65535 charactersThe value of the field, for example:
1
,blue
. You must enter a JSON formatted string for ShipperHQ metafields. Required for POST.Example: 4HGnamespacestring
required>= 1 characters<= 64 charactersNamespace for the metafield, for organizational purposes. This is set by the developer. Required for POST.
Example: Warehouse Locationsdescriptionstring
>= 0 characters<= 255 charactersDescription for the metafields.
Example: Location in the warehouse
example
Response
Body
dataobject
Metafield for products, categories, variants, and brands; the max number of metafields allowed on each is 250. For more information, see Platform Limits in the Help Center.
example
Get a Product Metafield
GET https://api.bigcommerce.com/stores/{store_hash}/v3/catalog/products/{product_id}/metafields/{metafield_id}Request
Authentication
- X-Auth-Token in header
Parameters
- store_hash in path - string
- Accept in header with default of application/json - stringrequiredThe MIME type of the response body.
- product_id in path - integerrequired
The ID of the
Product
to which the resource belongs. - metafield_id in path - integerrequired
The ID of the
Metafield
. - include_fields in query - arrayFields to include, in a comma-separated list. The ID and the specified fields will be returned.Type: array[string]
Allowed: name | type | sku | description | weight | width | depth | height | price | cost_price | retail_price | sale_price | map_price | tax_class_id | product_tax_code | calculated_price | categories | brand_id | option_set_id | option_set_display | inventory_level | inventory_warning_level | inventory_tracking | reviews_rating_sum | reviews_count | total_sold | fixed_cost_shipping_price | is_free_shipping | is_visible | is_featured | related_products | warranty | bin_picking_number | layout_file | upc | mpn | gtin | date_last_imported | search_keywords | availability | availability_description | condition | is_condition_shown | order_quantity_minimum | order_quantity_maximum | page_title | meta_keywords | meta_description | date_created | date_modified | view_count | preorder_release_date | preorder_message | is_preorder_only | is_price_hidden | price_hidden_label | custom_url | base_variant_id | open_graph_type | open_graph_title | open_graph_description | open_graph_use_meta_description | open_graph_use_product_name | open_graph_use_image
- exclude_fields in query - arrayFields to exclude, in a comma-separated list. The specified fields will be excluded from a response. The ID cannot be excluded.Type: array[string]
example
Response
Body
dataobject
Metafield for products, categories, variants, and brands; the max number of metafields allowed on each is 250. For more information, see Platform Limits in the Help Center.
example
Update a Product Metafield
PUT https://api.bigcommerce.com/stores/{store_hash}/v3/catalog/products/{product_id}/metafields/{metafield_id}Request
Updates a Product Metafield.
Required Fields
- none
Read-Only Fields
- id
- These fields can only be modified using the API account that created the metafield:
namespace
key
permission_set
value
Usage Notes
- Attempting to modify the
namespace
,key
,permission_set
, orvalue
field using an API account different from the one used to create those metafields will result in a403
error message.
Authentication
- X-Auth-Token in header
Parameters
- store_hash in path - string
- Accept in header with default of application/json - stringrequiredThe MIME type of the response body.
- product_id in path - integerrequired
The ID of the
Product
to which the resource belongs. - metafield_id in path - integerrequired
The ID of the
Metafield
. - Content-Type in header with default of application/json - stringrequiredThe MIME type of the request body.
Body
keystring
required>= 1 characters<= 64 charactersThe name of the field, for example:
location_id
,color
. Required for POST.Example: Locationvaluestring
required>= 1 characters<= 65535 charactersThe value of the field, for example:
1
,blue
. You must enter a JSON formatted string for ShipperHQ metafields. Required for POST.Example: 4HGnamespacestring
required>= 1 characters<= 64 charactersNamespace for the metafield, for organizational purposes. This is set by the developer. Required for POST.
Example: Warehouse Locationsdescriptionstring
>= 0 characters<= 255 charactersDescription for the metafields.
Example: Location in the warehouse
example
Response
Body
dataobject
Metafield for products, categories, variants, and brands; the max number of metafields allowed on each is 250. For more information, see Platform Limits in the Help Center.
example
Delete a Product Metafield
DELETE https://api.bigcommerce.com/stores/{store_hash}/v3/catalog/products/{product_id}/metafields/{metafield_id}Request
Authentication
- X-Auth-Token in header
Parameters
- store_hash in path - string
- Accept in header with default of application/json - stringrequiredThe MIME type of the response body.
- product_id in path - integerrequired
The ID of the
Product
to which the resource belongs. - metafield_id in path - integerrequired
The ID of the
Metafield
.