版本:202201
创建元字段定义
POST/openapi/2022-01/metafield_definition/:owner_resource
使用提供的详情创建新元字段定义。
请求
Path参数
- shop: 店铺。
- product: 商品。
- product_image: 商品图片。
- product_variant: 商品款式。
- order: 订单。
- page: 自定义页面。
- customer: 顾客。
- collection: 商品专辑。
- blog: 博客。
- article: 文章。
- app: 应用。
owner_resource string必填
所属资源类型。
- application/json
- 请求体
- 示例
请求体
namespacestring必填
Namespace of definition
keystring必填
Key of definition
typestring必填
Definition field type, choose from date date_time weight volume dimension integer number_decimal file_reference single_line_text_field json multi_line_text_field color rating url boolean
namestring必填
Name of definition
descriptionstring
Description of definition
{
"namespace": "string",
"key": "string",
"type": "string",
"name": "string",
"description": "string"
}
响应
- 200
- 422
200
- application/json
- 数据结构
- 示例
- Result
数据结构
idstring
示例:
374034306256875562keystring
示例:
key2namestring
示例:
Bignamespacestring
示例:
testowner_resourcestring
示例:
producttypestring
示例:
booleandescriptionstring
示例:
booleancreate_atstring
示例:
2024-04-28T03:18:59Zupdated_atstring
示例:
2024-04-28T03:18:59Z{
"id": "374034306256875562",
"key": "key2",
"name": "Big",
"namespace": "test",
"owner_resource": "product",
"type": "boolean",
"description": "boolean",
"create_at": "2024-04-28T03:18:59Z",
"updated_at": "2024-04-28T03:18:59Z"
}
{
"id": "374034306256875562",
"key": "key2",
"name": "Big",
"namespace": "test",
"owner_resource": "product",
"type": "boolean",
"description": "boolean",
"create_at": "2024-04-28T03:18:59Z",
"updated_at": "2024-04-28T03:18:59Z"
}
422
- application/json
- 数据结构
- 示例
- Result
数据结构
errorsstring[]
{
"errors": [
"Key is required"
]
}
{
"errors": [
"Key is required",
"Type is required",
"Name is required",
"Type is invalid",
"Metafield definition namespace and key exist"
]
}