Metafield List API reference

The Metafields List API retrieves custom metafields associated with products.

GET /api/front/metafields/product/list

The following example requests metafields for a specific product

GET /api/front/metafields/product/list?owner_ids={owner_id}&namespace={namespace}&key={key}&page={page}&limit={limit}

Query parameters

ParameterRequiredTypeDescriptionExample Value
owner_idsNostring[]List of owner IDs associated with products.3320697d-4d2d-4bc0-b5f5-d82da4e6bc87
namespaceNostringThe namespace of the metafields.custom
keyNostringThe key of the metafield.color
definition_idNostringID of the metafield definition.98765
limitNointNumber of records to return per page.10
pageNointPage number.0c

Example Requests using Fetch

fetch(window.SHOPLAZZA.routes.root + '/api/front/metafields/product/list?page=0&limit=8')
  .then((response) => response.json())
  .then((data) => {
    // do something...
  });

fetch(window.SHOPLAZZA.routes.root + '/api/front/metafields/product/list?owner_ids=product_id1&owner_ids=product_id2')
  .then(response => response.json())
  .then(data => {
    console.log(data);
  });

Successful response

{
  "data": {
    "metafields": [
      {
        "id": "id",
        "store_id": store_id,
        "owner_id": "owner_id",
        "owner_resource": "product",
        "namespace": "custom",
        "key": "color",
        "value": "value",
        "type": "string",
        "description": "",
        "created_at": "2025-03-14T05:53:31Z",
        "updated_at": "2025-03-17T05:03:35Z"
      }
    ],
    "total": 1,
    "remain": 0,
    "page": 0,
    "total_page": 1,
    "have_next": false
  },
  "msg": "请求成功",
  "state": 0
}