How can I fix interface errors with shipping orders?

Shopify Partner
15 0 0

I have received the shipment data for the order, as shown in the following figure


Next, I want to perform the shipping operation on the shipping order, using the interface:



The debugging code snippet is as follows:

$url = "";
$param = array();
$param['access_token'] = "********"; //Omitted for data security
$fulfillment = array();
$fulfillment['line_items_by_fulfillment_order'] = ['fulfillment_order_id' => '**'];
$fulfillment['tracking_info'] = ['number' => 'YT2331821292044240', "url" => ""];
$param['fulfillment'] = $fulfillment;
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_HEADER, 0);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($param));
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE);
$responseText = curl_exec($curl);

 But the interface reported an error:

string(76) "{"errors":{"line_items_by_fulfillment_order":"expected Hash to be a Array"}}"

How should I adjust my code?


Replies 0 (0)