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

[BUG] - Variation with property_id 200 and value_id xxx is invalid

Open carlosmartinez-dev opened this issue 3 years ago • 12 comments

Describe the bug When I am attempting to invoke the V3 API

https://openapi.etsy.com/v3/application/shops/<shop_id>/listings/<listing_id>/variation-images,

I am getting following error:

Could not update variation images because of the following error: variation with property_id 200 and value_id 49928889190 is invalid

The endpoint I am using to get the value_id is also from V3:

https://openapi.etsy.com/v3/application/shops/<channel_shop_id/listings/<listing_id>

This issue seems to be already reported here but I did not find it here in etsy/open-api.

Additional context

{
    "message": "Bad Request",
    "status": 400,
    "text": "{\"error\":\"Could not update variation images because of the following error: variation with property_id 200 and value_id 49928889190 is invalid\"}\n",
    "method": "POST",
    "path": "/v3/application/shops/30715180/listings/1118340250/variation-images",
    "url": "https://openapi.etsy.com/v3/application/shops/30715180/listings/1118340250/variation-images",
    "params": {
        "variation_images": [
            {
                "value_id": 49928889190,
                "property_id": 200,
                "image_id": 3507876610
            },
            {
                "value_id": 52041479579,
                "property_id": 200,
                "image_id": 3555507685
            },
            {
                "value_id": 49928889192,
                "property_id": 200,
                "image_id": 3507876610
            }
        ]
    }
}

carlosmartinez-dev avatar Dec 06 '21 20:12 carlosmartinez-dev

@carlosmartinez-dev I deployed a change today that might help fix this issue. The ID returned on the listing query may be different now. Can you try it again and let me know?

etsyachristensen avatar Dec 09 '21 03:12 etsyachristensen

Thanks @etsyachristensen , let me retry and let you know

carlosmartinez-dev avatar Dec 09 '21 20:12 carlosmartinez-dev

@etsyachristensen same issue, I tried updating the images for the variations and actually I am getting same value_ids:

{
    "message": "Bad Request",
    "status": 400,
    "text": "{\"error\":\"Could not update variation images because of the following error: variation with property_id 200 and value_id 49928889190 is invalid\"}\n",
    "method": "POST",
    "path": "/v3/application/shops/30715180/listings/1137960205/variation-images",
    "url": "https://openapi.etsy.com/v3/application/shops/30715180/listings/1137960205/variation-images",
    "params": {
        "variation_images": [
            {
                "value_id": 49928889190,
                "property_id": 200,
                "image_id": 3554300469
            },
            {
                "value_id": 49928889192,
                "property_id": 200,
                "image_id": 3555507685
            },
            {
                "value_id": 52041479579,
                "property_id": 200,
                "image_id": 3508915006
            }
        ]
    }
}

carlosmartinez-dev avatar Dec 09 '21 21:12 carlosmartinez-dev

Hi @etsyachristensen, happy new year 😄, any news on this one?

carlosmartinez-dev avatar Jan 04 '22 20:01 carlosmartinez-dev

I think I'm getting this also, today with a freshly created draft listing, I think it's because I don't understand how to get value_id values for my custom colours. I find the tutorial at https://developers.etsy.com/documentation/tutorials/listings does not explain how to create value_id values for custom property values. @carlosmartinez-dev maybe this is similar to your situation?

I tried to create a draft listing with custom colours, so when calling application/listings/$listing_id/inventory I set up the 'products' array with property_values with my colours, but I did not know what to use for the value_ids, so I just made them up, e.g.:

property_values: [
  [ property_id: 200,
  property_name: 'Primary color',
  scale_id: null,
  scale_name: null,
  value_ids: [ 55998730829 ] // This is totally bogus
  values: [ 'Anthracite Grey' ] // our custom colour name
  ]
]

