How Tos
Subscriptions
Prices & Discounts
Track & Report

Post Checkout

You can customize the buyer’s experience once the Checkout closes. Here we’ll look at Success and Close callbacks, the Checkout Complete Pop-up and displaying order information such as a license code.

Checkout Success & Close Callbacks

Upon your checkout being completed successfully, or being closed/abandoned, you may wish to take additional actions, for example loading a Thank You page or showing a message to the user.

Paddle’s checkout supports successCallback and closeCallback parameters, which specify JS functions that are fired upon the checkout completing a transaction or being closed, respectively.

The success callback will prevent the default checkout success message from being displayed. If you want to allow the checkout to continue with its typical functionality, please use the Event Callback here with the “Checkout.Complete” event instead.

You can specify an anonymous function or pass in the name of a explicitly defined function, for example:

function checkoutClosed(data) {
  console.log(data);
  alert('Your purchase has been cancelled, we hope to see you again soon!');
}

function checkoutComplete(data) {
  console.log(data);
  alert('Thanks for your purchase.');
}

Paddle.Checkout.open({
  product: 12345,
  email: "jane@paddle.com",
  passthrough: 1939284,
  successCallback: "checkoutComplete",
  closeCallback: "checkoutClosed"
});

The success callback will override any success redirect URL set in your Seller Dashboard.

Success and Close Callbacks can also be specified on a Paddle purchase button with the equivalent HTML data attributes data-success-callback and data-close-callback. If setting callbacks with data attributes, you must specify an explicit JavaScript function name.

Checkout Complete Popup

The Paddle Checkout has several options on what to do on a completed checkout, by default the checkout will show a ‘Success’ message indicating that the transaction was successful.

One option is to display a popup containing order, receipt and payment information as an alternate success screen.

You can enable the Checkout Complete Popup in the Setup() function of Paddle.js by setting completeDetails to true.

Order Details

You may wish to display to the customer’s order, license or transaction information, on your Thank You page after a checkout completes.

Paddle.js provides methods to pull the transaction data on checkout complete. You can also call the Order Details API directly.

The easiest way to use the Order API is to automatically call it within the checkout successCallback. This allows you to create a process where the customer’s order information is immediately available to the customer once the checkout has completed.

For example, you can listen for a successful checkout using the checkout success callback, retrieve the checkout ID and pass it into the Order API:

Paddle.Checkout.open({
  product: 1234567,
  successCallback: function(data) {
    var checkoutId = data.checkout.id;
    
    Paddle.Order.details(checkoutId, function(data) {
      // Order data, downloads, receipts etc... available within 'data' variable.
      console.log(data);
    });
  }
});