PHP
PHP
Shopify Delete Product
See more Shopify Examples
Delete a product from the shop.Chilkat PHP Downloads
<?php
use Chilkat2\Rest;
use Chilkat2\StringBuilder;
$rest = new Rest();
$rest->SetAuthBasic('SHOPIFY_PRIVATE_API_KEY', 'SHOPIFY_PRIVATE_API_SECRET_KEY');
try {
$rest->Connect('chilkat.myshopify.com', 443, true, true);
$sbResponse = new StringBuilder();
$rest->FullRequestNoBodySb('DELETE', '/admin/products/#{id}.json', $sbResponse);
} catch (\Chilkat2\Exception $e) {
echo $e->getMessage(), "\n";
exit;
}
if ($rest->ResponseStatusCode != 200) {
echo 'Received error response code: ', $rest->ResponseStatusCode, "\n";
echo "Response body:\n";
echo $sbResponse->GetAsString(), "\n";
exit;
}
echo "Example Completed.\n";