When I later try to associate images to these variations, because the value_ids I used for the property_values in the listing were made up, I got a variation with property_id 200 and value_id 1 is invalid error. (the first is actually Black i.e. value_id 1, but because I had set the property_values entry for "Black" to my hardcoded value_id 55998730829, the value_id 1 doesn't exist on my listing, hence the error).

If, instead, I create the listing using only "official" colour properties, then associating listing images with variations succeeds because the value_id values match. e.g. I got the colour value_id values by calling application/seller-taxonomy/nodes/989/properties and iterating the values for property_id 200 ("Primary color") so I'm sure they are known by Etsy. e.g. value_id 1 is "Black". So right now, when creating the inventory on the listing, I am mapping all my custom colour to only those found in the "Primary colors" list, e.g. our "Anthracite Grey" product has to be called just "Gray" on Etsy with a value_id of 5, but we really don't want to do this because our custom colour names are very popular and good for SEO.

How did you get your value_id values like 49928889190? Are these custom colour names that you want to use, like me, that don't exist in the "Primary color" list in the taxonomy data?

neekfenwick avatar Jan 20 '22 08:01 neekfenwick

Hi @neekfenwick , sorry for the late reply. I get the value_id like 49928889190 by first making a call to this api https://www.etsy.com/developers/documentation/reference/listing and including Variations in the parameters (this is an association described here https://www.etsy.com/developers/documentation/reference/listing#section_associations), the response contains the value_id that I am suppose to use to later make the update but it is failing. Note that this only happens for variations which Property id = 200 (Primary color).

Another way to get the value_id that I have not tried yet is with this API: https://www.etsy.com/developers/documentation/reference/listingvariationimage

carlosmartinez-dev avatar Mar 07 '22 17:03 carlosmartinez-dev

@etsyachristensen have u had an opportunity to check this?

yovasx2 avatar Mar 16 '22 20:03 yovasx2

V2 also failing:

2022-03-17T20:40:21.780Z ==> error: Upload failed for product 7303685 - applyOps shopId 25190 userDb db5. Error: Error: {"message":"Bad Request","status":400,"text":"variation with property_id 200 and value_id 51995096597 is invalid","method":"POST","path":"/v2/listings/1195609441/variation-images","url":"https://openapi.etsy.com/v2/listings/1195609441/variation-images","params":{"variation_images":[{"value_id":51995096597,"property_id":200,"image_id":3742704174},{"value_id":51985709075,"property_id":200,"image_id":3790294095}]}}. Stack: Error: {"message":"Bad Request","status":400,"text":"variation with property_id 200 and value_id 51995096597 is invalid","method":"POST","path":"/v2/listings/1195609441/variation-images","url":"https://openapi.etsy.com/v2/listings/1195609441/variation-images","params":{"variation_images":[{"value_id":51995096597,"property_id":200,"image_id":3742704174},{"value_id":51985709075,"property_id":200,"image_id":3790294095}]}}

yovasx2 avatar Mar 18 '22 00:03 yovasx2

we detected a similar error for another property id 513

2022-05-11T19:32:02.054Z ==> error: error handled: Error: {"message":"cannot POST /v3/application/shops/20394897/listings/855095251/variation-images (400)","status":400,"text":"{\"error\":\"Could not update variation images because of the following error: variation with property_id 513 and value_id 55180423543 is invalid\"}\n","method":"POST","path":"/v3/application/shops/20394897/listings/855095251/variation-images","url":"https://openapi.etsy.com/v3/application/shops/20394897/listings/855095251/variation-images","params":{"variation_images":[{"value_id":55180423543,"property_id":513,"image_id":2469059494}]}}. Custom message: Product ID 9321162, correlationId: 68b052a1-6fcb-4317-a5b6-940f8b62ab4e, shopId: 12093, userDb: db4

yovasx2 avatar May 11 '22 19:05 yovasx2

@yovasx2 I just checked and that value_id belongs to property id 514, not 513: image

etsyachristensen avatar May 11 '22 20:05 etsyachristensen

we obtained the ids from the properties endpoint is that wrong?

yovasx2 avatar May 12 '22 17:05 yovasx2

No that is how it should be done, but is that endpoint showing you that value id being tied to property 513? It shouldn't be.

etsyachristensen avatar May 12 '22 18:05 etsyachristensen