Metafields
Get Metafields
GET https://api.bigcommerce.com/stores/{store_hash}/v3/inventory/locations/{location_id}/metafieldsRequest
Retrieve metafields for a location.
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.
- location_id in path - integerrequiredUnique identifier for a location.
example
curl --request GET \
--url 'https://api.bigcommerce.com/stores/[store_hash]/v3/inventory/locations/[location_id]/metafields' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: {{token}}'
Response
The request has been successfully processed.
Body
object | application/json
dataarray[object]
Create a Metafield
POST https://api.bigcommerce.com/stores/{store_hash}/v3/inventory/locations/{location_id}/metafieldsRequest
Create a location metafield.
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.
- location_id in path - integerrequiredUnique identifier for a location.
- Content-Type in header with default of application/json - stringrequiredThe MIME type of the request body.
Body
object | application/json
Common metafield properties.
keystring
The name of the field, for example:>= 1 characters<= 64 characterslocation_id
,color
.Example: statusvaluestring
>= 1 characters<= 65535 charactersThe value of the field, for example:
1
,blue
.Example: upcomingnamespacestring
>= 1 characters<= 64 charactersNamespace for the metafield, for organizational purposes.
Example: headquartersdescriptionstring
>= 0 characters<= 255 charactersDescription for the metafields.
example
{
"key": "status",
"value": "upcoming",
"namespace": "headquarters",
"permission_set": "app_only",
"description": "string"
}
Response
The request has been successfully processed.
Body
object | application/json
dataobject
Allows app partners to write custom data to various resources in the API.
Get a Metafield
GET https://api.bigcommerce.com/stores/{store_hash}/v3/inventory/locations/{location_id}/metafields/{metafield_id}Request
Get a metafield by location.
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.
- location_id in path - integerrequiredUnique identifier for a location.
- metafield_id in path - integerrequiredUnique identifier for a metafield.
example
curl --request GET \
--url 'https://api.bigcommerce.com/stores/[store_hash]/v3/inventory/locations/[location_id]/metafields/[metafield_id]' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: {{token}}'
Response
The request has been successfully processed.
Body
object | application/json
dataobject
Allows app partners to write custom data to various resources in the API.
Update a Metafield
PUT https://api.bigcommerce.com/stores/{store_hash}/v3/inventory/locations/{location_id}/metafields/{metafield_id}Request
Update a metafield.
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.
- location_id in path - integerrequiredUnique identifier for a location.
- metafield_id in path - integerrequiredUnique identifier for a metafield.
Body
object | application/json
Common metafield properties.
keystring
The name of the field, for example:>= 1 characters<= 64 characterslocation_id
,color
.Example: statusvaluestring
>= 1 characters<= 65535 charactersThe value of the field, for example:
1
,blue
.Example: upcomingnamespacestring
>= 1 characters<= 64 charactersNamespace for the metafield, for organizational purposes.
Example: headquartersdescriptionstring
>= 0 characters<= 255 charactersDescription for the metafields.
example
{
"key": "status",
"value": "upcoming",
"namespace": "headquarters",
"permission_set": "app_only",
"description": "string"
}
Response
The request has been successfully processed.
Body
object | application/json
dataobject
Allows app partners to write custom data to various resources in the API.
Delete a Metafield
DELETE https://api.bigcommerce.com/stores/{store_hash}/v3/inventory/locations/{location_id}/metafields/{metafield_id}Request
Delete a metafield.
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.
- location_id in path - integerrequiredUnique identifier for a location.
- metafield_id in path - integerrequiredUnique identifier for a metafield.
example
curl --request DELETE \
--url 'https://api.bigcommerce.com/stores/[store_hash]/v3/inventory/locations/[location_id]/metafields/[metafield_id]' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: {{token}}'
Response
No Content
Did you find what you were looking for?