Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/spring-boot/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring boot 是否可以使用Shopware REST API更新订单单个位置的StatusID?_Spring Boot_Rest_Shopware - Fatal编程技术网

Spring boot 是否可以使用Shopware REST API更新订单单个位置的StatusID?

Spring boot 是否可以使用Shopware REST API更新订单单个位置的StatusID?,spring-boot,rest,shopware,Spring Boot,Rest,Shopware,我正在尝试根据退货流程更新订单。 如果退货流程完成,则必须更新订单状态ID和订单位置的状态ID 我已经设法通过此端点更新订单的statusId /api/orders/15(提交请求)。但是这个端点只允许更新很少的参数。 以下是shopware 5 api文档: 是否有其他方法更新位置?或者我必须直接在数据库中更新它吗?这看起来很脏 我正在使用Spring Boot发出请求。以下是更新订单状态ID的代码 private JSONObject setShopwareOrderStatus(返回订单

我正在尝试根据退货流程更新订单。 如果退货流程完成,则必须更新订单状态ID和订单位置的状态ID

我已经设法通过此端点更新订单的statusId /api/orders/15(提交请求)。但是这个端点只允许更新很少的参数。 以下是shopware 5 api文档:

是否有其他方法更新位置?或者我必须直接在数据库中更新它吗?这看起来很脏

我正在使用Spring Boot发出请求。以下是更新订单状态ID的代码

private JSONObject setShopwareOrderStatus(返回订单、setOrderStatus请求订单状态){
字符串apiUrl=String.format(“https://shop.com/api/orders/%d?useNumberAsId=true,order.getOrderId());
RestTemplate RestTemplate=新RestTemplate();
HttpHeaders=新的HttpHeaders();
headers.set(HttpHeaders.AUTHORIZATION,“基本apiToken”);
headers.setContentType(MediaType.APPLICATION_JSON);
setAccept(Collections.singletonList(MediaType.APPLICATION_JSON));
HttpEntity请求=新HttpEntity(
订单状态、标题);
响应响应响应响应响应响应=
交换(apirl,HttpMethod.PUT,request,String.class);
返回新的JSONObject(responseEntity.getBody());
}
希望有人能帮助我