我正在尝试删除通过 API 创建的定价规则。创建 API 工作正常,但不知何故删除不起作用。这是我的代码
$shop = "my-shopify-shop";
$token = "1321312312312321311";
$api_endpoint="/admin/api/2020-01/price_rules/#627965853827.json";
$url = "https://" . $shop . ".myshopify.com" . $api_endpoint;
$header=array('Content-Type: application/json','Authorization:Basic Og==','X-Shopify-Access-Token: ' .$token);
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_HTTPHEADER,$header);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_VERBOSE, 0);
curl_setopt($curl, CURLOPT_HEADER, 1);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST,"DELETE");
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
$response = curl_exec ($curl);
if (curl_errno($curl)) {
die('Couldn\'t send request: ' . curl_error($curl));
}
curl_close ($curl);
print_r($response);
我得到这样的输出
我错过了什么?任何人都可以建议吗?