Add to Cart from Custom database

Are you using the custom catalog SPI? It sounds like this is what you could need.

https://www.wix.com/velo/reference/spis/getting-started/ecommerce-catalog