PayPal Checkout Quick Start

Follow these steps to create a fully functioning PayPal Checkout button within minutes:

  1. Copy and paste this HTML and JavaScript code snippet into an HTML file.

    <div id="paypal-button"></div>
    <script src=""></script>
      env: 'sandbox',
      client: {
        sandbox: 'demo_sandbox_client_id'
      payment: function (data, actions) {
        return actions.payment.create({
          transactions: [{
            amount: {
              total: '0.01',
              currency: 'USD'
      onAuthorize: function (data, actions) {
        return actions.payment.execute()
          .then(function () {
            window.alert('Thank you for your purchase!');
    }, '#paypal-button');
  2. Open the HTML file in your browser and click your new PayPal Checkout button.

    Congratulations, you now have a working PayPal Checkout button!

Tip: If you already have sandbox credentials, enter them in the PayPal window to see the buyer's checkout flow. To create a sandbox account, see Create sandbox test accounts.

Make test calls to the API using the interactive API Explorer.


Enhance your payment button with a full client-side integration:

If you're satisfied with this simple button, see PayPal Checkout button customization options and best practices tips:


Have feedback?

Let us know.