【问题标题】:woocommerce api create order set line item pricewoocommerce api 创建订单设置行项目价格
【发布时间】:2019-07-08 05:20:22
【问题描述】:

我正在尝试通过 woocommerce API V3 创建订单。我无法使用自定义价格添加 line_item 的问题。有可能吗?

line_items:[ {
    product_id: 9344, 
    quantity: 1,
    subtotal: 10,
    total: 10 
  }]

目前我收到此错误:

    code: 'rest_invalid_param',
    message: 'Invalid parameter(s): line_items',

【问题讨论】:

标签: woocommerce woocommerce-rest-api


【解决方案1】:

我找到了解决方案。总值周围需要双引号。

line_items:[ {
    product_id: 9344, 
    total: "10"
  }]

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-12-02
    • 1970-01-01
    • 2016-03-12
    • 2013-04-20
    • 1970-01-01
    • 1970-01-01
    • 2019-01-27
    • 2017-09-22
    相关资源
    最近更新 更多