Get store metafields
GET https://{handle}.myshopline.com/admin/openapi/v20260301/metafields.json
handle : The store's unique identifier, which is the prefix of the store's domain name. For example, if a store's domain name is open001.myshopline.com , the store handle is open001 .Get a list of metafields of the store.
Query Parameters
- fields stringSpecify the fields to be returned, with multiple fields separated by
,. Available fields includeid,key,namespace,owner_id,created_atandupdated_at.Example:id,key - key stringA unique identifier for a metafield within its
namespace. Only letters, numbers, hyphens, and underscores are supported.
Minimum length: 3
Maximum length: 30Example:key_123 - limit stringThe maximum number of metafields to return.
Value range: 1-250
Default value:50 - namespace stringThe namespace of the metafield. A metafield can be uniquely identified by its
keyandnamespace. Only letters, numbers, hyphens, and underscores are supported.
Minimum length: 2
Maximum length: 50Example:namespace_123 - page_info stringThe unique identifier for pagination queries, used to locate a specific page.This parameter value is obtained from the
linkvalue in the response header of this API after you have queried the pagination information.For example, if thelinkvalue you obtained is<https://{handle}.myshopline.com/admin/openapi/{version}/metafields.json?limit=1&page_info=eyJzaW5jZUlkIjoiMTYwNTc1OTAxNTM4OTA4Mjk1MjExMTI3ODgiLCJkaXJlY3Rpb24iOiJuZXh0IiwibGltaXQiOjF9>; rel="next", the value ofpage_infoiseyJzaW5jZUlkIjoiMTYwNTc1OTAxNTM4OTA4Mjk1MjExMTI3ODgiLCJkaXJlY3Rpb24iOiJuZXh0IiwibGltaXQiOjF9.For more information on how to use pagination, refer to Paging Mechanism. - updated_at_max stringSpecify the cutoff update date for metafields to query. Metafields updated on and before this time are returned. Format: ISO 8601.Example:
2024-04-25T16:16:47-04:00 - created_at_max stringSpecify the cutoff creation date and time for metafields to query. Metafields created on and before this time are returned. Format: ISO 8601.Example:
2024-04-25T16:16:47-04:00 - created_at_min stringSpecify the initial creation date and time for metafields to query. Metafields created on and after this time are returned. Format: ISO 8601.Example:
2024-04-25T16:15:47-04:00 - since_id stringThe ID of a specific metafield. Start querying metafields from this specified ID.Example:
1 - type stringThe data type for the metafield. Valid values are:
single_line_text_field: A single-line text fieldlist.single_line_text_field: Multiple single-line text fieldsmulti_line_text_field: Multi-line text fieldcolor: A single colorlist.color: Multiple colorsdate: A single datelist.date: Multiple datesdate_time: A single date and time. Format: ISO 8601.list.date_time: Multiple dates and times. Format: ISO 8601.url: A single URLlist.url: Multiple URLsfile_reference: A single file. Support a PDF or image file within 10 MB. Supported image formats: JPG, JPEG, PNG, and GIF.list.file_reference: Multiple files. Support PDF or image files and each file must be within 10 MB. Supported image formats: JPG, JPEG, PNG, and GIF.json: JSONweight: A single weight with a unitlist.weight: Multiple weights with unitsvolume: A single volume with a unitlist.volume: Multiple volumes with unitsdimension: A single size with a unitlist.dimension: Multiple sizes with unitsnumber_integer: A single integerlist.number_integer: Multiple integersnumber_decimal: A single decimallist.number_decimal: Multiple decimalsrating: A single ratinglist.rating: Multiple ratingspage_reference: A single pagelist.page_reference: Multiple pagesproduct_reference: A single productlist.product_reference: Multiple productsvariant_reference: A single product variantlist.variant_reference: Multiple product variantscollection_reference: A single product collectionlist.collection_reference: Multiple product collectionscustomer_reference: A single customerlist.customer_reference: Multiple customersorder_reference: A single orderlist.order_reference: Multiple ordersboolean: Boolean type. Valid values aretrueandfalse.money: Amount with a currency
For more information about metafields, refer to Guide to Using Metafields Feature.Example:single_line_text_field - updated_at_min stringSpecify the initial update date for metafields to query. Metafields updated on and after this time are returned. Format: ISO 8601.Example:
2024-04-25T16:15:47-04:00
Request Headers
- Content-Type string requiredThe field must be set to the fixed value
application/json; charset=utf-8. - Authorization string requiredThe access token for the API resource. Refer to App authorization to obtain the access token, and then pass the obtained token in the Bearer format.Example:
Bearer eyJhbGciOiJIUzUxMiJ9.eyJhcHBLZXkiOiJmMjM3OWQyMTYyOGMzM2QxMWRiMWZkYjY5N2EzZjdjMjZlNGMwYTA5Iiwic2VsbGVySWQiOiIyMDAwMjM0ODgwIiwic3RvcmVJZCI6IjE2NzIzNjk3Mjk2MDYiLCJ2ZXJzaW9uIjoiVjIiLCJkb21haW4iOiJodHRwczovL3NsLW9wZW4tc2cubXlzaG9wbGluZS5jb20iLCJ0aW1lc3RhbXAiOjE2NzUzMTk0OTI0MzksImlzcyI6Inlzb3VsIiwiZXhwIjoxNzY5OTI3NDkyfQ.UwQzomM2veGCUaOZ0paUxq5dpc7DXuhHYFvsQ_uIAKduzWcb_j2E4q_36El83sp145D4cKbpcE5KCeeIz-JNQw
Status Codes
- 200
- 401
- 429
For the complete list of codes and messages, see Http status code.
Response Headers
link
The URL link that provides the pagination data. You can obtainpage_infofrom this parameter for subsequent pagination requests.This parameter is returned when the requested page has a previous or next page.For more information on how to use pagination, refer to Paging Mechanism.traceId
A globally unique identifier for the request. It is used to track the request flow throughout the system, allowing for easy location and debugging when issues arise.
Response Body
metafieldsobject[]
List of metafields.created_at stringThe date and time when the metafield was created. Format: ISO 8601.description stringThe description of the metafield.id longThe ID of the metafield.key stringA unique identifier for a metafield definition within itsnamespace.namespace stringThe namespace of the metafield.owner_id stringThe store ID to which the metafield belongs.owner_resource stringThe type of the resource to which the metafield belongs. The value of this field is fixed toshop, indicating a store metafield.type stringThe data type for the metafield. Valid values are:single_line_text_field: A single-line text fieldlist.single_line_text_field: Multiple single-line text fieldsmulti_line_text_field: Multi-line text fieldcolor: A single colorlist.color: Multiple colorsdate: A single datelist.date: Multiple datesdate_time: A single date and time. Format: ISO 8601.list.date_time: Multiple dates and times. Format: ISO 8601.url: A single URLlist.url: Multiple URLsfile_reference: A single file. Support a PDF or image file within 10 MB. Supported image formats: JPG, JPEG, PNG, and GIF.list.file_reference: Multiple files. Support PDF or image files and each file must be within 10 MB. Supported image formats: JPG, JPEG, PNG, and GIF.json: JSONweight: A single weight with a unitlist.weight: Multiple weights with unitsvolume: A single volume with a unitlist.volume: Multiple volumes with unitsdimension: A single size with a unitlist.dimension: Multiple sizes with unitsnumber_integer: A single integerlist.number_integer: Multiple integersnumber_decimal: A single decimallist.number_decimal: Multiple decimalsrating: A single ratinglist.rating: Multiple ratingspage_reference: A single pagelist.page_reference: Multiple pagesproduct_reference: A single productlist.product_reference: Multiple productsvariant_reference: A single product variantlist.variant_reference: Multiple product variantscollection_reference: A single product collectionlist.collection_reference: Multiple product collectionscustomer_reference: A single customerlist.customer_reference: Multiple customersorder_reference: A single orderlist.order_reference: Multiple ordersboolean: Boolean type. Valid values aretrueandfalse.money: Amount with a currency
For more information about metafields, refer to Guide to Using Metafields Feature.updated_at stringThe date and time when the metafield was updated. Format: ISO 8601.value objectThe data stored in the metafield.
API Explorer
Debugger
Examples
Was this article helpful to you?