I am trying to Fullfill order with Admin API and getting 404 Error (Urgent)

Highlighted
New Member
1 0 0

Hi, 

   I am trying to fullfill order with admin api, everytime it gives error if there is any paramter missing but when i full fill requirments it return, i am replacing order id and access token

{"errors":"Not Found"} 

 

Here is the Code

 

$field = array('fulfillment' => array(

'location_id' => 616291861,
   'tracking_number' => 123412312312356789,
   'tracking_urls' => array('https://shipping.xasdfayz/track.php?num=123456789'),
   'notify_customer' => false
)
   
);

$fields = json_encode($field);

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://abc.myshopify.com/admin/orders/12315555/fulfillments.json",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => $fields,
  CURLOPT_HTTPHEADER => array(
    "cache-control: no-cache",
    "Content-Type: application/json",    
    "x-shopify-access-token: acc_token"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}

0 Likes
Highlighted
New Member
1 0 0

I am having the same problem.  This worked a week ago when I was building the feature.  Now we are ready to go live and every order is returning a 404 when trying to fulfill it.


-------

Update: 

I fixed my problem.  I was using the variant ids for the line items when fulfilling the order.  These need to be the line item ids that correspond to your products found in the order data.

0 Likes
Highlighted
Tourist
5 1 0

I have a similar trouble, often when i try to make a fullfill with api via app it returns Errors: " ( {\"errors\":\"Not Found\"} ) ".

If i try same call with postman it works, an example: 

 

Call orders/1978292731990/fulfillments.json failed.

 

Request: {"fulfillment":{"location_id":"15180529750","tracking_number":"1Z04230A0370468478","line_items":[{"id":4395410292822,"quantity":1,"sku":"75003EC"},{"id":4395410292822,"quantity":1,"sku":"75003EC"},{"id":4395410292822,"quantity":1,"sku":"75003EC"},{"id":4395410423894,"quantity":2,"sku":"76000"},{"id":4395410423894,"quantity":2,"sku":"76000"},{"id":4395410423894,"quantity":2,"sku":"76000"},{"id":4395410325590,"quantity":1,"sku":"76002EC"},{"id":4395410358358,"quantity":1,"sku":"76004"},{"id":4395410358358,"quantity":1,"sku":"76004"},{"id":4395410358358,"quantity":1,"sku":"76004"},{"id":4395410391126,"quantity":1,"sku":"76008"}],"tracking_company":"BRT","tracking_urls":["https:\/\/vas.brt.it\/vas\/sped_ricdocmit_load.hsm?rma=1Z04230A0370468478&ksu=2222126"]}}

 

Errors: " ( {\"errors\":\"Not Found\"} ) " 

 

My app retry to make call untill it return ok and finally works but i don't understand why it get error sometimes.

0 Likes