wc-api-java icon indicating copy to clipboard operation
wc-api-java copied to clipboard

Update of order line_items

Open philipdomann opened this issue 5 years ago • 1 comments

Hi icoderman, can you please give me an example of how I can update line_items of an order?

params.put("line_items", p); Map response = wooCommerce.update(EndpointBaseType.ORDERS.getValue(), orderId, params);

I only get the message: {code=rest_invalid_param, message=Ungültige(r) Parameter: line_items, data={status=400, params={line_items=line_items[0] ist nicht vom Typ object.}}}

It works with Postman, when I use raw (Json) and this structure: {"line_items": [{...}]}

philipdomann avatar Jul 30 '19 18:07 philipdomann

Hi @philipdomann I guess P must be list of objects. Could you show how your initialization of variable p looks like?

omandryk avatar Aug 24 '19 06:08 omandryk