Documentation

JavaScript API Documentation

PriceWell API Documentation

Warning: This documentation is for skilled software developers only. We cannot provide any technical support if you choose to use our JavaScript client in a way it was not intended. Please had to the main documentation if you are not a developer.


The PriceWell JavaScript client exposes the following functions to interact with the PriceWell API.

window.pricewell

Kind: global variable

pricewell.checkout(pageId, planId, settings) ⇒ Promise

Redirects the customer to the Stripe payment page

Kind: static method of pricewell

Param Type Description
pageId string The PriceWell ID of the page to checkout.
planId string The PriceWell ID of the plan to checkout.
settings object
settings.quantity string quantity of the plan (Optional)
settings.email string Pre fill the email of the customer (Optional)
settings.stripeId string Stripe Customer Id to use for checkout (Optional)

pricewell.upgrade(pageId, planId, settings) ⇒ Promise

Update the current plan of a Stripe customer

Kind: static method of pricewell

Param Type Description
pageId string The PriceWell ID of the page
planId string The PriceWell ID of the plan to upgrade to
settings object One of email and stripeId are required
settings.quantity string quantity of the plan (Optional)
settings.email string Email address of current Stripe customer (Optional)
settings.stripeId string Stripe Customer Id (Optional)

pricewell.customerPortal(id, config)

Redirects the customer to the Stripe Customer Portal to manage their subscription

Kind: static method of pricewell

Param Type Description
id string
config object (one of stripeId or email must be present)
config.stripeId string The Stripe account id (optional)
config.email string The customer email (optional)

pricewell.features(pageId, config) ⇒ Promise

Returns a list of features for the users current plan

Kind: static method of pricewell

Param Type Description
pageId string
config object (one of stripeId or email must be present)
config.stripeId string The Stripe account id (optional)
config.email string The customer email (optional)

pricewell.cancelSubscription(config) ⇒ Promise

Cancels a customers subscription. If you don’t provide a subscription id and the customer only has one active subscription, it will be cancelled.

Kind: static method of pricewell

Param Type Description
config object (one of stripeId or email must be present)
config.companyId string Your company id
config.mode string Either test or live
config.stripeId string The Stripe customer id (optional)
config.email string The customer email (optional)
config.subscriptionId string The Stripe subscription id (optional)
Next
FAQs