Open bartflow opened 3 months ago
@bartflow Please send me a trace-id of this request - I will check it out closely.
b42727a3-2560-4c7d-975c-b0f8078f44a2
@bartflow It is not a trace-id. You can find it in your response headers.
Yeah you're right, here is the trace id from the request: 51b1bfe446056a6e
@bartflow I see that you:
"productSet"
object,"images":[]
[ - you should remove it
{
"productSet":[
{
"product":{
"name":"Produkt testowy",
"category":{
"id":"89060"
},
"parameters":[
{
"name":"EAN",
"values":[
"5435435454556"
]
},
{
"id":"237218",
"values":[
"Testowy tytu"
]
}
],
"images": **[**">>HIDDEN<<"**] - an array should be added
}
}
],
"sellingMode":{
"price":{
"amount":"220.85",
"currency":"PLN"
}
},
"stock":{
"available":10
}
}
] - you should remove it
Okay so i removed the outside array from productset, but i think it's still going wrong in the images array, this is the trace-id: 46b4a3bf00827147.
But do we need an extra array? Because in my php code i have
'productSet' => [
'product' => [
'name' => 'Produkt testowy',
'category' => [
'id' => '89060',
],
'parameters' => [
[
'name' => 'EAN',
'values' => ['5435435454556'],
],
[
'id' => '237218',
'values' => ['Testowy tytuł'],
],
],
'images' => [
'https://fastly.picsum.photos/id/237/200/300.jpg?hmac=TmmQSbShHz9CdQm0NkEjx1Dyh_Y984R9LpNrpvH2D_U',
// Add more image URLs as needed
],
],
],
@bartflow Right now I see:
{
"productSet":{
"product":{
"name":"Produkt testowy",
"category":{
"id":"89060"
},
"parameters":[
{
"name":"EAN",
"values":[
"5435435454556"
]
},
{
"id":"237218",
"values":[
"Testowy tytuu0142"
]
}
],
"images":">>HIDDEN<<"
} - it should be removed
},
"sellingMode":{
"price":{
"amount":"220.85",
"currency":"PLN"
}
},
"stock":{
"available":10
}
}
So the problem is still with "images"
field.
Okay so i think above is fixed, thanks for that, but now i get a ProductValidationException, but i filled in all the fields i think. This is the trace-id: 73d641fb67bcd0c5
@bartflow You did not provide one required (for a product) parameter: 246845 (Medium).
This is why we have returned this error: Unable to create product without proper values in all required parameters: [Nośnik] in category: 89060
Okay above is fixed i think, so now i get the following exception ConstraintViolationException.ValidCzechPrice
Trace-id: 4461079aa6455178
@bartflow I see that your base marketplace is allegro-cz, so you should provide a price in CZK.
You can find more information about foreign Allegro marketplaces in our tutorial.
Okay but i didn't put it on CZ? Could you change that for me or where do i change it?
@bartflow You should change it here:
"sellingMode":{
"format":"BUY_NOW",
"price":{
"amount":"220.85", <- the amount should be without decimal
"currency":"PLN" <- it should be CZK
}
},
The offer will be listed on allegro-cz as a base marketplace.
Sorry that's not what i meant. I already changed that, but how can i change the base marketplace? Because i want the base marketplace at PL, because i registered on the sandbox PL.
Ok, I understand now. But base marketplace for the account cannot be changed so you will have to register another account but directly on allegro-pl, so in this situation - on allegro sandbox environment: https://allegro.pl.allegrosandbox.pl
I did it through that url, so that's the strange thing. I never used or visited the cz url.
This account has been registered on July 2 and I see that registration marketplace is: allegro-cz, but I do not have any specific details. If you want to use an account on allegro.pl account, please register another one. Hopefully there will be no problem with that.
I am sorry for any inconvenience.
Okay thanks i will look at that.
I have only 3 errors left for making a offer based on a product.
{ "errors": [ { "code": "ConstraintViolationException.ValidSelectedCategory", "message": "This category is not the lowest-level category.", "details": "ConstraintViolationException.ValidSelectedCategory", "path": "category", "userMessage": "Tato kategorie není kategorií nejnižší úrovně.", "metadata": {} }, { "code": "ConstraintViolationException.BaseProductizedMarketplaceWithProductOnly", "message": "Platforms other than allegro.pl only support offers with a product linked.", "details": "ConstraintViolationException.BaseProductizedMarketplaceWithProductOnly", "path": "null", "userMessage": "Platformy jiné než allegro.pl podporují pouze nabídky propojené s produktem.", "metadata": {} }, { "code": "ConstraintViolationException.ProductizationMinLimitReached", "message": "You cannot activate an offer without a product on platforms other than allegro.pl.", "details": "ConstraintViolationException.ProductizationMinLimitReached", "path": "null", "userMessage": "Nabídku bez produktu nemůžete aktivovat na jiných platformách než na allegro.pl.", "metadata": {} } ] }
The first error, i want to know if there's a list of all categories and subcategories, because i think i had the lowest category.
The other errors, i have no idea what to do, so i hope you could help.
This is the trace-id: 3fbacae098f08d49
In Allegro API you can retrieve categories using GET /sale/categories and drill down into lower-level categories using the parent.id parameter.
For example, you send a request: GET sale/categories?parent.id=a408e75a-cede-4587-8526-54e9be600d9f, select the subcategories for which you would like to get lower categories, e.g. 6 (GET sale/categories?parent.id=6). Therefore, this way you will be able to get all the information. You don't need the shortest child's ID. You only need parent.id, thanks to which you get all the lists of lower categories, in order, according to the above diagram.
Okay thanks! The next error is about the valuesIds within the parameter. But if i get the category parameters this should be the value according to wat i get back: 11323_1
{
"errors": [
{
"code": "DictionaryParameterIdNotFound",
"message": "Requested valueId not found in parameter 'Stav zboží' dictionary (id: 11323).",
"details": null,
"path": "parameters",
"userMessage": "Invalid dictionary value identifier was specified for the `Stav zboží` parameter.",
"metadata": {}
}
]
}
Trace-id: 1489a470f74ff991
You are right, but in your request I still see an incorrect category_id: a408e75a-cede-4587-8526-54e9be600d9f. Maybe it causes the problem here (as 11323_1 value is correct).
Hm that's strange this is my request:
'productSet' => [
[
'product' => [
'name' => 'Produkt testowy',
'category' => [
'id' => '321817'
],
'parameters' => [
[
'id' => '225693',
'values' => [
'0799439112766'
],
],
[
'id' => '17448',
'values' => [
'98.0'
]
],
],
'images' => [
'https://fastly.picsum.photos/id/237/200/300.jpg?hmac=TmmQSbShHz9CdQm0NkEjx1Dyh_Y984R9LpNrpvH2D_U',
],
],
],
],
This is wat the request looks like after the json encode:
"body" => "{"productSet":[{"product":{"name":"Produkt testowy","category":{"id":"321817"},"parameters":[{"id":"225693","values":["0799439112766"]},{"id":"17448","values":["98.0"]}],"images":["https:\/\/fastly.picsum.photos\/id\/237\/200\/300.jpg?hmac=TmmQSbShHz9CdQm0NkEjx1Dyh_Y984R9LpNrpvH2D_U"]}}],"parameters":[{"id":"11323","valuesIds":["11323_1"]},{"id":"229205","valuesIds":["229205_340245"]}],"sellingMode":{"price":{"amount":"629","currency":"CZK"}},"delivery":{"shippingRates":{"id":"24a3f071-80ae-453b-89fb-b5f504cf3800"}},"stock":{"available":10}}"
]
My trace-id:
f60b247f8339e1a2
Ok, now the category: 321817 is correct and you are choosing an incorrect value for it. Available values are:
"dictionary": [
{
"id": "11323_253798",
"value": "For restoration",
"dependsOnValueIds": []
},
{
"id": "11323_253802",
"value": "Refurbished",
"dependsOnValueIds": []
},
{
"id": "11323_253806",
"value": "Needs no refurbishment",
"dependsOnValueIds": []
}
],
You can check it using GET /sale/categories/321817/parameters
I also recommend our tutorial.
Thanks for the help. I've successfully added the products.
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.
Hi,
I want to add an offer with a not existing product, and according to the docs it should be like this:
But if i send this to the api, i get an 'JsonMappingException', before sending i encode the above code to json.
Could you see what the issue is?