How can I add plans to my website

I’ve been looking into how to add plans to my website. In my head, I was almost certain there would be an element called “Plans” just like the product list, but it seems my memory played a trick on me. Although we can create plans in ReflowHQ, there isn’t an element to display the plans on the website; generally, this should be shown in a pricing table.

You can use their api to get the plans
change the storeID to yours

document.addEventListener('DOMContentLoaded', async () => {
  const storeId = 267418190;
  try {
    const res = await fetch(`https://api.reflowhq.com/v2/projects/${storeId}/plans/`);
    
    // Check if the response is okay (status 200-299)
    if (!res.ok) {
      throw new Error(`HTTP error! Status: ${res.status}`);
    }
    
    const plans = await res.json();
    console.log(plans.data);
  } catch (error) {
    // Log any error that occurs during the fetch or JSON parsing
    console.error('There was an error fetching the plans:', error);
  }
}, false);
1 Like

Thank you, it has been very useful.