title: Unable to cancel order using magento 2 REST API
body: <p>I am using following Magento 2 REST API, for cancel order-</p>
  
  <pre><code>hostname/magento/index.php/rest/V1/orders/1/cancel
  </code></pre>
  
  <p>where 1 is order id.
  but it return always false i.e order is not cancel using this API.</p>
  
  <p>then, i create a method for cancel order again no success.my method syntax is,</p>
  
  <pre><code>    use Magento\Sales\Api\OrderManagementInterface;
      private $orderManagement;
      public function __construct(
             Magento\Sales\Api\OrderManagementInterface $orderManagement)
          {
  
              $this-&gt;orderManagement = $orderManagement;
          }
          public function cancelOrder($orderId){
                  $isCanceled = $this-&gt;orderManagement-&gt;cancel($orderId);
                  return $isCanceled;
              }
  </code></pre>
  
  <p>and webapi.xml syntax is,</p>
  
  <pre><code>&lt;route url="/V1/orders/cancelOrder/:orderId" method="GET"&gt;
          &lt;service class="MyClient\MyProducts\Api\ProductByInterface" method="cancelOrder"/&gt;
          &lt;resources&gt;
              &lt;resource ref="anonymous"/&gt;
          &lt;/resources&gt;
      &lt;/route&gt;
  </code></pre>
  
  <p>what i am doing wrong please suggest me to cancel order process.</p>