Metafields
Get Channel Metafields
GET https://api.bigcommerce.com/stores/{store_hash}/v3/channels/{channel_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.
- channel_id in path - integerrequiredThe ID of a channel.
- page in query - integer
Specifies the page number in a limited (paginated) list of products.
- limit in query - integer
Controls the number of items per page in a limited (paginated) list of products.
- key in query - string
Filter based on a metafieldʼs key.
- namespace in query - stringFilter based on a metafieldʼs namespace.
- direction in query - stringSort direction. Acceptable values are:
asc
,desc
.Allowed: asc | desc
example
Response
Body
idinteger
Unique ID of the Metafield.Example: 6namespacestring
Namespace for the metafield, for organizational purposes.>= 1 characters<= 64 charactersExample: Warehouse Locationskeystring
>= 1 characters<= 64 charactersThe name of the field, for example:
location_id
,color
.Example: Locationvaluestring
>= 1 characters<= 65535 charactersThe value of the field.
Example: 4HGdescriptionstring
>= 0 characters<= 255 charactersDescription for the metafields.
Example: Location in the warehouseresource_typestring
The type of resource with which the metafield is associated.
Allowed: category | brand | product | variant
Example: productresource_idinteger
The ID for the resource with which the metafield is associated.
Min: 0Max: 10000000000Example: 111date_createdstring
Date and time of the metafieldʼs creation. Read-Only.
Example: 2018-05-07T20:14:17.000Zdate_modifiedstring
Date and time when the metafield was last updated. Read-Only.
Example: 2018-05-07T20:14:17.000Z
example
Create a Channel Metafield
POST https://api.bigcommerce.com/stores/{store_hash}/v3/channels/{channel_id}/metafieldsRequest
Creates a channel metafield.
Note: The maxiumum number of metafields allowed on each order, product, category, variant, channel, 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.
- channel_id in path - integerrequiredThe ID of a channel.
- Content-Type in header with default of application/json - stringrequiredThe MIME type of the request body.
Body
namespacestring
requiredNamespace for the metafield, for organizational purposes. This is set by the developer.>= 1 characters<= 64 charactersExample: Warehouse Locationskeystring
required>= 1 characters<= 64 charactersThe name of the field.
Example: Locationvaluestring
required>= 1 characters<= 65535 charactersThe value of the field.
Example: 4HGdescriptionstring
>= 0 characters<= 255 charactersDescription for the metafield.
Example: Location in the warehouse
Response
Body
idinteger
Unique ID of the Metafield.Example: 6namespacestring
Namespace for the metafield, for organizational purposes.>= 1 characters<= 64 charactersExample: Warehouse Locationskeystring
>= 1 characters<= 64 charactersThe name of the field, for example:
location_id
,color
.Example: Locationvaluestring
>= 1 characters<= 65535 charactersThe value of the field.
Example: 4HGdescriptionstring
>= 0 characters<= 255 charactersDescription for the metafields.
Example: Location in the warehouseresource_typestring
The type of resource with which the metafield is associated.
Allowed: category | brand | product | variant
Example: productresource_idinteger
The ID for the resource with which the metafield is associated.
Min: 0Max: 10000000000Example: 111date_createdstring
Date and time of the metafieldʼs creation. Read-Only.
Example: 2018-05-07T20:14:17.000Zdate_modifiedstring
Date and time when the metafield was last updated. Read-Only.
Example: 2018-05-07T20:14:17.000Z
example
Get a Channel Metafield
GET https://api.bigcommerce.com/stores/{store_hash}/v3/channels/{channel_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.
- channel_id in path - integerrequiredThe ID of a channel.
- metafield_id in path - stringrequired
example
Response
Body
idinteger
Unique ID of the Metafield.Example: 6namespacestring
Namespace for the metafield, for organizational purposes.>= 1 characters<= 64 charactersExample: Warehouse Locationskeystring
>= 1 characters<= 64 charactersThe name of the field, for example:
location_id
,color
.Example: Locationvaluestring
>= 1 characters<= 65535 charactersThe value of the field.
Example: 4HGdescriptionstring
>= 0 characters<= 255 charactersDescription for the metafields.
Example: Location in the warehouseresource_typestring
The type of resource with which the metafield is associated.
Allowed: category | brand | product | variant
Example: productresource_idinteger
The ID for the resource with which the metafield is associated.
Min: 0Max: 10000000000Example: 111date_createdstring
Date and time of the metafieldʼs creation. Read-Only.
Example: 2018-05-07T20:14:17.000Zdate_modifiedstring
Date and time when the metafield was last updated. Read-Only.
Example: 2018-05-07T20:14:17.000Z
example
Update a Channel Metafield
PUT https://api.bigcommerce.com/stores/{store_hash}/v3/channels/{channel_id}/metafields/{metafield_id}Request
Updates a single channel metafield.
Usage Notes
- Attempting to modify
namespace
,key
, andpermission_set
fields using a client ID 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.
- channel_id in path - integerrequiredThe ID of a channel.
- metafield_id in path - stringrequired
- Content-Type in header with default of application/json - stringrequiredThe MIME type of the request body.
Body
namespacestring
Namespace for the metafield, for organizational purposes.>= 1 characters<= 64 charactersExample: Warehouse Locationskeystring
>= 1 characters<= 64 charactersThe name of the field.
Example: Locationvaluestring
>= 1 characters<= 65535 charactersThe value of the field.
Example: 4HGdescriptionstring
>= 0 characters<= 255 charactersDescription for the metafield.
Example: Location in the warehouse.
example
Response
Body
idinteger
Unique ID of the Metafield.Example: 6namespacestring
Namespace for the metafield, for organizational purposes.>= 1 characters<= 64 charactersExample: Warehouse Locationskeystring
>= 1 characters<= 64 charactersThe name of the field, for example:
location_id
,color
.Example: Locationvaluestring
>= 1 characters<= 65535 charactersThe value of the field.
Example: 4HGdescriptionstring
>= 0 characters<= 255 charactersDescription for the metafields.
Example: Location in the warehouseresource_typestring
The type of resource with which the metafield is associated.
Allowed: category | brand | product | variant
Example: productresource_idinteger
The ID for the resource with which the metafield is associated.
Min: 0Max: 10000000000Example: 111date_createdstring
Date and time of the metafieldʼs creation. Read-Only.
Example: 2018-05-07T20:14:17.000Zdate_modifiedstring
Date and time when the metafield was last updated. Read-Only.
Example: 2018-05-07T20:14:17.000Z
example
Delete a Channel Metafield
DELETE https://api.bigcommerce.com/stores/{store_hash}/v3/channels/{channel_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.
- channel_id in path - integerrequiredThe ID of a channel.
- metafield_id in path - stringrequired