The following code will return the order details.All we have to do is that we have to pass the order id
<?php $magentoURL = "http://127.0.0.1/mage2/"; $apiURL = $magentoURL."index.php/rest/V1/integration/admin/token"; $data = array("username" => "apiuser", "password" => "apiuserpwd"); $data_string = json_encode($data); $ch = curl_init($apiURL); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/json","Content-Length: ".strlen($data_string))); $token = curl_exec($ch); $requestUrl =$magentoURL.'index.php/rest/V1/orders/3'; $ch = curl_init($requestUrl); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/json", "Authorization: Bearer " . json_decode($token))); $result = json_decode(curl_exec($ch)); echo "<pre>";print_r($result); ?>