No, it’s not illegal. It is a legitimate and common business model where individuals and companies resell products from other manufacturers or suppliers through their Shopify store.