I want to create a product with a inventory tacking and a quantity. in the SDK samples I can't find it.
I don't want to create variants or naythign special.
In the UI when I configure it manually it looks like this:
when i look at the documentation i can only find the quantity inside the variants. https://shopify.dev/docs/admin-api/rest/reference/products/product#create-2021-04
what is the indended way to achieve this?
All products have variants, even if you don't explicitly create one. When a product is created without multiple variants options, Shopify will create a default variant. This is because certain data like price, SKU, barcode etc. are stored on the variant object in the database.
Inventory goes one step further, as inventory quantities are store on the inventory_item object, which belongs to the variant. The inventory item is created automatically as well, so when you create a product the response will include information about the default variant including the inventory_item_id.
Assigning inventory is to be done in an additional call after a product is created. Grab the inventory_item_id from the product#create response, and use that id to send another call to inventory_level endpoint. This tutorial provides a detailed breakdown of the inventory management process.