Update order status using api

ankesh2
Visitor
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
15905 2378 3087

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

Get pass your Store Core Web Vital Free Speed Optimization Audit, Chat on WhatsApp | Skype : oscprofessionals-87 | Email: pallavi@oscprofessionals.com | Hire us | Guaranteed Site Speed Optimization | Website Free Audit | Shopify Theme Customization | Build Shopify Private App | Shopify SEO | Digital Marketing | Oscp Upsell & Cross sell App : Free | Oscp Sales & Volume Discount App : Free | Custom Pricing Wholesale App : Free
ankesh2
Visitor
2 0 0

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

 

test111
Visitor
1 0 1

API call successfully but fullfilled status not updated 

arsl
Visitor
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