title: PayPal smart payment buttons - request quantity
body: <p>I'm using the PayPal smart payment buttons to sell a single item on my website, but I can't find in any of the documentation how to ask for quantity. </p>
  
  <p>Is this even possible to do with the smart payment buttons API?</p>
  
  <p>I just want to offer the customer the ability to change the quantity of the item they wish to buy. I don't mind if it's in the form or during the checkout stage within PayPal.</p>
  
  <p>Here's my code so far, it's pretty standard as I'm trying to keep it simple:</p>
  
  <pre><code>&lt;script&gt;
      // Render the PayPal button into #paypal-button-container
      paypal.Buttons({
          style: {
              size: 'responsive',
              shape: 'pill',
              label: 'checkout',
          },
          // Set up the transaction
          createOrder: function(data, actions) {
              return actions.order.create({
                  purchase_units: [{
                      amount: {
                          value: '8.99'
                      }
                  }]
              });
          },
  
          // Finalize the transaction
          onApprove: function(data, actions) {
              return actions.order.capture().then(function(details) {
                  // Show a success message to the buyer
                  alert('Transaction completed by ' + details.payer.name.given_name + '!');
              });
          }
  
  
      }).render('#paypal-button-container');
  &lt;/script&gt;
  </code></pre>