• 0
Sign in to follow this  
LUCASFRADUSCO

Problema para crear item con variaciones - Attribute [Color] to be modified - id [null] should be [COLOR]

Question

Hola, 

Estoy intentando crear un item con variaciones, pero no estoy pudiendo. estoy enviando en el post todos los campos que veo en la documentación, pero no logro entender en el error que me devuelve mercado libre.

aquí el item que le envio a ML

Array
(
    [listing_type_id] => bronze
    [pictures] => Array
        (
            [0] => Array
                (
                    [source] => http://localhost:8888/seret2/uploads/img_products/2b46e4ea9969ecf373a8a95ab0c16e82.jpg
                )

            [1] => Array
                (
                    [source] => http://localhost:8888/seret2/uploads/img_products/fab377ccfcad74c59ff97daf5beccbfb.jpg
                )

            [2] => Array
                (
                    [source] => http://localhost:8888/seret2/uploads/img_products/f0441f1b499ab7d402b8d18d35ad1759.jpg
                )

        )

    [title] => PRODUCTO DEMO NO OFERTAR MAV
    [available_quantity] => 19
    [category_id] => MLA30069
    [buying_mode] => buy_it_now
    [currency_id] => ARS
    [condition] => new
    [site_id] => MLA
    [price] => 666.00
    [description] => Array
        (
            [plain_text] => descripcion DEMO NO OFERTAR
        )

    [attributes] => Array
        (
            [0] => Array
                (
                    [id] => BRAND
                    [value_name] => Marca de Iluminación 1.
                )

        )

    [variations] => Array
        (
            [0] => Array
                (
                    [attribute_combinations] => Array
                        (
                            [0] => Array
                                (
                                    [name] => Color
                                    [value_id] => 2055
                                    [value_name] => Verde
                                )

                        )

                    [price] => 666.00
                    [available_quantity] => 19
                    [attributes] => Array
                        (
                            [0] => Array
                                (
                                    [id] => EAN
                                    [value_name] => 40063813339311
                                )

                        )

                    [sold_quantity] => 0
                    [pictures] => Array
                        (
                            [id] => 909706-MLA41754712297_052020
                        )

                )

            [1] => Array
                (
                    [attribute_combinations] => Array
                        (
                            [0] => Array
                                (
                                    [name] => Color
                                    [value_id] => 2056
                                    [value_name] => azul
                                )

                        )

                    [price] => 666.00
                    [available_quantity] => 3
                    [attributes] => Array
                        (
                            [0] => Array
                                (
                                    [id] => EAN
                                    [value_name] => 40063813339311
                                )

                        )

                    [sold_quantity] => 0
                    [pictures] => Array
                        (
                            [id] => 909706-MLA41754712297_052020
                        )

                )

        )

)

y aquí la respuesta de ML

Array
(
    [body] => stdClass Object
        (
            [message] => Validation error
            [error] => validation_error
            [status] => 400
            [cause] => Array
                (
                    [0] => stdClass Object
                        (
                            [department] => structured-data
                            [cause_id] => 1010
                            [type] => warning
                            [code] => normalize.item.attribute.id
                            [references] => Array
                                (
                                    [0] => item.variations[0].attribute_combinations[0].id
                                )

                            [message] => Attribute [Color] to be modified - id [null] should be [COLOR]
                        )

                    [1] => stdClass Object
                        (
                            [department] => items
                            [cause_id] => 409
                            [type] => error
                            [code] => item.pictures.variation.quantity
                            [references] => Array
                                (
                                    [0] => item.variations.picture_ids
                                    [1] => item.category_id
                                )

                            [message] => Every variation of category MLA30069 must have between 1 and 10 pictures.
                        )

                    [2] => stdClass Object
                        (
                            [department] => structured-data
                            [cause_id] => 1010
                            [type] => warning
                            [code] => normalize.item.attribute.id
                            [references] => Array
                                (
                                    [0] => item.variations[1].attribute_combinations[0].id
                                )

                            [message] => Attribute [Color] to be modified - id [null] should be [COLOR]
                        )

                )

        )

    [httpCode] => 400
)

gracias de antemano

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Si no me equivoco te esta pidiendo que envíes el ID del atributo a variar, este caso es el color. Tu estas enviando para el verde algo así:

[name] => Color
[value_id] => 2055
[value_name] => Verde

Pero tienes que enviar esto:

[id] => COLOR
[name] => Color
[value_id] => 2055
[value_name] => Verde

Si no tienes los ID's puedes probar así:

[name] => Color
[value_name] => Verde

 

Saludos!!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this