You can use product related APIs, with the following specific approach:
Assuming there is an association (id to id) between the products in your database and those in Shopify, you can query the product data based on the id and inventory_item_id based on the product ID. This way, you can set the inventory data for that product
Assuming that there is currently no association between the products in your database and those in Shopify, you can use handle as the basis for association. Shopify provides the API (productByHandle), so the subsequent logic is the same as the first scenario.
The basic idea is that if you have any more detailed questions during the development process, you can ask me again.