Plan

Methods for retrieving individual subscription plans, either directly by ID or based on corporate access rules like IP address or email domain.

getById

Get a specific plan by id.

Example

const plan = window.Pelcro.plan.getById(123);

console.log(plan);

getByIP

Get an array of plans associated with the user's IP address.

Example

window.Pelcro.plan.getByIP((error, response) => {
	if (error) {
  	return console.log("error", error.message);
  }
  
  const plans = response;
  console.log(plans);
})

getByEmail

Get an array of plans associated with the user email address's domain.

Example

window.Pelcro.plan.getByEmail(
    { 
      email: "[email protected]" 
    },
    (error, resp) => {
			if (error) {
  			return console.log("error", error.message);
      }
      
  		const plans = resp;
  		console.log(plans);          
});

getPlan

Fetch a specific plan, including offline plans.

Example

window.Pelcro.plan.getPlan({
  plan_id: 123
}, (error, response) => {
  if (error) {
    return console.log("error", error.message);
  }

  const plan = response.data.plan;
  console.log(plan);
});

Parameters

ParameterType
plan_id number