Skip to content

Metafield Types

Metafield types let you specify which value you're going to store to simplify the validation and display. YouCan Metafields API currently support the following types:

TypeDescription
numberNumeric value (price, rating, etc)
stringText representation (product description, etc)
arrayArray or JSON object
booleantrue or false value
dateA date in ISO 8601 format (YYYY-MM-DD).
date_timeA date and time in ISO 8601 format (YYYY-MM-DDTHH:MM:SS).
moneyA numeric amount, with a currency code that matches the store's currency. {"amount": "5.99", "currency_code": "CAD"}
urlA URL with one of the allowed schemes: https, http, mailto, sms, tel.
volumeA value and a unit of volume. Valid unit values: ml, cl, l, m3 (cubic meters), us_fl_oz, us_pt, us_qt, us_gal, imp_fl_oz, imp_pt, imp_qt, imp_gal. { "value": 20.0, "unit": "ml"}
weightA value and a unit of weight. Valid unit values: oz, lb, g, kg. {"value": 2.5,"unit": "kg"}

Each of the types mentioned above supports a list type (list.{type}), as an example list.number can store a list of numbers ([3, 4, 2, 12, 123]).

Note: All values are stored as strings internally and cast using the selected type on display.