本文档由 Apifox 自动生成,推荐使用 Apifox - API 文档、API 调试、API Mock、API 自动化测试!
product
as a path parameter.product.type
variable set to product
, creating a new product option will generate a new variant for this option.products.read_write
- Products Read & WriteAuthorization: Bearer ********************
visibility
variable is set to on_condition
visibility
is set to on_condition
visibility
is set to on_condition
product
, then adding an option to the product will set it to advance
. Default value is true
when the product type is set to product
type
is set to date
type
is set to date
type
is set to either radio
, file
, or checkbox
{
"name": "option name",
"required": true,
"visibility": "on_condition",
"visibility_condition_type": "=",
"visibility_condition_option": 2134428744,
"visibility_condition_value": 306646512,
"display_type": "image",
"values": [
{
"name": "value 3",
"price": "10",
"is_default": false
}
]
}
curl --location --request POST 'https://echo.apifox.com/anything/products//options' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "option name",
"required": true,
"visibility": "on_condition",
"visibility_condition_type": "=",
"visibility_condition_option": 2134428744,
"visibility_condition_value": 306646512,
"display_type": "image",
"values": [
{
"name": "value 3",
"price": "10",
"is_default": false
}
]
}'
radio
button or checkbox
{
"status": 201,
"success": true,
"data": {
"id": 1130246629,
"name": "size",
"description": null,
"type": "radio",
"required": false,
"associated_with_order_time": 0,
"sort": null,
"display_type": "text",
"visibility": "always",
"values": [
{
"id": 322122678,
"name": "XL",
"price": {
"amount": 180,
"currency": "SAR"
},
"display_value": "XL",
"option_id": 1130246629,
"image_url": "https://i.ibb.co/jyqRQfQ/avatar-male.webp",
"hashed_display_value": "XL"
}
],
"skus": [
{
"id": 652911549,
"price": {
"amount": 150,
"currency": "SAR"
},
"regular_price": {
"amount": 234,
"currency": "SAR"
},
"stock_quantity": 3000,
"barcode": "barcode-ABC",
"sku": "sku-variant-1551119600",
"related_option_values": [
667315336,
322122678
]
}
]
}
}
扫码加入 Apifox 微信交流群
在这里,获得 Apifox 使用上的任何帮助,快速上手让你的研测效率得到大幅提升