Required parameter missing or invalid error + PHP/Curl in shopify order status update

Highlighted
New Member
2 0 0

$url = 'https://api_key:api_password@sitename.myshopify.com/admin/api/{api_version}/orders/{order_id}.json';
$order_id = {order_id};
$data = array("Order"=>
array(
"id"=> $order_id,
"fulfillment_status"=>"fulfilled"
)
);
$ch = curl_init($url);

$payload = json_encode($data);

curl_setopt( $ch, CURLOPT_POSTFIELDS, $payload );
curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, "PUT");
curl_setopt( $ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));
# Return response instead of printing.
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
# Send request.
$result = curl_exec($ch);
curl_close($ch);
# Print response.
$character = json_decode($result);
print_r($character);

 

i am trying to update the status of the order to fulfilled, when i try this in post man results showing 200 OK but my order status is not updating. while using curl an error message is showing "stdClass Object ( [errors] => stdClass Object ( [order] => Required parameter missing or invalid ) ) "

 

please help me to solve the issue.

0 Likes