GET https://{handle}.myshopline.com/admin/openapi/v20260301/:resource/:owner_id/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 for a resource. Specify query parameters to limit and filter the results.
Path Parameters
  • resource string required
    The type of the resource to which the metafield belongs. Valid values are:
    • products: products
    • variants: product variants
    • collections: product collections
    • customers: customers
    • orders: orders
    • pages: pages
    • blogs: blogs collections
    • articles: blogs
    • shop: store
    Example: products
  • owner_id string required
    The ID of the resource to which the metafield belongs. For example, when adding a metafield to product A with an ID of 1605898661, the metafield's owner_id is 1605898661.
    Maximum length: 128
    Example: 16015223514512351235
Query Parameters
  • fields string
    Specify the fields to be returned, with multiple fields separated by ,. Available fields include id, key, namespace, owner_id, created_at and updated_at.
    Example: key,updated_at
  • type string
    The data type for the metafield. Valid values are:
    • single_line_text_field: A single-line text field
    • list.single_line_text_field: Multiple single-line text fields
    • multi_line_text_field: Multi-line text field
    • color: A single color
    • list.color: Multiple colors
    • date: A single date
    • list.date: Multiple dates
    • date_time: A single date and time. Format: ISO 8601.
    • list.date_time: Multiple dates and times. Format: ISO 8601.
    • url: A single URL
    • list.url: Multiple URLs
    • file_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: JSON
    • weight: A single weight with a unit
    • list.weight: Multiple weights with units
    • volume: A single volume with a unit
    • list.volume: Multiple volumes with units
    • dimension: A single size with a unit
    • list.dimension: Multiple sizes with units
    • number_integer: A single integer
    • list.number_integer: Multiple integers
    • number_decimal: A single decimal
    • list.number_decimal: Multiple decimals
    • rating: A single rating
    • list.rating: Multiple ratings
    • page_reference: A single page
    • list.page_reference: Multiple pages
    • product_reference: A single product
    • list.product_reference: Multiple products
    • variant_reference: A single product variant
    • list.variant_reference: Multiple product variants
    • collection_reference: A single product collection
    • list.collection_reference: Multiple product collections
    • customer_reference: A single customer
    • list.customer_reference: Multiple customers
    • order_reference: A single order
    • list.order_reference: Multiple orders
    • boolean: Boolean type. Valid values are true and false.
    • money: Amount with a currency
    For more information about metafields, refer to Guide to Using Metafields Feature.
    Example: single_line_text_field
  • updated_at_max string
    Specify 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
  • namespace string
    The namespace of the metafield. A metafield can be uniquely identified by its key and namespace. Only letters, numbers, hyphens, and underscores are supported.
    Minimum length: 2
    Maximum length: 50
    Example: my_fields-11
  • page_info string
    The unique identifier for pagination queries, used to locate a specific page.
    This parameter value is obtained from the link value in the response header of this API after you have queried the pagination information.
    For example, if the link value you obtained is <https://{handle}.myshopline.com/admin/openapi/{version}/:resource/:owner_id/metafields.json?limit=1&page_info=eyJzaW5jZUlkIjoiMTYwNTc1OTAxNTM4OTA4Mjk1MjExMTI3ODgiLCJkaXJlY3Rpb24iOiJuZXh0IiwibGltaXQiOjF9>; rel="next" , the value of page_info is eyJzaW5jZUlkIjoiMTYwNTc1OTAxNTM4OTA4Mjk1MjExMTI3ODgiLCJkaXJlY3Rpb24iOiJuZXh0IiwibGltaXQiOjF9 .
    For more information on how to use pagination, refer to Paging Mechanism.
  • updated_at_min string
    Specify 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
  • created_at_max string
    Specify the cutoff creation date and time for metafields to query. Metafields created on and before this time are returned. Format: ISO 8601.
    Example: 2023-04-25T16:15:47-04:00
  • created_at_min string
    Specify the initial creation date and time for metafields to query. Metafields created on and after this time are returned. Format: ISO 8601.
    Example: 2023-04-25T16:15:47-04:00
  • since_id string
    The ID of a specific metafield. Start querying metafields from this specified ID.
    Example: 1
  • key string
    A unique identifier for a metafield within its namespace. Only letters, numbers, hyphens, and underscores are supported.
    Minimum length: 3
    Maximum length: 30
    Example: key_123
  • limit string
    The maximum number of metafields to return.
    Value range: 1-250
    Default value: 50
