Fulfilment API issue

New Member
5 0 0

I'm trying to add the Tracking Number to the order, but it never works. But the service does show up correctly. Can you let me know what I'm doing wrong?

 

array (
  'fulfillment' => 
  array (
    'location_id' => 8356757557,
    'id' => '1229114998837',
    'fulfillment_status' => 'fulfilled',
    'notify_customer' => 'true',
    'service' => 'manual',
    'shipment_status' => 'confirmed',
    'tracking_company' => 'USPS',
    'tracking_numbers' => 
    array (
      0 => '9405511699000824691494',
    ),
  ),
)
 
{"fulfillment":{"location_id":8356757557,"id":"1229114998837","fulfillment_status":"fulfilled","notify_customer":"true","service":"manual","shipment_status":"confirmed","tracking_company":"USPS","tracking_numbers":["9405511699000824691494"]}}
0 Likes
Shopify Staff
Shopify Staff
1028 68 135

Hey @illcurrency , 

 

When checking our logs, it looks like the fields in your API call are being sent with the word 'fulfillment' in front of them. So, for example, instead of 'tracking_numbers' it's being sent as 'fulfillment_tracking_numbers'. When copying this behaviour and testing it myself, this results in the tracking information not carrying over to the fulfillment when it is created. 

 

I'd suggest taking a look at these calls before they're made and make sure that they're formatted in the way that our documentation shows them because I noticed that there were some values that weren't necessary in the call too (ex. creating a fulfillment with a 'fulfillment_id' field equal to the order's ID isn't needed). 

 

Hope this helps! But let me know if you need me to take a look again if you're still having problems.

0 Likes
Highlighted
New Member
5 0 0

Thank you!

0 Likes
Shopify Staff
Shopify Staff
1028 68 135

Hey again @illcurrency , 

 

I saw your other forum post - would you mind keeping the information/discussion in here though? I understand you're still having issues, would you be able to link me to an order ID that is missing tracking information? (Apologies, I removed the other post thinking it was a duplicate)

0 Likes
New Member
5 0 0

Hi @Josh 

 

Thank you  so much for the reply and your continued help with this.


This order should have a tracking number attached. We used the API and submitted the correct JSON data for it to appear.

 

https://illcurrency-com.myshopify.com/admin/orders/1235892830261

 

Thank you!

0 Likes
Shopify Staff
Shopify Staff
1028 68 135

Hey again @illcurrency ! 

 

That order looks to be the same as the one mentioned previously, the fields in your API call are being sent to us as "fulfillment_tracking_number" for example as opposed to just "tracking number" - the same applies to all of the other fields being sent as well. 

 

I can't really speak to how or where this is happening, but when copying that behaviour with my own test calls this does prevent the tracking number from working properly. 

0 Likes
New Member
5 0 0

@Josh 

 

We're using the Official Shopify PHP SDK. It shouldn't be automatically adding a prefix to each key. Is there something I'm missing in the docs?

 

 

$updateInfo = array (
"fulfillment" => array(
"location_id" => 8356757557,
"id" => 1239715708981,
"fulfillment_status" => "fulfilled",
"notify_customer" => "true",
"service" => "manual",
"shipment_status" => "confirmed",
"tracking_company" => "USPS",
"tracking_number" => 9405511699000851511611,
));

$shopify->Order(1239715708981)->Fulfillment->POST($updateInfo);

 

 

0 Likes
New Member
5 0 0

@Josh Still waiting for your reply. We're doing everything right here, but you're still saying the data is going into the system wrong.

 

Are tracking numbers suppose to be entered as Arrays?

 

i.e. "tracking_numbers": [
"112345Z2345"
]

 

If not, please let me know what's wrong.

0 Likes
Shopify Staff
Shopify Staff
1028 68 135

Hey again @illcurrency , 

 

I wanted to mention that Shopify doesn't have an official PHP library, they are all made my third parties. I am not a PHP expert by any means either, so it's hard to say what is happening here for sure but it try something along these lines and see if it helps. 

 

$updateInfo = array (

"location_id" => 8356757557,

"id" => 1239715708981,

"fulfillment_status" => "fulfilled",

"notify_customer" => "true",

"service" => "manual",

"shipment_status" => "confirmed",

"tracking_company" => "USPS",

"tracking_number" => 9405511699000851511611,

);



$shopify->Order(1239715708981)->Fulfillment->POST($updateInfo);
0 Likes