Update order status using api

ankesh2
New Member
2 0 0

Hi,

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

I want to update unfulfilled to fulfilled.

Replies 4 (4)
oscprofessional
Shopify Partner
11467 1801 2307

Hello 
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

Please Like and Accept Solution. Free website audit to grow your business Chat on WhatsApp | Email: pallavi@oscprofessionals.com | Skype : oscprofessionals-87 | Hire us | Expert Site Speed Optimization | Performance Site Audit | Shopify Private App | Custom Theme Development & Modifications any Shopify Theme | Shopify SEO | Digital Marketing
ankesh2
New Member
2 0 0

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

 

test111
New Member
1 0 1

API call successfully but fullfilled status not updated 

arsl
New Member
1 0 0
<?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