1

Adding a product to a customer's cart via the REST API is easy enough. However, in our case we also want to add additional info_buyRequest options. But the documentation isn't really clear on how to add more buy request attributes for such a request.

We tried with

{
    "cartItem": {
        "sku": "243612",
        "qty": 1.0,
        "quote_id": "23627",
        "product_option": {
            "info_buyRequest": {
                "foo": "foobar"
            }
        }
    }
}

but had no luck with that. Is there any way to do that?

Magento Version: 2.3.2

0
{
    "cartItem": {
        "sku": "243612",
        "qty": 1.0,
        "quote_id": "23627",
        "product_option": {
              "extension_attributes": {
                "custom_options": [
                    {
                        "option_id": "foo",
                        "option_value": "bar"
                    }
                ]
            }
        }
    }
}
| improve this answer | |
  • And this really will be in info_buyRequest? – fritzmg Dec 11 '19 at 17:13
  • I think, you can see it in quote_item_option table – angel Dec 12 '19 at 12:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.