Metafields
Get Category Metafields
GET https://api.bigcommerce.com/stores/{store_hash}/v3/catalog/categories/{category_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.
- category_id in path - integerrequired
The ID of the
Category
to which the resource belongs. - id in query - integer
Filter items by metafield ID.
- id:in in query - arrayExplicitly include objects by passing a comma-separated list of IDs.Type: array[integer]
- id:not_in in query - arrayExclude objects by passing a comma-separated list of IDs.Type: array[integer]
- id:min in query - integer
- id:max in query - integer
- id:greater in query - integer
- id:less in query - integer
- key in query - stringFilter based on a metafieldʼs key.
- namespace in query - stringFilter based on a metafieldʼs namespaces.
- page in query - integer
Specifies the page number in a limited (paginated) list of results.
- limit in query - integer
Controls the number of items per page in a limited (paginated) list of results.
- include_fields in query - arrayFields to include, in a comma-separated list. The ID and the specified fields will be returned.Type: array[string]
- 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 Category Metafield
POST https://api.bigcommerce.com/stores/{store_hash}/v3/catalog/categories/{category_id}/metafieldsRequest
Creates a Category Metafield.
Required Fields:
- permission_set
- namespace
- key
- value
Read-Only Fields
- id
Note: The maximum number of metafields allowed on each order, product, category, variant, or brand is 250 per client ID. For more information, see Platform Limits (Help Center) 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.
- category_id in path - integerrequired
The ID of the
Category
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
. 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 50. For more information, see Platform Limits (Help Center) in the Help Center.
example
Get a Category Metafield
GET https://api.bigcommerce.com/stores/{store_hash}/v3/catalog/categories/{category_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.
- category_id in path - integerrequired
The ID of the
Category
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]
- 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 50. For more information, see Platform Limits (Help Center) in the Help Center.
example
Update a Category Metafield
PUT https://api.bigcommerce.com/stores/{store_hash}/v3/catalog/categories/{category_id}/metafields/{metafield_id}Request
Updates a Category Metafield.
Required Fields
- none
Read-Only Fields
- id
- These fields can only be modified by the app (API credentials) that created the metafield:
- namespace
- key
- permission_set
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 a 403 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.
- category_id in path - integerrequired
The ID of the
Category
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
. 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 50. For more information, see Platform Limits (Help Center) in the Help Center.
example
Delete a Category Metafield
DELETE https://api.bigcommerce.com/stores/{store_hash}/v3/catalog/categories/{category_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.
- category_id in path - integerrequired
The ID of the
Category
to which the resource belongs. - metafield_id in path - integerrequired
The ID of the
Metafield
.