简体   繁体   English

Shopify产品API(自定义字段)

[英]Shopify Product API (custom fields)

I've been exploring the Shopify Products API, specifically the return of GET /admin/products.json 我一直在探索Shopify产品API,特别是GET /admin/products.json的返回

And I can't find any return of custom fields in the Response that's provided in the documentation. 而且我在文档中提供的Response中找不到自定义字段的任何返回。 Is this usually provided in the API and is nested in the JSON, or do you have to do a bit of relational digging to find the custom fields? 这通常是在API中提供的,并且嵌套在JSON中吗?还是您需要做一些关系挖掘才能找到自定义字段? Thanks in advance. 提前致谢。

Metafields are the closest thing that Shopify has to custom fields on products. 元字段是Shopify与产品自定义字段最接近的内容。 If you're using the REST API, you'll have to make a separate call to the Metafields API to fetch them. 如果您使用的是REST API,则必须单独调用Metafields API来获取它们。 You can retrieve products and their metafields in one call using the new admin GraphQL API. 您可以使用新的Admin GraphQL API在一次调用中检索产品及其元字段。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM