商品API / 更新商品库存
商品API / 更新商品库存
发布日期:2017-10-27
浏览次数:235
1.1 说明
路径 | http://www.your_website_domain.com/FeiEditor/api_v1/shop/products/update_stock |
方法 | POST |
说明 | 更新商品价格 |
1.2 参数
名称 | 必须 | 类型 | 描述 |
id | Yes | int | 商品ID |
managing_stock | No | 布尔值 | true or false, 是否启用商品的库存管理。即使关闭,如果stock_quantity这个参数是大于0的,则会被强制开启。也就是说,一般来说您无需关心这个参数。除非您知道在做什么。 |
in_stock | No | 布尔值 | true or false。是否缺货。即使设置为缺货,如果stock_quantity这个参数是大于0的,则会被强制开启。也就是说,一般来说您无需关心这个参数。除非您知道在做什么。 |
stock_quantity | No | int | 商品的剩余库存。需要是一个大于0的数字。 |
1.3 返回结果
正确结果 |
返回格式:JSON |
{ "product" : { "related_ids" : [ 1, 2 ], "variations" : [], "categories" : [ "DEMO_CATEGORY_1", "DEMO_CATEGORY_2" ], "shipping_required" : true, "id" : 1001, "parent" : [], "regular_price" : "100.00", "weight" : null, "total_sales" : 0, "sku" : "", "rating_count" : 2, "managing_stock" : false, "title" : "DEMO PRODUCT 01", "backordered" : false, "on_sale" : true, "status" : "publish", "download_limit" : 0, "taxable" : false, "reviews_allowed" : true, "description" : "This is a demo product", "purchaseable" : true, "sale_price" : "2.00", "type" : "simple", "permalink" : "https://www.example.com/product/demo_product_01", "catalog_visibility" : "visible", "download_expiry" : 0, "dimensions" : { "length" : "", "height" : "", "unit" : "in", "width" : "" }, "cross_sell_ids" : [], "price" : "50.00", "updated_at" : "2017-10-01T10:30:10Z", "attributes" : [], "shipping_class" : "", "virtual" : false, "downloadable" : false, "upsell_ids" : [], "created_at" : "2017-10-01T10:30:10Z", "tax_class" : "", "tags" : [], "price_html" : " "in_stock" : true, "sold_individually" : false, "short_description" : "This is a short product description.", "downloads" : [], "tax_status" : "taxable", "average_rating" : "4.50", "download_type" : "", "shipping_taxable" : true, "purchase_note" : "", "shipping_class_id" : null, "visible" : true, "backorders_allowed" : false, "images" : [ { "position" : 0, "id" : 100, "created_at" : "2017-10-01T10:30:10Z", "src" : "https://www.example.com/qf-content/uploads/2017/10/001.jpg", "title" : "001", "alt" : "", "updated_at" : "2017-10-01T10:30:10Z" }, { "position" : 1, "id" : 101, "created_at" : "2017-10-01T10:30:10Z", "src" : "https://www.example.com/qf-content/uploads/2017/10/002.jpg", "title" : "002", "alt" : "", "updated_at" : "2017-10-01T10:30:10Z" } ], "stock_quantity" : 0, "featured" : false } } |