I'm getting 500 error while trying to bulk update items. Any help would be greatly appreciated.
Here's the request
OkHttpClient
client
=
new
OkHttpClient();
2
3
MediaType
mediaType
=
MediaType.
parse(
"application/json");
4
RequestBody
body
=
RequestBody.
create(
mediaType,
"{\"items\":[{\"hidden\":\"false\",\"available\":\"true\",\"autoManage\":\"false\",\"itemGroup\":{},\"defaultTaxRates\":\"true\",\"isRevenue\":\"false\",\"canonical\":{},\"itemStock\":{\"item\":{}},\"name\":\"123\",\"price\":133,\"id\":\"QG8YE7N19VC7E\"},{\"hidden\":\"false\",\"available\":\"true\",\"autoManage\":\"false\",\"itemGroup\":{},\"defaultTaxRates\":\"true\",\"isRevenue\":\"false\",\"canonical\":{},\"itemStock\":{\"item\":{}},\"name\":\"Test\",\"price\":123,\"id\":\"AY5KGEYY95KWG\"}]}");
5
Request
request
=
new
Request.
Builder()
7 .
put(
body)
8 .
addHeader(
"Content-Type",
"application/json")
9 .
addHeader(
"Authorization",
"Bearer *******")
10 .
build();
11
12
Response
response
=
client.
newCall(
request).
execute();