Update order status using api

Hi,

I am app developer, I want to update order from API.

I want to update unfulfilled to fulfilled.

Hello ankesh2,

  1. To Update order status unfulfilled to fulfilled used Below API.

i) PUT /admin/api/#{api_version}/orders/#{order_id}.json

{
ā€œorderā€: {
ā€œidā€: {order_id},
ā€œfulfillment_statusā€: ā€œfulfilledā€
}
}

Note : Below is the example of how to use order API
{store_url}/admin/api/#{api_version}/orders/#{order_id}.json’, ā€˜METHOD’ => ā€˜PUT’, ā€˜DATA’ => $data

Thanks for the reply but could you please share any example. It’s very help full to me.

API call successfully but fullfilled status not updated

 'https://yourstore.myshopify.com/admin/api/2021-10/orders/4216684806316/fulfillments.json',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{"fulfillment":{"location_id":4564654}}',
  CURLOPT_HTTPHEADER => array(
    'X-Shopify-Access-Token:{Token}',
    'Content-Type: application/json'
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

You can update like this