如何在 Magento 2 中使用 REST API 将状态从 'Pending Payment' 更改为 'Processing'

How to change the status from 'Pending Payment' to 'Processing' using REST API in Magento 2

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

Creating Order in Magento 2

一旦付款被捕获,状态就不会从 待付款 更改为 正在处理。但是,如果我们从管理面板中为订单单击 获取付款更新 选项,状态将更改为 正在处理。知道需要调用哪个 REST API 来将状态更改为 'Processing' 吗?

为了更改状态,我们使用了 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