Skip to main content

Create/Update Metafield Definitions

The endpoint allows you to create or update (Upsert) a list of metafield definitions on Shopify. A metafield definition defines the structure and data type of metafields associated with products, collections, customers or other Shopify objects.

Metaobject Create/Update Flow Configuration

In addition to the base data flow configuration, it is necessary to add the following settings in Settings Override:

FieldValueNote
Base Urlhttps://adapt.flowlyze.comadapter URL
Resource Pathapi/adp/shopify/shared/metafield-definitionsAdapter path for metafield definitions upsert flow.
Headers :: x-api-key**********API key for endpoint interaction verification
Headers :: x-shopify-access-tokenshpat_CODICEALFANUMERICOSecret of the custom app created for integration
Headers :: x-shopify-graphql-urlhttps://SHOPIFYURL.myshopify.com/Shopify shop URL to connect to
Headers :: x-metafield-upserttrueTo indicate whether to perform upsert of already existing metafield definitions (default false)

Input Message

The endpoint accepts an array of metafield definitions, with all the following fields:

Available fields

  • name (required)
    Type: string
    Readable name of the metafield definition.

  • namespace (required)
    Type: string
    Metafield namespace.

  • key (required)
    Type: string
    Unique identifier of the metafield within the namespace.

  • type (required)
    Type: object
    Metafield data type. See the Supported Metafield Types section for the complete list.

  • ownerType (required)
    Type: string
    Type of Shopify object to which the metafield is associated. See the Available OwnerTypes section for the complete list.

  • pin (default: false)
    Type: boolean
    Indicates whether the metafield should be "pinned".

Structure

Below is a complete example of input structure

[
{
"name": "Product Metafield",
"namespace": "flowlyze",
"key": "productMetafield",
"type": "boolean",
"ownerType": "PRODUCT",
"description": "Metafield to indicate if the product is on promotion",
"pin": true
},
{
"name": "Collection Metafield1",
"namespace": "flowlyze",
"key": "collectionMetafield1",
"type": "single_line_text_field",
"ownerType": "COLLECTION",
"description": "Text metafield for the collection",
"pin": true
}
]

Supported Metafield Types

TypeListable
article_reference
boolean
color
collection_reference
company_reference
customer_reference
date
date_time
dimension
file_reference
id
json
link
metaobject_reference
mixed_reference
money
multi_line_text_field
number_decimal
number_integer
page_reference
product_reference
product_taxonomy_value_reference
rating
rich_text_field
single_line_text_field
url
variant_reference
volume
weight

Available OwnerTypes

Metafields can be associated with different Shopify objects. Below is the complete list of accepted values for the ownerType field:

  • API_PERMISSION
  • ARTICLE
  • BLOG
  • CARTTRANSFORM
  • COLLECTION
  • COMPANY
  • COMPANY_LOCATION
    • CUSTOMER
  • DELIVERY_CUSTOMIZATION
  • DISCOUNT
  • DRAFTORDER
  • FULFILLMENT_CONSTRAINT_RULE
  • GIFT_CARD_TRANSACTION
  • LOCATION
  • MARKET
  • ORDER
  • ORDER_ROUTING_LOCATION_RULE
  • PAGE
  • PAYMENT_CUSTOMIZATION
  • PRODUCT
  • PRODUCTVARIANT
  • SELLING_PLAN
  • SHOP
  • VALIDATION