Skip to main content

Create Shopify Metafield Definition

POST 

/api/shopify/:integrationInstance/metafield-definitions

Creates a metafield definition in the Shopify store and returns it. Use it to send data the store has no metafield for yet.

Required scope: integrations:write

Grant this scope to your token under Settings → Developer → Personal Access Tokens.

Authentication: Requires Bearer token and permission to update integrations.

Request body:

  • name (required, max 255)
  • namespace (default custom; letters, numbers, dashes and underscores; shopify and app-reserved namespaces are rejected)
  • key (required, 2-64 chars, lowercase letters, numbers and underscores; unique per owner and namespace)
  • owner_type (required): product or variant
  • type (required): a Shopify metafield type SKU.io can send, e.g. single_line_text_field, multi_line_text_field, rich_text_field, number_integer, number_decimal, boolean, date, date_time, url, color, weight, dimension, volume, money, rating, json, product_reference, variant_reference, collection_reference, metaobject_reference, file_reference, or a list. form of the listable ones
  • description (optional, max 1000)
  • choices (optional, max 128 distinct strings; applies to single line text types only)
  • storefront_visible (optional, default true): whether themes can read the metafield

Errors: 422 for invalid input, or when Shopify refuses the definition (e.g. the key already exists).

Request​

Responses​

Created

Response Headers
    Content-Type