SeloraXDEVELOPERS

Metafields

Metafields API

Metafields allow you to store custom key-value data for platform resources. This is useful for storing data that doesn't fit into standard fields, such as specialized product attributes or internal app metadata.

Scopes Required

This API requires the read:metafields scope for retrieving data and write:metafields for saving data.


Resource Types

Metafields can be attached to the following resources:

  • product
  • order
  • customer
  • store

List Metafields

GET /api/apps/v1/metafields/:resource_type/:resource_id

Returns all metafields associated with the specific resource.

Example: GET /api/apps/v1/metafields/product/567


Set Metafield

POST /api/apps/v1/metafields/:resource_type/:resource_id

Creates or updates a metafield.

Request Body:

  • namespace: (string, required) A group for related metafields (e.g., accounting_app).
  • key: (string, required) The name of the metafield (e.g., tax_category).
  • value: (string, required) The data to store.
  • value_type: (string, required) One of string, integer, json, boolean.
  • description: (string) Optional documentation for the field.