rest - Broadleaf commerce Api adding an item to shopping does not work -


i have followed setting broadleaf make running following documentation (http://docs.broadleafcommerce.org/current/rest-tutorials.html). setup website works fine. howver, when tested adding item shopping cart rest api, found caused me error. here input:

url: localhost:8080/api/cart/2003/100?skuid=100&customerid=1101 request method: post

found error:[error] 02:15:57 defaulterrorhandler - error occurred during workflow org.broadleafcommerce.core.order.service.exception.requiredattributenotprovidedexception: unable add product (100) cart. required attribute not provided: color

my setup environment is: - broadleaf commerce 2.2 - mysql database data comes braodleaf demosite.

you seeing because have required product options configured particular product did not pass required attributes request. try request again request this:

localhost:8080/api/cart/2003/100?customerid=1101&color=blue

this assumes have 'blue' product option value corresponding color product option.

that being said, looks there might bug here because if explicitly passed in skuid in request did, should use priority. current code assumes selecting sku either product option value lookup (this takes priority) , checks passed in sku id. when system attempts sku based on product option values passed in (in case, there none) sees did not pass in required product option (color in case) , throws exception.


Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -