Metafield Definition

Version 1.0

Serves as the foundation for defining metafields across different entities such as product, product variant, and collection. It enables the flexible structuring of additional information beyond standard attributes.


Metafield Definition Entity

  • Name
    id
    Type
    string
    Required
    Description

    Every metafield definition is assigned a unique identifier - an unsigned 64-bit integer known as the Metafield Definition ID. This specific number is exclusive and distinct across the whole Qooly platform. Ensuring an unparalleled level of uniqueness, no two metafield definitions.

  • Name
    owner_entity
    Type
    varchar(16)
    Required
    Description

    This property indicates the entity to which the metafield definition belongs.

  • Name
    namespace
    Type
    varchar(255)
    Required
    Description

    This property indicates the namespace of the metafield definition.

  • Name
    key
    Type
    varchar(255)
    Required
    Description

    This property indicates the key of the metafield definition.

  • Name
    name
    Type
    varchar(255)
    Required
    Description

    This property indicates the name of the metafield definition.

  • Name
    description
    Type
    text
    Required
    Description

    This property provides a detailed description of the metafield definition.

  • Name
    group
    Type
    varchar(255)
    Description

    This property indicates the group to which the metafield definition belongs.

  • Name
    type
    Type
    varchar(16)
    Required
    Description

    This property indicates the type of the metafield definition.

The Metafield Definition resource

JSON
{
  "id": "123456789",
  "owner_entity": "Product",
  "namespace": "example_namespace",
  "key": "example_key",
  "name": "Example Metafield",
  "description": "A brief description of the example metafield.",
  "group": "Example Group",
  "type": "Single Line Text"
}

Create a single metafield definition

This endpoint allows you to create a single metafield definition.

Required Fields

  • Name
    owner_entity
    Type
    varchar(16)
    Required
    Description
  • Name
    namespace
    Type
    varchar(255)
    Required
    Description
  • Name
    key
    Type
    varchar(255)
    Required
    Description
  • Name
    name
    Type
    varchar(255)
    Required
    Description
  • Name
    description
    Type
    text
    Required
    Description
  • Name
    group
    Type
    varchar(255)
    Description
  • Name
    type
    Type
    varchar(16)
    Required
    Description
  • Name
    created_at
    Type
    timestamp
    Description

    This property indicates the time in ISO_8601 when the metafield definition was created.

  • Name
    updated_at
    Type
    timestamp
    Description

    This property indicates the time in ISO_8601 when the metafield definition was last updated.

  • Name
    created_by
    Type
    foreignId
    Description

    This property indicates the user who created the metafield definition.

  • Name
    updated_by
    Type
    foreignId
    Description

    This property indicates the user who updated the metafield definition recently.

Examples

Create a single metafield definition

POST
/v1/metafield-definitions
curl --request POST \
  --url https://api.qooly.io/v1/metafield-definitions \
  --header 'Content-Type: application/json' \
  --data '{
    "owner_entity": "Product",
    "namespace": "example_namespace",
    "key": "example_key",
    "name": "Example Metafield",
    "description": "A brief description of the example metafield.",
    "group": "Example Group",
    "type": "Single Line Text"
  }'

Retrieve a Single Metafield Definition

This endpoint allows you to retrieve a single metafield definition.

Required Parameters

  • Name
    id
    Type
    string
    Required
    Description

Examples

Retrieve a single metafield definition

GET
/v1/metafield-definitions/123456789
curl --request GET \
  --url https://api.qooly.io/v1/metafield-definitions/123456789

Update a Single Metafield Definition

This endpoint allows you to update a single metafield definition.

Required Parameters

  • Name
    id
    Type
    string
    Required
    Description

Examples

Update a single metafield definition

PATCH
/v1/metafield-definitions/123456789
curl --request PATCH \
  --url https://api.qooly.io/v1/metafield-definitions/123456789 \
  --header 'Content-Type: application/json' \
  --data '{
    "name": "New Name"
  }'

Delete a Single Metafield Definition

This endpoint allows you to delete a single metafield definition.

Required Parameters

  • Name
    id
    Type
    string
    Required
    Description

Examples

Delete a single metafield definition

DELETE
/v1/metafield-definitions/123456789
curl --request DELETE \
  --url https://api.qooly.io/v1/metafield-definitions/123456789