Venkata Subbarao
Venkata Subbarao

Reputation: 420

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

We are using REST API interface of Magento 2.3.4 to process orders. Followed 7 steps given in the following link and also added code to capture the payment.

Creating Order in Magento 2

As soon as the payment is captured the status doesn't change from Pending Payment to Processing. However, if we click on Get Payment Update option from Admin panel for the order, status changes to Processing. Any idea which REST API needs to be called to change the status to 'Processing'?

Upvotes: 1

Views: 1985

Answers (1)

Venkata Subbarao
Venkata Subbarao

Reputation: 420

To change the status we used V1/orders/{orderId}/comments end point. Fill in the following fields(Sample value is given in the request body).

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

API Reference

Upvotes: 1

Related Questions