I want all orders from a particular orderId.
<?php
namespace Racom\Chatbotapi\Model;
use Racom\Chatbotapi\Api\ChatbotapiInterface;
class Chatbotapi implements ChatbotapiInterface
{
protected $order;
public function __construct(
\Magento\Sales\Model\Order $order
) {
$this->order = $order;
}
/**
* Returns the Orders list.
*
* @api
* @param Integer $orderId order Id.
* @return string Greeting message with users name.
*/
public function getOrder($orderId)
{
$productCollection = $this->order->load($orderId);
$a = $productCollection->getItems();
$v = json_encode($a);
return $v;
}
}