0
votes

i have a test shop on shopify. When the orders are created I want to update their fulfilment status to "Fulfilled" via PHP API calls.

So far nothing is mentioned in the documentation to update the fulfilment status of the line items in the order.

Is there any way to do so?

2

2 Answers

0
votes

This is how I have it working now

$data = array( "fulfillment" => array("tracking_number" => "1111111111"));

$data_string = json_encode($data);                                                                                   

$ch = curl_init('https://API:[email protected]/admin/orders/ORDER_ID/fulfillments.json');
curl_setopt($ch, CURLOPT_HTTPHEADER, array(                                                                          
    'Content-Type: application/json',                                                                                
    'Content-Length: ' . strlen($data_string))                                                                       
);

curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$result = curl_exec($ch);
print_r($result);