PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Tuesday, August 23, 2022

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

 August 23, 2022     magento2     No comments   

Issue

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'?


Solution

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



Answered By - Venkata Subbarao
Answer Checked By - Willingham (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing