Hello @ksho,
Thanks for posting your question!
This example currently works for me, though I am not exactly sure the syntax in your example is correct:
import requests
url = "https://api.squarespace.com/1.0/commerce/products/<product id>/images"
files=[
('file',('<filename>',open('<path to image>','rb'),'image/jpeg'))
]
headers = {
'Authorization': 'Bearer <api key>',
'User-Agent': '<your user-agent>'
}
response = requests.request("POST", url, headers=headers, files=files)
print(response.text)
Also, check that your images meets the platform requirements
Let me know if this resolves the issue!