Closed alejandroferrercecotec closed 2 years ago
Images are in incorrect format, look here: https://developer.allegro.pl/redoc/redoc-static.html#operation/proposeSaleProduct
images should look like:
"images": [
{
"url": url_here
},
{
"url": url_here
},
...
]
If you try to add a new product you should remember that at least one image should be added directly to a product section - in your request you added images to the offer part. Please, look into our tutorial and its part about images.
I'm using application/vnd.allegro.beta.v2+json for an existing product. I tried with both answers but anyone works. I have this error message now with this JSON:
{"product":{"name":"Cecotec Blender r\u0119czny PowerGear 1500 Pro","category":{"id":"257244"},"id":"8435484040655","images":[{"url":"https:\/\/turaco.es\/marketplaces\/resources\/imagenes\/04065\/04065_1_1500x1500.jpg"},{"url":"https:\/\/turaco.es\/marketplaces\/resources\/imagenes\/04065\/04065_2_1500x1500.jpg"},{"url":"https:\/\/turaco.es\/marketplaces\/resources\/imagenes\/04065\/04065_3_1500x1500.jpg"},{"url":"https:\/\/turaco.es\/marketplaces\/resources\/imagenes\/04065\/04065_4_1500x1500.jpg"},{"url":"https:\/\/turaco.es\/marketplaces\/resources\/imagenes\/04065\/04065_5_1500x1500.jpg"}]},"category":{"id":"257244"},"compatibilityList":[{"type":"MANUAL"}],"publication":{"startingAt":"2021-12-14T13:56:09Z","status":"ACTIVE"},"delivery":{"handlingTime":"P3D"},"name":"Cecotec Blender r\u0119czny PowerGear 1500 Pro","sellingMode":{"price":{"amount":249,"currency":"PLN"}},"location":{"city":"Weilheim an der Teck","countryCode":"DE","postCode":"73235","province":""},"stock":{"available":300},"images":[{"url":"https:\/\/turaco.es\/marketplaces\/resources\/imagenes\/04065\/04065_1_1500x1500.jpg"},{"url":"https:\/\/turaco.es\/marketplaces\/resources\/imagenes\/04065\/04065_2_1500x1500.jpg"},{"url":"https:\/\/turaco.es\/marketplaces\/resources\/imagenes\/04065\/04065_3_1500x1500.jpg"},{"url":"https:\/\/turaco.es\/marketplaces\/resources\/imagenes\/04065\/04065_4_1500x1500.jpg"},{"url":"https:\/\/turaco.es\/marketplaces\/resources\/imagenes\/04065\/04065_5_1500x1500.jpg"}]}
ERROR MESSAGE:
[code] => JsonMappingException
[message] => Message is not readable.
[details] =>
[path] => product.images[0]
[userMessage] => Invalid request. Please contact the application author.
In our database, we have more than one product with EAN=8435484040655 - you should retrieve them with GET /sale/products/?ean=8435484040655 and choose one. In your request, you should pass the id of the chosen product. If you want to add your own photos you should pass them out of the product section, e.g.
"images": [
"https://turaco.es/marketplaces/resources/imagenes/04065/04065_3_1500x1500.jpg",
"https://turaco.es/marketplaces/resources/imagenes/04065/04065_4_1500x1500.jpg"
],
So full request should look like (of course you can add more details):
{
"product": {
"id": "xxxxxx-xxxx-xxxxx-xxxx"
},
"sellingMode": {
"format": "BUY_NOW",
"price": {
"amount": "249.00",
"currency": "PLN"
}
},
"payments": {
"invoice": "VAT"
},
"stock": {
"available": 300,
"unit": "UNIT"
},
"images": [
"https://turaco.es/marketplaces/resources/imagenes/04065/04065_3_1500x1500.jpg",
"https://turaco.es/marketplaces/resources/imagenes/04065/04065_4_1500x1500.jpg"
],
"delivery": {
"handlingTime": "P3D",
"shippingRates": {
"id": "xxxx"
}
}
}
I can't retrieve with a request to sale/products?ean=8435484040655. I have an error message:
Array ( [errors] => Array ( [0] => Array ( [code] => AccessDeniedException [message] => Access denied. [details] => [path] => [userMessage] => Access denied. ) ) )
I'm using the same procedure that I use in send offers with the same token-user but with this request fails
Please, give us your login or user ID - I will check it.
Client ID: 9440160b003d4d8d8d4433d3fe014c37
As I saw in our logs your requests were without user context, so it means that you used client credentials authorization (bearer-token-for-application) - you should use bearer-token-for-user authorization (code or device flow).
Thanks for the explanation. We retrieve products searching by EAN and we find some errors. Cecotec have one product for EAN. We don't have variants of products, any variant is a new EAN. In the result of search we found 2 products with the same EAN that is not correct. How can solve this?
In our database you can find more than one product with the same EAN code - it is not a bug (in the past sellers can add a product with the one EAN code and as the result, we have duplicates of a product). Now, you have to choose which product suits you the best.
W tym wątku nie pojawiła się żadna nowa odpowiedź w ciągu 7 dni, dlatego automatycznie oznaczamy go jako przeterminowany. Jeśli w ciągu kolejnych 7 dni nie pojawi się żadna odpowiedź, wątek zostanie zamknięty. Dziękujemy za zaangażowanie w dyskusję i zachęcamy Cię do wypełnienia ankiety dotyczącej naszego wsparcia na forum.
There was no new reply in this thread within 7 days, therefore, we automatically marked it as expired. If no response is received within the next 7 days, this thread will be closed. Thank you for engaging in the discussion. We encourage you to complete our forum support survey.
We are getting this message error when submit an offer request for a created product:
[code] => ProductValidationException [message] => At least one image should be attached to add product. [details] => [path] => product [userMessage] => Wymagane jest co najmniej 1 zdjęcie.
We are sending this JSON in a CURL request:
As you can see, we are sending image urls. Maybe is not in the correct format? Can anyone help me with this?