如何使用Magento 2中的REST API将状态从“待付款”更改为“正在处理”

问题描述 投票:0回答:1

我们正在使用Magento 2.3.4的REST API接口来处理订单。按照以下链接中给出的7个步骤进行操作,并添加了捕获付款的代码。

Creating Order in Magento 2

捕获付款后,状态不会从待付款更改为处理中”。但是,如果单击管理面板中的获取付款更新选项,订单状态将更改为处理中。是否知道需要调用哪种REST API才能将状态更改为“正在处理”?

magento2
1个回答
0
投票

为了更改状态,我们使用了V1 / orders / {orderId} / comments端点。填写以下字段(在请求正文中提供示例值)。

{
   "statusHistory" : {
        "comment": "Payment Successful",
        "is_customer_notified": 1,
        "is_visible_on_front": 0,
        "parent_id": 121123,  <-- This is orderId
        "status": "processing"
    }
}

API Reference

© www.soinside.com 2019 - 2024. All rights reserved.