open-api icon indicating copy to clipboard operation
open-api copied to clipboard

[BUG]: Updating Variation Images - Error: "variation images contains multiple property_ids"

Open DemiImp opened this issue 2 years ago • 5 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Describe the bug

I'm trying to update a listing to have the following variation images:

{"variation_images":[{"property_id":513,"value_id":104821235544,"image_id":3830827950},{"property_id":513,"value_id":104821235780,"image_id":3830827974},{"property_id":513,"value_id":104821235640,"image_id":3830827964},{"property_id":514,"value_id":62090053654,"image_id":3830828000},{"property_id":514,"value_id":136564187302,"image_id":3830828000},{"property_id":514,"value_id":1007254520364,"image_id":3830828000},{"property_id":514,"value_id":1082201811147,"image_id":3830828000},{"property_id":514,"value_id":997845751860,"image_id":3830828000},{"property_id":514,"value_id":139293056571,"image_id":3830828000}]}

I am receiving the following error:

{"error":"Could not update variation images because of the following error: variation images contains multiple property_ids"}

What does this error mean?

Here's the request UUID:

X-Etsy-Request-Uuid: EuQZjQcFmr2x84PCjXW8RHLSwu66

For further clarity, here's the original property_id/value_id/image_id list I received before I started updating the images and re-attaching the variations to the new images:

[{"property_id":513,"value_id":104821235544,"image_id":3826314222},{"property_id":513,"value_id":104821235780,"image_id":3826314286},{"property_id":513,"value_id":104821235640,"image_id":3826314282},{"property_id":514,"value_id":62090053654,"image_id":3826290712},{"property_id":514,"value_id":136564187302,"image_id":3826290712}, {"property_id":514,"value_id":1007254520364,"image_id":3826290712},{"property_id":514,"value_id":1082201811147,"image_id":3826290712},{"property_id":514,"value_id":997845751860,"image_id":3826290712},{"property_id":514,"value_id":139293056571,"image_id":3826290712}]

Steps to reproduce

I am not 100% certain how to reproduce. I don't understand the error message and I haven't been able to reproduce the error on my own account.

Expected behavior

All I'm doing is taking what I receive from the API and updating it with new image_id's. I would expect it to just work.

Additional context

No response

DemiImp avatar Apr 25 '22 22:04 DemiImp

@DemiImp I believe the solution is to make different calls to the updateListingImageVariations endpoint. Make one call for the ids for property 513 and one for property 514.

etsyachristensen avatar Apr 26 '22 17:04 etsyachristensen

The docs suggest that updating the variation images will wipe the old variation images:

The update overwrites all existing variation images on a listing, so if your request is successful, the variation images on the listing will be exactly those you specify.

Do you have any idea why when I request the existing variation images I get multiple property_id's? I cannot figure out how to reproduce the issue for testing. Is this just some legacy behavior that can no longer be replicated?

I will update my code to limit it to a single property_id.

DemiImp avatar Apr 26 '22 20:04 DemiImp

The get endpoint gives you all of them simply because don't have it setup to break them down by property id.

etsyachristensen avatar Apr 26 '22 21:04 etsyachristensen

I will check on the wording of that. I was under the impression that it would only wipe out the images for the specific variation you are uploading to (which is based on the property id).

etsyachristensen avatar Apr 26 '22 21:04 etsyachristensen

Were you able to check on how it's implemented? Will setting two different sets of property_id+image_id replace or add?

DemiImp avatar Apr 28 '22 21:04 DemiImp