create_metaobject
Create a new metaobject instance by specifying type and field values. Use to store custom data objects linked to other entities via metafield references.
Instructions
Create a new metaobject (instance) of an existing type. The type must match a registered metaobject definition — call list_metaobject_definitions first if you're unsure. fields is an array of {key, value} pairs; values are always strings (JSON/reference fields take a JSON-encoded string, primitives take literal text). handle is optional; Shopify generates one from the displayName field if present. status only applies to types that have the publishable capability — passing it for non-publishable types is silently ignored. Returns the new metaobject's GID for use in subsequent set_metafield calls (e.g. linking the metaobject to a product via a metaobject_reference metafield).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | Yes | Type handle from a registered metaobject definition. The definition must already exist; this tool does not create new types/schemas. | |
| handle | No | Optional URL-safe handle. If the type has a 'displayName' field, Shopify generates a handle from it; otherwise pass one here. | |
| fields | Yes | Field values. Provide at least the required fields from the type's definition. Required fields without values cause a validation error. | |
| status | No | Publish status. Only applies to types that declared the `publishable` capability — passing this for non-publishable types is silently ignored. ACTIVE = visible on storefront, DRAFT = hidden. |