Masao Kitamura
Masao Kitamura

Reputation: 31

BigCommerce: How do you apply an Option Set to a Product?

According to the docs, the "option set" field is read-only:

https://developer.bigcommerce.com/api/stores/v2/products#update-product

Does this mean you are not able to apply an Option Set to a Product via the API?

Does anyone know how to apply an Option Set to a Product?

Upvotes: 0

Views: 403

Answers (2)

Fred Dobson
Fred Dobson

Reputation: 1

"option_set" is read-only, "option_set_id" is writable. I.E. you must retrieve the id of the desired option set and set it.

PUT /products/11
{
    "name": "Plain T-Shirt",
    "type": "physical",
    "description": "This timeless fashion staple will never go out of style!",
    "price": "29.99",
    "categories": [18],
    "availability": "available",
    "weight": "0.5",
    **"option_set_id":25**
}

Upvotes: 0

tekstrand
tekstrand

Reputation: 1493

you're looking for a sub resource of products, you can set the ID by posting the ID to the option_sets sub resource https://developer.bigcommerce.com/api/objects/v2/option_set

Upvotes: 0

Related Questions