Upzelo Configuration Object

Parameters available for configuring Upzelo

Upzelo requires a configuration object to be passed into it to initialise.

It can be passed into window.upzelo.init and/or window.upzelo.open.

circle-info

Parameters in red are required. Yellow is required conditionally.

Configuration Parameters

chevron-rightcustomerIdhashtag

Type: String.

The payment provider ID for the currently logged-in user.

customerId: 'cus_1234',
chevron-rightsubscriptionIdhashtag

Type: String

The payment provider ID of the subscription that is to be modified or actioned against.

subscriptionId: 'sub_1234',
chevron-righthashhashtag

Type: String

Required: If mode = full

Usage: This is for providing the server-side hash

hash: 'bd9d2eca979333103b3d93a80e8efcbd0f8421813fdb9feefffde2206b4115e8',
chevron-rightaddressId (Recharge Only)hashtag

Type: String

Required: No

Usage: This is only used for Recharge. This is used to be able to apply offers or cancel all subscriptions under a single address.

addressId: '234897sdjknf',
chevron-rightmodehashtag

Type: String

Options: live, test

Default: live

Usage: Test mode will utilise the data available while using Upzelo's test mode. This means that it will use Flows, Audiences, and payment provider data that has been imported using your test key.

chevron-righttypehashtag

Type: String

Options: full, minimal

Default: full if hash supplied, otherwise minimal

Usage: This determines if you want Upzelo to action things on your behalf with your payment provider. If set to minimal, offboarding requests will appear in the Requests section of the dashboard for you to action yourself.

chevron-rightselectorhashtag

Type: String

Default: button#cancel, a#cancel

Usage: A CSS selector to select which elements on the page should launch Upzelo when clicked.

chevron-rightproviderhashtag

Type: String

Usage: Only set this if you have been advised by Upzelo support to do so.

Callbacks

There are some available callbacks that you can use to further extend the functionality of Upzelo. They run alongside what Upzelo does and do not replace that functionality, therefore they are optional.

circle-info

Where a callback has the responses argument, it will be an array of Actions that the user saw (not all of the actions in the Flow), and whether an Action was accepted or not.

You should always check if it is defined before using it as there are a small number of cases where it might not be.

chevron-rightonCancelhashtag

Type: Function

Default: null

Arguments: { customerId, subscriptionId, responses }

Usage: A function that runs at the end of a flow when the customer confirms that they wish to cancel.

chevron-rightonSavehashtag

Type: Function

Default: null

Arguments: { customerId, subscriptionId, responses, couponId, offerType, externalCouponId, planId, externalPlanId, offerDuration, offerDurationType }

Usage: A function that runs when a customer accepts an offer.

You can use offerType to change how you respond based on the offer type. Possible values are:

  • discount

  • pause

  • trial_extension

  • free_period

  • plan_change

chevron-rightonClosehashtag

Type: Function

Default: null

Arguments: { customerId }

Usage: A function that runs when the user closes the modal via the X button, clicking outside of it, or pressing the esc key.

chevron-rightonErrorhashtag

Type: Function

Default: null

Arguments: { customerId, error }

Usage: If Upzelo throws an error message to the user, it is available through this callback

Last updated