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.
Product
The metafield definition belongs to a product. Product Variant
The metafield definition belongs to a product variant. Collection
The metafield definition belongs to a collection. - 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.
Single Line Text
The metafield definition is of type single line text. Product
The metafield definition is of type product. JSON
The metafield definition is of type JSON. Multi-line String
The metafield definition is of type multi-line string. Number
The metafield definition is of type number. Color
The metafield definition is of type color. Dimension
The metafield definition is of type dimension.
The Metafield Definition resource
{
"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
Product
The metafield definition belongs to a product. Product Variant
The metafield definition belongs to a product variant. Collection
The metafield definition belongs to a collection. - 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
Single Line Text
The metafield definition is of type single line text. Product
The metafield definition is of type product. JSON
The metafield definition is of type JSON. Multi-line String
The metafield definition is of type multi-line string. Number
The metafield definition is of type number. Color
The metafield definition is of type color. Dimension
The metafield definition is of type dimension. - 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
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"
}'
Create a single metafield definition
curl --request POST \
--url https://api.qooly.io/v1/metafield-definitions \
--header 'Content-Type: application/json' \
--data '{
"owner_entity": "Product Variant",
"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
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"
}'
{
"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",
"created_at": "2024-01-07T12:30:00Z",
"updated_at": "2024-01-07T14:45:00Z",
"created_by": "123456789",
"updated_by": "123456789"
}
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
curl --request GET \
--url https://api.qooly.io/v1/metafield-definitions/123456789
Retrieve a single metafield definition
curl --request GET \
--url https://api.qooly.io/v1/metafield-definitions/123456789
{
"id": "123456789",
"owner_entity": "Product",
"namespace": "example",
"key": "color",
"name": "Color",
"description": "The color of the product",
"group": "General",
"type": "single_line_text",
"created_at": "2024-01-07T12:30:00Z",
"updated_at": "2024-01-07T14:45:00Z",
"created_by": "123456789",
"updated_by": "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
curl --request PATCH \
--url https://api.qooly.io/v1/metafield-definitions/123456789 \
--header 'Content-Type: application/json' \
--data '{
"name": "New Name",
"description": "New Description"
}'
Update a single metafield definition
curl --request PATCH \
--url https://api.qooly.io/v1/metafield-definitions/123456789 \
--header 'Content-Type: application/json' \
--data '{
"name": "New Name"
}'
{
"id": "123456789",
"owner_entity": "Product",
"namespace": "example",
"key": "color",
"name": "Color",
"description": "The color of the product",
"group": "General",
"type": "single_line_text",
"created_at": "2024-01-07T12:30:00Z",
"updated_at": "2024-01-07T14:45:00Z",
"created_by": "123456789",
"updated_by": "123456789"
}
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
curl --request DELETE \
--url https://api.qooly.io/v1/metafield-definitions/123456789
Delete a single metafield definition
curl --request DELETE \
--url https://api.qooly.io/v1/metafield-definitions/123456789
{}