Metafield

Version 1.0

Serves as the foundation for managing metafields across different entities such as products, product variants, and collections. It enables the flexible structuring of additional information beyond standard attributes.


Metafield Entity

  • Name
    id
    Type
    string
    Required
    Description

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

  • Name
    metafield_definition_id
    Type
    string
    Required
    Description

    The ID of the metafield definition associated with the metafield.

  • Name
    entity_id
    Type
    string
    Required
    Description

    The ID of the entity (e.g., product, product variant, collection) to which the metafield is associated.

  • Name
    value
    Type
    string
    Required
    Description

    The value of the metafield.

The Metafield resource

JSON
{
  "id": "123456789",
  "metafield_definition_id": "987654321",
  "entity_id": "456789012",
  "value": "Example Metafield Value",
  "created_at": "2024-01-07T12:30:00Z",
  "updated_at": "2024-01-07T14:45:00Z",
  "created_by": "123456789",
  "updated_by": "123456789"
}

Create a Single Metafield

This endpoint allows you to create a single metafield.

Required Fields

  • Name
    metafield_definition_id
    Type
    string
    Required
    Description
  • Name
    entity_id
    Type
    string
    Required
    Description
  • Name
    value
    Type
    string
    Required
    Description
  • Name
    created_at
    Type
    timestamp
    Description

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

  • Name
    updated_at
    Type
    timestamp
    Description

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

  • Name
    created_by
    Type
    foreignId
    Description

    This property indicates the user who created the metafield.

  • Name
    updated_by
    Type
    foreignId
    Description

    This property indicates the user who updated the metafield recently.

Examples

Create a single metafield

POST
/v1/metafields
curl --request POST \
  --url https://api.qooly.io/v1/metafields \
  --header 'Content-Type: application/json' \
  --data '{
    "metafield_definition_id": "987654321",
    "entity_id": "456789012",
    "value": "Example Metafield Value"
  }'

Retrieve a Single Metafield

This endpoint allows you to retrieve a single metafield.

Required Parameters

  • Name
    id
    Type
    string
    Required
    Description

Examples

Retrieve a single metafield

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

Update a Single Metafield

This endpoint allows you to update a single metafield.

Required Parameters

  • Name
    id
    Type
    string
    Required
    Description

Examples

Update a single metafield

PATCH
/v1/metafields/123456789
curl --request PATCH \
  --url https://api.qooly.io/v1/metafields/123456789 \
  --header 'Content-Type: application/json' \
  --data '{
    "value": "New Metafield Value"
  }'

Delete a Single Metafield

This endpoint allows you to delete a single metafield.

Required Parameters

  • Name
    id
    Type
    string
    Required
    Description

Examples

Delete a single metafield definition

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