Basics

Adding PaddleJS to your checkout page

At the end of your page (before </body>) add the following code snippet and add a client side token from your Paddle account.

For production accounts you can generate the tokens under your Developer Settings > Authentication or for sandbox accounts click here.

<script src="https://cdn.paddle.com/paddle/v2/paddle.js">
</script>
<script type="text/javascript">
  Paddle.Setup({
    token: "live_abc" // replace with a client side token generated in Paddle Dashboard
  });
</script>

Note: If you are using a sandbox account you have to set the environment first.

<script src="https://cdn.paddle.com/paddle/v2/paddle.js">
</script>
<script type="text/javascript">
  Paddle.Environment.set("sandbox");
  Paddle.Setup({
    token: "test_abc" // replace with a client side token generated in Paddle Dashboard
  });
</script>

This is enough to add a pricing table to your page or manually add a checkout button.

Domain verification and the default payment link

In order to use PaddleJS (and Paddle checkouts) on a page you must get domain approval from Paddle otherwise an error message will be shown. This step can be skipped for sandbox accounts.

You must also set the default payment link to a page in your system that uses PaddleJS. Paddle will redirect users to this page for certain actions.

For more information and additional settings see the Paddle documentation.

Previous
Boathouse API