Metafields
Get a Store Metafield
GET https://api.bigcommerce.com/stores/{store_hash}/v2/store/metafields/{metafieldId}Request
Gets a store
metafield
.Authentication
- X-Auth-Token in header
Parameters
- store_hash in path - string
- Accept in header with default of application/json - stringThe MIME type of the response body.
- metafieldId in path - integerrequired
The ID of the
Metafield
.
example
curl --request GET \
--url 'https://api.bigcommerce.com/stores/[store_hash]/v2/store/metafields/[metafieldId]' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: {{token}}'
Response
A Metafield
object.
Body
object | application/json
Response payload for the BigCommerce API.
dataobject
Allows app partners to write custom data to various resources in the API.
example
{
"data": {
"permission_set": "app_only",
"namespace": "Sales Department",
"key": "Staff Name",
"value": "Ronaldo",
"description": "order",
"resource_type": "store",
"id": "string",
"date_created": "2022-06-16T18:39:00+00:00",
"date_modified": "2022-06-16T18:39:00+00:00"
},
"meta": {}
}
Update a Store Metafield
PUT https://api.bigcommerce.com/stores/{store_hash}/v2/store/metafields/{metafieldId}Request
Update a store Metafield
.
Authentication
- X-Auth-Token in header
Parameters
- store_hash in path - string
- Accept in header with default of application/json - stringThe MIME type of the response body.
- metafieldId in path - integerrequired
The ID of the
Metafield
. - Content-Type in header with default of application/json - string
A Metafield
object.
Body
object | application/json
Common Metafield properties.
namespacestring
required>= 1 characters<= 64 charactersNamespace for the metafield, for organizational purposes.
Example: Sales Departmentkeystring
required>= 1 characters<= 64 charactersThe name of the field, for example:
location_id
,color
.Example: Staff Namevaluestring
required>= 1 characters<= 65535 charactersThe value of the field, for example:
1
,blue
.Example: Ronaldodescriptionstring
>= 0 characters<= 255 charactersDescription for the metafields.
Example: Name of Staff Member
example
{
"permission_set": "app_only",
"namespace": "Sales Department",
"key": "Staff Name",
"value": "Ronaldo",
"description": "Name of Staff Member"
}
Response
A metafield and metadata.
Body
object | application/json
Response payload for the BigCommerce API.
dataobject
Allows app partners to write custom data to various resources in the API.
example
{
"data": {
"permission_set": "app_only",
"namespace": "Sales Department",
"key": "Staff Name",
"value": "Ronaldo",
"description": "order",
"resource_type": "store",
"id": "string",
"date_created": "2022-06-16T18:39:00+00:00",
"date_modified": "2022-06-16T18:39:00+00:00"
},
"meta": {}
}
Delete a Metafield
DELETE https://api.bigcommerce.com/stores/{store_hash}/v2/store/metafields/{metafieldId}Request
Deletes a store Metafield
.
Authentication
- X-Auth-Token in header
Parameters
- store_hash in path - string
- Accept in header with default of application/json - stringThe MIME type of the response body.
- metafieldId in path - integerrequired
The ID of the
Metafield
.
example
curl --request DELETE \
--url 'https://api.bigcommerce.com/stores/[store_hash]/v2/store/metafields/[metafieldId]' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: {{token}}'
Response
An empty response.
Did you find what you were looking for?