Sample code for 30+ languages & platforms
PHP ActiveX

Shopify Delete Product

See more Shopify Examples

Delete a product from the shop.

Chilkat PHP ActiveX Downloads

PHP ActiveX
<?php

$success = 0;

$rest = new COM("Chilkat.Rest");

$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 . "\n";
    exit;
}

$sbResponse = new COM("Chilkat.StringBuilder");
$success = $rest->FullRequestNoBodySb('DELETE','/admin/products/#{id}.json',$sbResponse);
if ($success != 1) {
    print $rest->LastErrorText . "\n";
    exit;
}

if ($rest->ResponseStatusCode != 200) {
    print 'Received error response code: ' . $rest->ResponseStatusCode . "\n";
    print 'Response body:' . "\n";
    print $sbResponse->getAsString() . "\n";
    exit;
}

print 'Example Completed.' . "\n";

?>