For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Dev Portal
DocsAPI ReferenceLearnCommunityChangelog
DocsAPI ReferenceLearnCommunityChangelog
  • Overview
    • Quick Start
    • Sandboxes
    • Tools & SDKs
    • Support
  • Docs
      • Getting Started
          • Store Metafields
          • Reassign Metafields Owner
    • Archive
    • Closed Beta Programs
Dev Portal
LogoLogo
On this page
  • Remove resource ID
  • Use the Global ID
DocsAdminStore ConfigurationMetafields

Store Metafields

Was this page helpful?
Previous

Examples

Next

Reassign Metafields Owner

Built with

Store metafields allow you to attach a metafield to the store itself. They are suitable for any global information against the store that is not channel specific. Channel metafields are appropriate for any storefront-specific data you need to store in metafields. There are two ways to create a store metafield in Admin GraphQL. You can remove the resource ID or use the store’s Global ID. Examples of each type are below:

You can create 10,000 metafields on a store entity instead of the typical limit of 250 per entity-per-client-id.

Remove resource ID

Request
Response
Example mutation: Create a store metafield
1 POST https://api.bigcommerce.com/stores/{{STORE_HASH}}/graphql
2 X-Auth-Token: {{ACCESS_TOKEN}}
3 Content-Type: application/json
4 Accept: application/json
5
6 mutation Metafield($input: CreateMetafieldInput!) {
7 metafield {
8 createMetafield(input: $input) {
9 metafield {
10 id
11 description
12 key
13 namespace
14 permissionSet
15 resourceId
16 value
17 ownerClientId
18 }
19 }
20 }
21}
GraphQL variables
{
"input":{
"namespace": "Warehouse Locations",
"key": "Location",
"value": "4HG",
"permissionSet": "APP_ONLY"
}
}

Use the Global ID

Request
Response
Example mutation: Create a store metafield
1 POST https://api.bigcommerce.com/stores/{{STORE_HASH}}/graphql
2 X-Auth-Token: {{ACCESS_TOKEN}}
3 Content-Type: application/json
4 Accept: application/json
5
6 mutation Metafield($input: CreateMetafieldInput!) {
7 metafield {
8 createMetafield(input: $input) {
9 metafield {
10 id
11 description
12 key
13 namespace
14 permissionSet
15 resourceId
16 value
17 ownerClientId
18 }
19 }
20 }
21}
GraphQL variables
{
"input":{
"namespace": "Warehouse Locations",
"key": "Location",
"value": "4HG",
"permissionSet": "APP_ONLY",
"resourceId": "bc/store/store/1001197568"
}
}