$url = 'https://' . $STORE_URL . '/admin/api//2023-07/fulfillments.json';
$ch = curl_init();
$abc = '{
"fulfillment": {
"line_items_by_fulfillment_order": [
{
"fulfillment_order_id": 5404222980327
}
],
"notify_customer" => false,
"tracking_info": {
"number": "MS1562678",
"url": "https://www.my-shipping-company.com?tracking_number=MS1562678"
},
"location_id": 71680327911
}
}';
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_POSTFIELDS, $abc);
$headers = array();
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/json", "X-Shopify-Access-Token: {$accessToken}"));
$results = curl_exec($ch);
//$results=json_encode($results);
$results=json_decode($results,true);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); //can check status code, requst successfully processed if return 200
var_dump($http_code);
var_dump($results);
if (curl_errno($ch)) {
echo 'Error:' . curl_error($ch);
}
curl_close($ch);
this is my code I’m getting int(400) NULL error or sometimes 404 not found error while trying to fulfill the order.