Metafields
Custom data on products, variants, collections, customers and orders.
Endpoints#
- GET
/products/{owner_id}/metafields.jsonList a product's metafields - POST
/products/{owner_id}/metafields.jsonSet a product metafield - GET
/variants/{owner_id}/metafields.jsonList a variant's metafields - POST
/variants/{owner_id}/metafields.jsonSet a variant metafield - GET
/collections/{owner_id}/metafields.jsonList a collection's metafields - POST
/collections/{owner_id}/metafields.jsonSet a collection metafield - GET
/customers/{owner_id}/metafields.jsonList a customer's metafields - POST
/customers/{owner_id}/metafields.jsonSet a customer metafield - GET
/orders/{owner_id}/metafields.jsonList a order's metafields - POST
/orders/{owner_id}/metafields.jsonSet a order metafield - GET
/metafields/{id}.jsonGet a metafield - PUT
/metafields/{id}.jsonUpdate a metafield - DELETE
/metafields/{id}.jsonDelete a metafield
Paths are relative to https://store.weftgrid.com/api/admin/2026-10. The examples read the token from $STORELOOM_TOKEN and ids from variables like $ORDER_ID.
The metafield object#
What the endpoints below return for one metafield.
{
"id": "cm2mf01",
"owner_resource": "product",
"owner_id": "cm2product01",
"namespace": "custom",
"key": "material",
"type": "single_line_text_field",
"value": "100% European linen",
"created_at": "2026-10-02T10:00:00.000Z",
"updated_at": "2026-10-02T10:00:00.000Z"
}List a product's metafields#
/products/{owner_id}/metafields.jsonread_productsRequires read_products.
| Parameter | Description |
|---|---|
namespace | Only this namespace. |
key | Only this key. |
fields | Comma-separated fields to return. |
curl "https://store.weftgrid.com/api/admin/2026-10/products/$OWNER_ID/metafields.json" \
-H "X-Storeloom-Access-Token: $STORELOOM_TOKEN"Example responseShowHide
{ "metafields": [ … ] }Set a product metafield#
/products/{owner_id}/metafields.jsonwrite_productsCreates the metafield, or replaces the value when the product already has one with this namespace and key (201 when created, 200 when replaced). Namespace and key: 2–64 lowercase letters, numbers, hyphens or underscores. Types: single_line_text_field, multi_line_text_field, rich_text_field (sanitized HTML), number_integer, number_decimal, money ({"amount":"5.99","currency_code":"USD"}), boolean, date (YYYY-MM-DD), date_time (ISO 8601, stored in UTC), url (http or https), json, color (#rrggbb), rating, dimension, weight, volume ({"value":30,"unit":"cm"}), and references to this store's records as gids: file_reference, product_reference, variant_reference, collection_reference, page_reference, customer_reference, metaobject_reference, mixed_reference (gid://storeloom/Product/<id>…). Most can be lists (list.product_reference…), sent as a JSON array. When the store has a definition for the namespace and key (Settings → Custom data), type can be left out and must match it if sent, and the definition's validations apply. Values are checked and stored in canonical form, e.g. "true", "4.5", "#1b2340". Requires write_products.
{ "metafield": { "namespace": "custom", "key": "material", "type": "single_line_text_field", "value": "100% European linen" } }curl -X POST "https://store.weftgrid.com/api/admin/2026-10/products/$OWNER_ID/metafields.json" \
-H "X-Storeloom-Access-Token: $STORELOOM_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "metafield": { "namespace": "custom", "key": "material", "type": "single_line_text_field", "value": "100% European linen" } }'Example responseShowHide
{
"metafield": {
"id": "cm2mf01",
"owner_resource": "product",
"owner_id": "cm2product01",
"namespace": "custom",
"key": "material",
"type": "single_line_text_field",
"value": "100% European linen",
"created_at": "2026-10-02T10:00:00.000Z",
"updated_at": "2026-10-02T10:00:00.000Z"
}
}List a variant's metafields#
/variants/{owner_id}/metafields.jsonread_productsRequires read_products.
| Parameter | Description |
|---|---|
namespace | Only this namespace. |
key | Only this key. |
fields | Comma-separated fields to return. |
curl "https://store.weftgrid.com/api/admin/2026-10/variants/$OWNER_ID/metafields.json" \
-H "X-Storeloom-Access-Token: $STORELOOM_TOKEN"Example responseShowHide
{ "metafields": [ … ] }Set a variant metafield#
/variants/{owner_id}/metafields.jsonwrite_productsCreates the metafield, or replaces the value when the variant already has one with this namespace and key (201 when created, 200 when replaced). Namespace and key: 2–64 lowercase letters, numbers, hyphens or underscores. Types: single_line_text_field, multi_line_text_field, rich_text_field (sanitized HTML), number_integer, number_decimal, money ({"amount":"5.99","currency_code":"USD"}), boolean, date (YYYY-MM-DD), date_time (ISO 8601, stored in UTC), url (http or https), json, color (#rrggbb), rating, dimension, weight, volume ({"value":30,"unit":"cm"}), and references to this store's records as gids: file_reference, product_reference, variant_reference, collection_reference, page_reference, customer_reference, metaobject_reference, mixed_reference (gid://storeloom/Product/<id>…). Most can be lists (list.product_reference…), sent as a JSON array. When the store has a definition for the namespace and key (Settings → Custom data), type can be left out and must match it if sent, and the definition's validations apply. Values are checked and stored in canonical form, e.g. "true", "4.5", "#1b2340". Requires write_products.
{ "metafield": { "namespace": "custom", "key": "fit", "type": "single_line_text_field", "value": "Relaxed" } }curl -X POST "https://store.weftgrid.com/api/admin/2026-10/variants/$OWNER_ID/metafields.json" \
-H "X-Storeloom-Access-Token: $STORELOOM_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "metafield": { "namespace": "custom", "key": "fit", "type": "single_line_text_field", "value": "Relaxed" } }'Example responseShowHide
{
"metafield": {
"id": "cm2mf01",
"owner_resource": "product",
"owner_id": "cm2product01",
"namespace": "custom",
"key": "material",
"type": "single_line_text_field",
"value": "100% European linen",
"created_at": "2026-10-02T10:00:00.000Z",
"updated_at": "2026-10-02T10:00:00.000Z"
}
}List a collection's metafields#
/collections/{owner_id}/metafields.jsonread_productsRequires read_products.
| Parameter | Description |
|---|---|
namespace | Only this namespace. |
key | Only this key. |
fields | Comma-separated fields to return. |
curl "https://store.weftgrid.com/api/admin/2026-10/collections/$OWNER_ID/metafields.json" \
-H "X-Storeloom-Access-Token: $STORELOOM_TOKEN"Example responseShowHide
{ "metafields": [ … ] }Set a collection metafield#
/collections/{owner_id}/metafields.jsonwrite_productsCreates the metafield, or replaces the value when the collection already has one with this namespace and key (201 when created, 200 when replaced). Namespace and key: 2–64 lowercase letters, numbers, hyphens or underscores. Types: single_line_text_field, multi_line_text_field, rich_text_field (sanitized HTML), number_integer, number_decimal, money ({"amount":"5.99","currency_code":"USD"}), boolean, date (YYYY-MM-DD), date_time (ISO 8601, stored in UTC), url (http or https), json, color (#rrggbb), rating, dimension, weight, volume ({"value":30,"unit":"cm"}), and references to this store's records as gids: file_reference, product_reference, variant_reference, collection_reference, page_reference, customer_reference, metaobject_reference, mixed_reference (gid://storeloom/Product/<id>…). Most can be lists (list.product_reference…), sent as a JSON array. When the store has a definition for the namespace and key (Settings → Custom data), type can be left out and must match it if sent, and the definition's validations apply. Values are checked and stored in canonical form, e.g. "true", "4.5", "#1b2340". Requires write_products.
{ "metafield": { "namespace": "custom", "key": "accent_color", "type": "color", "value": "#4f5a1f" } }curl -X POST "https://store.weftgrid.com/api/admin/2026-10/collections/$OWNER_ID/metafields.json" \
-H "X-Storeloom-Access-Token: $STORELOOM_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "metafield": { "namespace": "custom", "key": "accent_color", "type": "color", "value": "#4f5a1f" } }'Example responseShowHide
{
"metafield": {
"id": "cm2mf01",
"owner_resource": "product",
"owner_id": "cm2product01",
"namespace": "custom",
"key": "material",
"type": "single_line_text_field",
"value": "100% European linen",
"created_at": "2026-10-02T10:00:00.000Z",
"updated_at": "2026-10-02T10:00:00.000Z"
}
}List a customer's metafields#
/customers/{owner_id}/metafields.jsonread_customersRequires read_customers.
| Parameter | Description |
|---|---|
namespace | Only this namespace. |
key | Only this key. |
fields | Comma-separated fields to return. |
curl "https://store.weftgrid.com/api/admin/2026-10/customers/$OWNER_ID/metafields.json" \
-H "X-Storeloom-Access-Token: $STORELOOM_TOKEN"Example responseShowHide
{ "metafields": [ … ] }Set a customer metafield#
/customers/{owner_id}/metafields.jsonwrite_customersCreates the metafield, or replaces the value when the customer already has one with this namespace and key (201 when created, 200 when replaced). Namespace and key: 2–64 lowercase letters, numbers, hyphens or underscores. Types: single_line_text_field, multi_line_text_field, rich_text_field (sanitized HTML), number_integer, number_decimal, money ({"amount":"5.99","currency_code":"USD"}), boolean, date (YYYY-MM-DD), date_time (ISO 8601, stored in UTC), url (http or https), json, color (#rrggbb), rating, dimension, weight, volume ({"value":30,"unit":"cm"}), and references to this store's records as gids: file_reference, product_reference, variant_reference, collection_reference, page_reference, customer_reference, metaobject_reference, mixed_reference (gid://storeloom/Product/<id>…). Most can be lists (list.product_reference…), sent as a JSON array. When the store has a definition for the namespace and key (Settings → Custom data), type can be left out and must match it if sent, and the definition's validations apply. Values are checked and stored in canonical form, e.g. "true", "4.5", "#1b2340". Requires write_customers.
{ "metafield": { "namespace": "custom", "key": "birthday", "type": "date", "value": "1992-04-18" } }curl -X POST "https://store.weftgrid.com/api/admin/2026-10/customers/$OWNER_ID/metafields.json" \
-H "X-Storeloom-Access-Token: $STORELOOM_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "metafield": { "namespace": "custom", "key": "birthday", "type": "date", "value": "1992-04-18" } }'Example responseShowHide
{
"metafield": {
"id": "cm2mf01",
"owner_resource": "product",
"owner_id": "cm2product01",
"namespace": "custom",
"key": "material",
"type": "single_line_text_field",
"value": "100% European linen",
"created_at": "2026-10-02T10:00:00.000Z",
"updated_at": "2026-10-02T10:00:00.000Z"
}
}List a order's metafields#
/orders/{owner_id}/metafields.jsonread_ordersRequires read_orders.
| Parameter | Description |
|---|---|
namespace | Only this namespace. |
key | Only this key. |
fields | Comma-separated fields to return. |
curl "https://store.weftgrid.com/api/admin/2026-10/orders/$OWNER_ID/metafields.json" \
-H "X-Storeloom-Access-Token: $STORELOOM_TOKEN"Example responseShowHide
{ "metafields": [ … ] }Set a order metafield#
/orders/{owner_id}/metafields.jsonwrite_ordersCreates the metafield, or replaces the value when the order already has one with this namespace and key (201 when created, 200 when replaced). Namespace and key: 2–64 lowercase letters, numbers, hyphens or underscores. Types: single_line_text_field, multi_line_text_field, rich_text_field (sanitized HTML), number_integer, number_decimal, money ({"amount":"5.99","currency_code":"USD"}), boolean, date (YYYY-MM-DD), date_time (ISO 8601, stored in UTC), url (http or https), json, color (#rrggbb), rating, dimension, weight, volume ({"value":30,"unit":"cm"}), and references to this store's records as gids: file_reference, product_reference, variant_reference, collection_reference, page_reference, customer_reference, metaobject_reference, mixed_reference (gid://storeloom/Product/<id>…). Most can be lists (list.product_reference…), sent as a JSON array. When the store has a definition for the namespace and key (Settings → Custom data), type can be left out and must match it if sent, and the definition's validations apply. Values are checked and stored in canonical form, e.g. "true", "4.5", "#1b2340". Requires write_orders.
{ "metafield": { "namespace": "custom", "key": "gift_message", "type": "multi_line_text_field", "value": "Happy birthday!" } }curl -X POST "https://store.weftgrid.com/api/admin/2026-10/orders/$OWNER_ID/metafields.json" \
-H "X-Storeloom-Access-Token: $STORELOOM_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "metafield": { "namespace": "custom", "key": "gift_message", "type": "multi_line_text_field", "value": "Happy birthday!" } }'Example responseShowHide
{
"metafield": {
"id": "cm2mf01",
"owner_resource": "product",
"owner_id": "cm2product01",
"namespace": "custom",
"key": "material",
"type": "single_line_text_field",
"value": "100% European linen",
"created_at": "2026-10-02T10:00:00.000Z",
"updated_at": "2026-10-02T10:00:00.000Z"
}
}Get a metafield#
/metafields/{id}.jsonAny tokenRequires the read scope of the metafield's owner (read_products, read_customers or read_orders).
curl "https://store.weftgrid.com/api/admin/2026-10/metafields/$METAFIELD_ID.json" \
-H "X-Storeloom-Access-Token: $STORELOOM_TOKEN"Example responseShowHide
{
"metafield": {
"id": "cm2mf01",
"owner_resource": "product",
"owner_id": "cm2product01",
"namespace": "custom",
"key": "material",
"type": "single_line_text_field",
"value": "100% European linen",
"created_at": "2026-10-02T10:00:00.000Z",
"updated_at": "2026-10-02T10:00:00.000Z"
}
}Update a metafield#
/metafields/{id}.jsonAny tokenChange the value (and the type, when there's no definition for it). Namespace, key and owner can't change. Types: single_line_text_field, multi_line_text_field, rich_text_field (sanitized HTML), number_integer, number_decimal, money ({"amount":"5.99","currency_code":"USD"}), boolean, date (YYYY-MM-DD), date_time (ISO 8601, stored in UTC), url (http or https), json, color (#rrggbb), rating, dimension, weight, volume ({"value":30,"unit":"cm"}), and references to this store's records as gids: file_reference, product_reference, variant_reference, collection_reference, page_reference, customer_reference, metaobject_reference, mixed_reference (gid://storeloom/Product/<id>…). Most can be lists (list.product_reference…), sent as a JSON array. When the store has a definition for the namespace and key (Settings → Custom data), type can be left out and must match it if sent, and the definition's validations apply. Values are checked and stored in canonical form, e.g. "true", "4.5", "#1b2340". Requires the write scope of the metafield's owner.
{ "metafield": { "value": "Washed linen, garment dyed" } }curl -X PUT "https://store.weftgrid.com/api/admin/2026-10/metafields/$METAFIELD_ID.json" \
-H "X-Storeloom-Access-Token: $STORELOOM_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "metafield": { "value": "Washed linen, garment dyed" } }'Example responseShowHide
{
"metafield": {
"id": "cm2mf01",
"owner_resource": "product",
"owner_id": "cm2product01",
"namespace": "custom",
"key": "material",
"type": "single_line_text_field",
"value": "100% European linen",
"created_at": "2026-10-02T10:00:00.000Z",
"updated_at": "2026-10-02T10:00:00.000Z"
}
}Delete a metafield#
/metafields/{id}.jsonAny tokenRequires the write scope of the metafield's owner.
curl -X DELETE "https://store.weftgrid.com/api/admin/2026-10/metafields/$METAFIELD_ID.json" \
-H "X-Storeloom-Access-Token: $STORELOOM_TOKEN"Example responseShowHide
{}