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