Reputation: 13556
I'm stumped. Etsy has a ListingVariationImage
endpoint (/listings/:id/variation-images
) to which one POSTs an array of tuples, {property_id, value_id, image_id}
.
I want to assign Color: Black to an image, so I post {property_id=200, value_id=1, image_id=MYID}
. 200 is the property_id for "Primary color", 1 is the value_id for "Black", and MYID is a valid image id. This is what I get in response:
HTTP 400: variation with property_id 200 and value_id 1 is invalid
I have tried manually setting the variation-images for this listing in the Etsy UI (Color: Black to my image), then fetching the variation-images from the API. I get back this:
{property_id=200, value_id=49928889190, image_id=2420286876}
What on earth is 49928889190? When I fetch the inventory of this listing, that valueId
does not show up at all. It's not in the taxonomy node properties for graphic tees (which is what this listing is set to). I can't find it anywhere in the API.
How do I use the Etsy API to assign images to property values using the variation-images endpoint?
Upvotes: 1
Views: 771
Reputation: 1
Looking at Etsy Listings Tutorial in the first "Note on taxonomy", it seems that the values the questioner entered (color scale:200 color Black:1) were correct but it seems they cannot be used in other api calls.
If these values were entered as properties for a black listing product (using the updateListingProperty endpoint), Etsy would convert the common value 1 into a unique value for the Etsy shop: 49928889190 (the value seen when the UI was used to set the image against a black product variation).
Therefore, if the response from a call to the updateListingProperty endpoint is captured, the unique shop property id should be available for use in other api caqlls.
Upvotes: 0
Reputation: 948
Please check the details of your listing id using the API endpoint for getAttributes
GET /listings/:listing_id/attributes
than go into detail for your one specific property 200 with getAttribute
GET /listings/:listing_id/attributes/200
https://www.etsy.com/developers/documentation/reference/propertyvalue
If you have property_id 200 defined, it seems that a value_id 1 is not a defined value yet.
Please update the property as you want to have it. updateAttribute
PUT /listings/:listing_id/attributes/200
The Etsy API documentation states in several examples property and value mappings but does not explicitly mention that you have to configure those things first OR (if created via UI) check which IDs were used in your App context.
Upvotes: 1