Hi Chris Here is the details of deleting and uploading products via API.
You can make a loop to call the API and delete all your products one by one. Few days back when i wanted to delete all products I was told I will have to delete them on by one. So I created a script for my self in python.
first of all create an auth token by entering this in your terminal
gcloud auth application-default print-access-token
and copy this token to use in authorization header
here is pythoncode
import pandas as pd
import requests as re
url = "https://retail.googleapis.com/v2/projects/<projectname>/locations/global/catalogs/default_catalog/branches/0/products/"
headers = { 'Authorization': 'Bearer generatedToken'}
df = pd.read_excel("/home/abubakar/Downloads/Documents/Product Data.xls")
# (df['id'].iloc[0])
try:
for i in df['id']:
res = re.delete(url=url+i ,headers=headers)
print(res)
except Exception as e :
print("Not deleted",e)