This topic contains 4 replies, has 3 voices, and was last updated by Yurii Muratov 5 years, 11 months ago.
- Topic
Hi,
I am trying to create a product through API. The endpoint I am using is:- “/admin/api/products” and the request body structure is:-
{
“data”:
{
“type”: “products”,
“attributes”: {
“availability_date”: null,
“sku”: “Bajaj”,
“status”: “enabled”,
“variantFields”: [],
“productType”: “simple”,
“featured”: false,
“newArrival”: false
},
“unitPrecisions”: {
“data”: [
{
“type”: “productunitprecisions”
}
]
},
“primaryUnitPrecision”: {
“data”: {
“type”: “productunitprecisions”
}
},
“names”: {
“data”:
{
“type”: “localizedfallbackvalues”
}
},
“inventory_status”: {
“data”: {
“type”: “prodinventorystatuses”,
“id”: “in_stock”
}
}
}
}
The response is:-
{
“errors”: [
{
“status”: “400”,
“title”: “count constraint”,
“detail”: “Please add one or more product units.”,
“source”: {
“pointer”: “/data/relationships/unitPrecisions/data”
}
},
{
“status”: “400”,
“title”: “not blank constraint”,
“detail”: “This value should not be blank.”,
“source”: {
“pointer”: “/data/relationships/primaryUnitPrecision/data”
}
},
{
“status”: “400”,
“title”: “count constraint”,
“detail”: “This collection should contain 1 element or more.”,
“source”: {
“pointer”: “/data/relationships/names/data”
}
},
{
“status”: “400”,
“title”: “not blank constraint”,
“detail”: “This value should not be blank.”,
“source”: {
“pointer”: “/data/relationships/attributeFamily/data”
}
},
{
“status”: “400”,
“title”: “not blank constraint”,
“detail”: “This value should not be blank.”,
“source”: {
“pointer”: “/data/relationships/inventory_status/data”
}
}
]
}
So, can you tell me what should be minimum fields needed to create a product is OroCommerce?Regards,
Indranil Saha
The forum ‘OroCommerce’ is closed to new topics and replies.