> This page is for Developer.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.bigcommerce.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.bigcommerce.com/_mcp/server.

# createMetafield

GraphQL MUTATION

Create Metafield.

Reference: https://docs.bigcommerce.com/developer/api-reference/graphql/admin/mutations/metafield/create-metafield

## GraphQL Schema

```graphql
mutation ExampleMutation($input: CreateMetafieldInput!) {
  metafield {
    createMetafield(input: $input) {
      metafield {
        id
        description
        key
        namespace
        permissionSet
        resourceId
        value
        ownerClientId
        createdAt
        updatedAt
      }
      errors
    }
  }
}
```

## Variables

```json
{
  "input": {
    "namespace": "example",
    "resourceId": "example",
    "key": "example",
    "value": "example",
    "description": "example",
    "permissionSet": "APP_ONLY"
  }
}
```