
Medusa Has a Free API That Lets You Build Custom E-Commerce in JavaScript
Medusa is the open-source headless commerce platform. Its API gives you products, carts, orders, payments, and fulfillment — fully customizable. API: Products // List products const { products } = await fetch ( " http://localhost:9000/store/products " ). then ( r => r . json ()); // Get product by handle const { product } = await fetch ( " http://localhost:9000/store/products/my-product " ). then ( r => r . json ()); // Search const { products } = await fetch ( " http://localhost:9000/store/products?q=widget&limit=20 " ). then ( r => r . json ()); // Filter by collection, category, price const { products } = await fetch ( " http://localhost:9000/store/products?collection_id=col_01&category_id=cat_01&price_list_id=pl_01 " ). then ( r => r . json ()); Cart API // Create cart const { cart } = await fetch ( " http://localhost:9000/store/carts " , { method : " POST " , headers : { " Content-Type " : " application/json " }, body : JSON . stringify ({ region_id : " reg_01 " }), }). then ( r =
Continue reading on Dev.to JavaScript
Opens in a new tab



