allegro / allegro-api

Issue tracker and wiki for Allegro REST API
https://developer.allegro.pl/
217 stars 39 forks source link

Brand of product placed in several categories #10339

Open hlupec opened 5 days ago

hlupec commented 5 days ago

Hi,

I have a problem with creating offers when the product is placed in several categories. For example product 8591120021003 is placed in category for "normal" radiostations but also in children walkies. In default category, product has assigned brand "Allamat" and its ok. But when I want to create offer with this product to category for children, brand is not set (and Allamat is not in listing).

I'm dealing with this while programming API , but same behavior appears in your Salescenter. Wouldn't it be better to keep brand accross categories?

And API does not allow me to set brand only for offer but I must make product change proposal, but when I try to create offer from Salescenter, i can set brand just for offer.

PrzemyslawLukanowski commented 5 days ago

Hi,

As a workaround, you can add the non-existing value as a custom value. For example, like below:

{
    "productSet": [
        {
            "product": {
                "id": "1983ee2f-44b1-4850-89e7-73e40a94d6b3",
                "parameters": [
                    {
                        "id": "127812",
                        "valuesIds": [
                            "127812_24"
                        ],
                        "values": [
                            "Allamat"
                        ]
                    }
                ]
            }
        }
    ],
    "sellingMode": {
        "price": {
            "amount": "xx",
            "currency": "PLN"
        }
    },
    "stock": {
        "available": 10
    },
    "publication": {
        "status": "INACTIVE"
    },
    "category": {
        "id": "312545"    
    }
}

Unfortunately, currently, it is the only solution.

I'll forward your observation to the team responsible for the product catalog and categories. Sorry for the inconvenience.

hlupec commented 5 days ago

Awesome, it works :) When I tried it before, I put "parameters" to main level of json because there can be some "parameters" too according to docs: https://developer.allegro.pl/documentation#operation/createProductOffers I didn't notice there are some parameteres hidden in productSet section. Thanks a lot.

PrzemyslawLukanowski commented 5 days ago

Yes, that's because parameter can describe offers or products. We return that information In the GET /sale/categories/{categoryId}/parameters, in the options.describesProduct field.