// Create a client for our merchant and log in
$client = new GSC_Client($creds["merchantId"]);
$client->login($creds["email"], $creds["password"]);
// Insert a product so we can delete it
$id = "SKU124";
$country = "US";
$language = "en";
$product = buildMockProduct($id, $country, $language);
$product = $client->insertProduct($product);
echo 'Inserted: ' . $product->getTitle() . "\n";
// Create a dummy <atom:entry> element to include as a batch delete
$dummyDeleteEntry = new GSC_Product();
$dummyDeleteEntry->setBatchOperation("delete");
// set the atom id element as specified by the batch protocol
$editLink = $client->getProductUri($id, $country, $language);
$dummyDeleteEntry->setAtomId($editLink);
$batch = new GSC_ProductList();
$batch->addEntry($dummyDeleteEntry);
// Finally send the data to the API
$feed = $client->batch($batch);
$products = $feed->getProducts();
$operation = $products[0];
echo 'Deleted: ' . $operation->getTitle() . "\n";
echo 'Status: ' . $operation->getBatchStatus() . "\n";
/**
 * Credentials - Enter your own values
 *
 * @author afshar@google.com
**/
class Credentials
{