Request Headers
  • Content-Type string required
    The field must be set to the fixed value application/json; charset=utf-8.
  • Authorization string required
    The 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
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 obtain page_info from 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 string
    The date and time when the metafield was created. Format: ISO 8601.
  • description string
    The description of the metafield.
  • id long
    The ID of the metafield.
  • key string
    A unique identifier for a metafield within its namespace.
  • namespace string
    The namespace of the metafield.
  • owner_id string
    The resource ID to which the metafield belongs.
  • owner_resource string
    The type of the resource to which the metafield belongs. Valid values are:
    • products: products
    • variants: product variants
    • collections: product collections
    • customers: customers
    • orders: orders
    • pages: pages
    • blogs: blogs collections
    • articles: blogs
    • shop: store
  • type string
    The data type for the metafield. Valid values are:
    • single_line_text_field: A single-line text field
    • list.single_line_text_field: Multiple single-line text fields
    • multi_line_text_field: Multi-line text field
    • color: A single color
    • list.color: Multiple colors
    • date: A single date
    • list.date: Multiple dates
    • date_time: A single date and time. Format: ISO 8601.
    • list.date_time: Multiple dates and times. Format: ISO 8601.
    • url: A single URL
    • list.url: Multiple URLs
    • file_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: JSON
    • weight: A single weight with a unit
    • list.weight: Multiple weights with units
    • volume: A single volume with a unit
    • list.volume: Multiple volumes with units
    • dimension: A single size with a unit
    • list.dimension: Multiple sizes with units
    • number_integer: A single integer
    • list.number_integer: Multiple integers
    • number_decimal: A single decimal
    • list.number_decimal: Multiple decimals
    • rating: A single rating
    • list.rating: Multiple ratings
    • page_reference: A single page
    • list.page_reference: Multiple pages
    • product_reference: A single product
    • list.product_reference: Multiple products
    • variant_reference: A single product variant
    • list.variant_reference: Multiple product variants
    • collection_reference: A single product collection
    • list.collection_reference: Multiple product collections
    • customer_reference: A single customer
    • list.customer_reference: Multiple customers
    • order_reference: A single order
    • list.order_reference: Multiple orders
    • boolean: Boolean type. Valid values are true and false.
    • money: Amount with a currency
    For more information about metafields, refer to Guide to Using Metafields Feature.
  • updated_at string
    The date and time when the metafield was updated. Format: ISO 8601.
  • value object
    The data stored in the metafield.
API Explorer
https://openapiceshidianpu.myshopline.com/admin/openapi/v20260301

ParamOptions

path required
path required
header required
query
query
query
query
query
query
query
query
query
query
query

Language

curl --request GET \
--url https://openapiceshidianpu.myshopline.com/admin/openapi/v20260301/resource/owner_id/metafields.json \
--header 'Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJhcHBLZXkiOiJmMjM3OWQyMTYyOGMzM2QxMWRiMWZkYjY5N2EzZjdjMjZlNGMwYTA5Iiwic2VsbGVySWQiOiIyMDAwMjM0ODgwIiwic3RvcmVJZCI6IjE2NzIzNjk3Mjk2MDYiLCJ2ZXJzaW9uIjoiVjIiLCJkb21haW4iOiJodHRwczovL3NsLW9wZW4tc2cubXlzaG9wbGluZS5jb20iLCJ0aW1lc3RhbXAiOjE2NzUzMTk0OTI0MzksImlzcyI6Inlzb3VsIiwiZXhwIjoxNzY5OTI3NDkyfQ.UwQzomM2veGCUaOZ0paUxq5dpc7DXuhHYFvsQ_uIAKduzWcb_j2E4q_36El83sp145D4cKbpcE5KCeeIz-JNQw' \
--header 'Content-Type: application/json; charset=utf-8' \
--header 'accept: application/json'
Examples
Get metafields for a resource
Response
{
"metafields": [
{
"created_at": "2022-12-28T09:39:35+00:00",
"description": "My description",
"id": 397923258691,
"key": "key_123",
"namespace": "namespace_123",
"owner_id": "16015223514512351235",
"owner_resource": "products",
"type": "single_line_text_field",
"updated_at": "2022-12-28T09:39:36+00:00",
"value": "1241412342341341234123"
}
]
}
Was this article helpful to you?