如何发送带有文本选项的产品以创建订单bigcommerce API? [英] How to send products with text options to create order bigcommerce API?

查看:77
本文介绍了如何发送带有文本选项的产品以创建订单bigcommerce API?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法为具有文本选项的产品创建向大商业的订单,api给出了以下错误:

I'm having trouble creating an order to bigcommerce for products with text options, the api gives these error:

[
  {
    "status": 400,
    "message": "The options of one or more products are invalid.",
    "details": {
      "errors": [
        {
          "type": "InvalidProductOptionValue",
          "product": {
            "id": 3190,
            "name": "Esprit Knit Tech Gloves.",
            "product_option": {
              "id": 445,
              "option_id": 47,
              "display_name": "Name To Print",
              "value": "moni test",
              "url": "https:\/\/api.bigcommerce.com\/stores\/xxxxxx\/v2\/products\/3190\/options\/445",
              "resource": "\/products\/3190\/options\/445"
            },
            "url": "https:\/\/api.bigcommerce.com\/stores\/xxxxxx\/v2\/products\/3190",
            "resource": "\/products\/3190"
          }
        }
      ]
    }
  }
]

我要发送给products对象的是:

And what I'm sending for the products object is:

[
  {
    "product_id":"3190",
    "quantity":1,
    "product_options":[
       {
         "id":"445",
         "value":"TEXT option"
       }
     ]
   }
 ]

所使用的代码适用于带有下拉选项的产品.我不知道还要发送什么,也无法在他们的文档中找到答案.

The code used works for product with drop down options. I don't know what else to send and I can't find an answer in their documentation.

推荐答案

我们收到了来自bigcommerce的答复,称该API在创建订单时不支持TEXT选项.

We have received an answer from bigcommerce saying that the API does not support TEXT options when creating orders.

这是他们的答案: 我了解您正在尝试创建一个带有文本字段作为选项的订单.不幸的是,这种类型的产品选项对象是不可能的.对象的value属性将仅接受整数(基于选项).

This is their answer: "I understand you are attempting to create an order with a text field as an option. Unfortunately, this type of product option object is not possible. The value attribute of the object will only accept integers (the id of the option value based off the option)."

这篇关于如何发送带有文本选项的产品以创建订单bigcommerce API?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