Order

Provides a method to generate a pre-purchase summary for a subscription order, including final calculations for taxes and coupons.

create

Gets a summary of a subscription order (before subscribing for a plan).
Including calculating taxes and price after applying coupon.

Example

window.Pelcro.order.create({
  auth_token: window.Pelcro.user.read().auth_token, 
  plan_id: 1234,
  address_id: 321,
  coupon_code: "50OFF"
}, (error, response) => {
  if (error) {
    return console.log("error", error.message);
  }

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

Parameters

ParameterType
auth_token string
plan_id number
address_idnumber
coupon_codestring