Mint a one-shot signed upload URL for a product you own.
Authenticated. OAuth (scope `products:write`) preferred; `api_key` fallback.
Use this when you have **local image bytes** (a file the user attached,
bytes you generated/downloaded in your sandbox) and you want to attach
them to a product that already exists. Common cases:
- `create_product` returned 409 (duplicate name) — the listing already
exists; this tool gives you an upload URL for it without creating
anything new.
- You're adding a 2nd, 3rd, … photo to a product.
The returned URL is valid for ~15 min, single product, signed with
your authenticated identity. From your sandbox, do **one PUT**:
requests.put(result["upload_url"],
data=open("/path/to/photo.jpg", "rb").read(),
headers={"Content-Type": "image/jpeg"})
No auth header on that PUT — the URL is the credential.
If you have a public URL (not local bytes), use
`upload_product_image(product_id, image_url=...)` instead.
Args:
product_id: Product to attach the future image to. You must own it.
api_key: Legacy/fallback auth. Omit when using OAuth.
Returns:
``{"upload_url": str, "upload_expires_in": int}``, or
``{"error": ...}`` on auth/ownership failure.
Connector