title: Specific line items in paypal checkout
body: <p>I'm trying to set up PayPal to take payments on my website, and I would like to specify line items for the payments (Using the new SDK, not the javascript version)</p>
  
  <p>I have tried going through the API documentation listed here: <a href="https://developer.paypal.com/docs/api/orders/v2/" rel="noreferrer">https://developer.paypal.com/docs/api/orders/v2/</a>. However, it says I either have invalid syntax or I am missing a field.</p>
  
  <pre><code>&lt;head&gt;
  &lt;script&gt;
  paypal.Buttons({
      createOrder: function(data, actions) {
      return actions.order.create({
          purchase_units: [{
          amount: {
              currency_code: 'USD',
              value: '0.01',
              amount_breakdown: {
  
              }
  
            },
              items: {
                  item: {
                      name: 'Cake',
                      quantity:'1',
                      unit_amount:{
                          currency_code:'USD',
                          value:'0.01'
                      }
                  }
              }
  
  
  
      }],
          application_context: {
              shipping_preference: 'NO_SHIPPING',
          }
  
        });
      },
      onApprove: function(data, actions) {
      return actions.order.capture().then(function(details) {
              alert('Transaction completed by ' + details.payer.name.given_name);
              // Call your server to save the transaction
              return fetch('/paypal-transaction-complete', {
            method: 'post',
            body: JSON.stringify({
              orderID: data.orderID
            })
          });
        });
  }
    }).render('#paypal-button-container');
  &lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  &lt;div id="paypal-button-container"&gt;&lt;/div&gt;
  &lt;/body&gt;
  </code></pre>