Paddle Billing
Search

Paddle.js events

Paddle.js emits events as part of the checkout journey. Use events to update elements in your frontend for inline checkout, or for analytics purposes.

As a customer moves through the checkout, Paddle.js emits events for key actions like:

  • When the checkout is opened, closed, or completed
  • When customer information is added, updated, or removed
  • When items are added, removed, or updated
  • When payments are attempted and outcomes of payment attempts
  • When discounts are added or removed

You can pass an eventCallback parameter as part of the Paddle.Initialize() method to trigger behaviors based on customer interactions with your checkout. You'll typically use this to show and update on-page information when building an inline checkout.

Attributes

namestring

Name of this event, in the format entity.event_type.

dataobject

Event payload.

idstring

Unique Paddle ID for this checkout, prefixed with che_.

transaction_idstring

Unique Paddle ID for the transaction related to this checkout, prefixed with txn_.

statusstring

Status of this checkout.

custom_dataobject or null

Key-value pairs of custom data. Must be valid JSON and contain at least one key.

currency_codestring

Supported three-letter ISO 4217 currency code for this checkout.

customerobject

Information about the customer on this checkout.

itemsarray[object]

Items to bill for.

totalsobject

Financial breakdown of the total for this checkout, calculated by Paddle.

recurring_totalsobject

Financial breakdown of the recurring total for this checkout, calculated by Paddle. Only included where there are recurring items.

paymentobject

Information about the payment details used on this checkout.

settingsobject

Checkout settings.

discountobject or null

Information about the discount applied to this checkout. Only included when a discount is applied.

Common attributes

When building an inline checkout, you can write an event callback function to present totals and other information.

Here are some commonly used fields in Paddle.js events that you might like to use in your implementation:

data.items[].product.nameProduct name for itemized breakdowns.
data.items[].price_namePrice name. Typically describes how often this item bills.
data.items[].trial_periodDetails about the trial period for an item, if any.
data.items[].billing_cycleHow often an item is billed, if recurring.
data.items[].totals.subtotalTotal for an item, excluding tax and discount.
data.totals.totalGrand total for a transaction, including tax and discount.
data.recurring_totals.totalRecurring total for a transaction, including tax and discount.
(data.totals.total - data.recurring_totals.total)Where transactions contain a mix of one-time charges and recurring items, subtract a value in data.recurring_totals from the corresponding value in data.totals to calculate one-time charge totals.

For compliance and the best customer experience, inline checkout implementations must include a description of what's being purchased, transaction totals, billing frequency (if recurring), and information about any trial periods (if applicable).

List of events

Event nameDetails
checkout.loadedCheckout created and loaded on the page.
checkout.closedCheckout closed on the page.
checkout.completedCheckout completed successfully.
checkout.items.updatedItem updated on the checkout. For example, a quantity change.
checkout.items.removedItem removed from the checkout.
checkout.customer.createdCustomer created.
checkout.customer.updatedCustomer information updated. This includes business and address information.
checkout.customer.removedCustomer removed from the checkout, e.g. they logged out.
checkout.payment.selectedPayment method selected.
checkout.payment.initiatedCustomer attempted payment using the selected payment method.
checkout.payment.failedPayment attempt failed.
checkout.discount.appliedDiscount applied to the checkout.
checkout.discount.removedDiscount removed from the checkout.
checkout.warningWarning occurred on the checkout.
checkout.errorError occurred on the checkout.

Related pages