0

我想使用此代码在 shopify 应用程序中创建履行,但这并没有给我任何回应

我收到此响应以点击此 api

Continue

我的代码是:

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://key:paswrod@shop.myshopify.com/admin/api/2020-01/orders/#1047/fulfillments.json",
  CURLOPT_RETURNTRANSFER => true, 
  CURLOPT_MAXREDIRS => 10, 
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS =>"{\n  \"fulfillment\": {\n    \"location_id\": 39511785531,\n    \"tracking_number\": \"123456789\",\n    \"tracking_urls\": [\n      \"https://shipping.xyz/track.php?num=123456789\",\n      \"https://anothershipper.corp/track.php?code=abc\"\n    ],\n    \"notify_customer\": true\n  }\n}\n",
  CURLOPT_HTTPHEADER => array(
    "Content-Type: application/json",

  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
4

1 回答 1

0

#1047在请求 URL 中使用订单名称。您应该改用 Shopify 订单 ID。

于 2020-05-23T09:28:38.767 回答