backgroundbackground
Назад
Назад

Urgent!!!Error creating card:bad request,400

Вопрос
Решено
0
123
# Общее # Отчёты # Работа с товарами
Вопрос

------------------------------------------------------------------ 1 ------------------------------------------------------------------

URL: https://content-api.wildberries.ru/content/v2/cards/upload

body: [

{

"subjectID": 7580,

"variants": [

{

"vendorCode": "2049968653888",

"brand": "Бренд",

"title": "Светодиодный индикатор напряжения",

"sizes": [],

"wholesale": {

"enabled": false,

"quantum": 1

},

"description": "Описание товара",

"dimensions": {

"length": 12,

"width": 7,

"height": 5,

"weightBrutto": 2

},

"characteristics": []

}

]

}

]

return:

Request failed with status code 400

{

"data": null,

"error": true,

"errorText": "bad request",

"additionalErrors": {}

}

Another request also reported the same error:

------------------------------------------------------------------ 2 ------------------------------------------------------------------

URL: https://content-api.wildberries.ru/content/v2/cards/upload

[

{

"subjectID": 7580,

"variants": [

{

"vendorCode": "2049969351080",

"brand": "Бренд",

"title": "Светодиодный индикатор напряжения",

"sizes": [],

"wholesale": {

"enabled": false,

"quantum": 1

},

"description": "Описание товара",

"dimensions": {

"length": 12,

"width": 7,

"height": 5,

"weightBrutto": 2

},

"characteristics": [

{

"id": 3,

"value": "14cm*2cm*0.35cm"

},

{

"id": 5,

"value": "1支装配3颗备用电池,2支装配6颗备用电池"

},

{

"id": 8,

"value": "升级芯片LED高亮彩光测电笔、备用电池"

},

{

"id": 9,

"value": "中国"

},

{

"id": 10,

"value": "套"

},

{

"id": 18769,

"value": "常年"

},

{

"id": 378533,

"value": "Резервные батареи"

},

{

"id": 7488315,

"value": "Умные индукционные тестеры напряжения Shengda со светодиодной подсветкой"

},

{

"id": 14177449,

"value": "亮橙色"

},

{

"id": 14177450,

"value": "Тестер напряжения, резервные батареи"

},

{

"id": 14177451,

"value": "15000280"

},

{

"id": 14177453,

"value": "1 шт."

}

]

}

]

}

]

Please tell me the reason for the error. Thank you very much

0
Решение
от@Alekseev

Greetings!

Thank you for your question.

You use non-existing "subjectID": 7580. 7580 - is a Products Parent Category, not a Subject.

You can first get the Parent Category with https://dev.wildberries.ru/docs/openapi/work-with-products#tag/Kategorii-predmety-i-harakteristiki/paths/~1content~1v2~1object~1parent~1all/get, than use the ParentID to get its Subjects with https://dev.wildberries.ru/docs/openapi/work-with-products#tag/Kategorii-predmety-i-harakteristiki/paths/~1content~1v2~1object~1all/get, and use SubjectID from this to Create Product Cards. You can check that in documentation. Hope this helps!

Комментарий
Решение

Greetings!

Thank you for your question.

You use non-existing "subjectID": 7580. 7580 - is a Products Parent Category, not a Subject.

You can first get the Parent Category with https://dev.wildberries.ru/docs/openapi/work-with-products#tag/Kategorii-predmety-i-harakteristiki/paths/~1content~1v2~1object~1parent~1all/get, than use the ParentID to get its Subjects with https://dev.wildberries.ru/docs/openapi/work-with-products#tag/Kategorii-predmety-i-harakteristiki/paths/~1content~1v2~1object~1all/get, and use SubjectID from this to Create Product Cards. You can check that in documentation. Hope this helps!

+2