【问题标题】:Spree API - Create Product Variant with Initial stock quantitySpree API - 创建具有初始库存数量的产品变体
【发布时间】:2015-05-25 14:43:42
【问题描述】:

我正在尝试通过应用程序中的 API 创建具有初始库存数量的 Variant。

示例网址:

--post http://localhost:3000/api/products/apache-baseball-Jersey/variants/

我发现没有办法做到这一点。我试图传递参数: 变体 [数量]、库存项目 [count_on_hand] 等。

在 Spree 文档中,要创建“stock_item”,您需要在 /api/stock_locations /1/stock_items 上执行新请求。但我只想提出一个要求。

有可能吗?

【问题讨论】:

    标签: ruby-on-rails api spree variant stock


    【解决方案1】:

    我们不能通过一个 api 请求发送 count_on_hand,因为我们可以在多个位置管理我们的产品库存,因此我们需要通过每个库存位置的一个请求来管理这一点,这就是为什么需要通过另一个 api 请求发送 count_on_hand。

    【讨论】:

      猜你喜欢
      • 2023-03-12
      • 2013-01-06
      • 1970-01-01
      • 2017-01-11
      • 2019-05-24
      • 1970-01-01
      • 1970-01-01
      • 2023-03-07
      • 2018-07-20
      相关资源
      最近更新 更多