Discussing APIs and development related to customers, discounts, and order management.
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
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => '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