FROM CACHE - zh-cn_header
此社区已转向点对点支持。Shopify 支持团队将不再为此社区提供服务。我们建议您与其他商家和合作伙伴建立联系以获取帮助,并分享您的经验! 如发现有任何违反我们行为准则的行为或您希望删除的内容,欢迎继续举报。

Interface issues with shipping orders

Interface issues with shipping orders

GermanDrop1
Shopify Partner
2 0 1

By interface:

admin/api/2023-04/orders/5565680353588/fulfillment_orders.json

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

GermanDrop1_0-1700194147604.png

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

admin/api/2023-04/fulfillments.json

The debugging code snippet is as follows:

$url = "https://494782508ceshi.myshopify.com/admin/api/2023-04/fulfillments.json";
$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" => "https://www.track718.com/en/detail?nums=YT2331821292044240"];
$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);
curl_close($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?

 

0 条回复0