I would like to start a discussion about how we could include stock records and stock levels within the Products data model.
Originally I thought we would do it as a seperate request i.e. /products/12345/stock but after a bit of thought, it would be much more useful if it was contained within the product model itself.
My thoughts would be to store it something like;
...
stock: {
records: [{
ID: 333,
options: [{
"137379": 561041, // Option ID (Colour): Item ID (Red)
"67266": 12224, // Size: Large
}],
quantity: 5
}],
total_quantity: 5,
}
Where the numbers in the options object relate directly to the IDs in the options in the root of the product data model;
I would like to start a discussion about how we could include stock records and stock levels within the Products data model.
Originally I thought we would do it as a seperate request i.e.
/products/12345/stock
but after a bit of thought, it would be much more useful if it was contained within the product model itself.My thoughts would be to store it something like;
Where the numbers in the options object relate directly to the IDs in the
options
in the root of theproduct
data model;Any thoughts? @skmbr @AidanThreadgold @Create-Ed @robertoldaker