Perl
Perl
Shopify Delete Product
See more Shopify Examples
Delete a product from the shop.Chilkat Perl Downloads
use chilkat();
$success = 0;
$rest = chilkat::CkRest->new();
$rest->SetAuthBasic("SHOPIFY_PRIVATE_API_KEY","SHOPIFY_PRIVATE_API_SECRET_KEY");
$success = $rest->Connect("chilkat.myshopify.com",443,1,1);
if ($success != 1) {
print $rest->lastErrorText() . "\r\n";
exit;
}
$sbResponse = chilkat::CkStringBuilder->new();
$success = $rest->FullRequestNoBodySb("DELETE","/admin/products/#{id}.json",$sbResponse);
if ($success != 1) {
print $rest->lastErrorText() . "\r\n";
exit;
}
if ($rest->get_ResponseStatusCode() != 200) {
print "Received error response code: " . $rest->get_ResponseStatusCode() . "\r\n";
print "Response body:" . "\r\n";
print $sbResponse->getAsString() . "\r\n";
exit;
}
print "Example Completed." . "\r\n";