public function deleteProductBatch($offer_ids) { $entries = array(); foreach ($offer_ids as $key => $offer_id) { $entry = new Google_Service_ShoppingContent_ProductsCustomBatchRequestEntry(); $entry->setMethod('delete'); $entry->setBatchId($key); $entry->setProductId($this->buildProductId($offer_id)); $entry->setMerchantId($this->merchant_id); $entries[] = $entry; } $batch_request = new Google_Service_ShoppingContent_ProductsCustomBatchRequest(); $batch_request->setEntries($entries); $batch_responses = $this->service->products->custombatch($batch_request); $errors = 0; foreach ($batch_responses->entries as $entry) { if (!empty($entry->getErrors())) { $errors++; } } print "Requested delete of batch inserted test products\n"; printf("There were %d errors\n", $errors); }