Add a buy button to your website so customers can pay for a specific product or service directly from your page, without writing custom code. Create the button, add the generated code to your site’s HTML where you want it to appear, and then test a full checkout to confirm the payment flow works end to end.
Before creating your buy button, select a price type:
One set price: You set a single price that every customer pays. Use this for products or services with a defined cost.
Customer-set price: Customers enter the amount they want to pay. Use this for donations, tips, or pay-what-you-want offers.
Log in to your PayPal business account.
From the left navigation, select Pay & Get Paid > Create Payment Links and Buttons.
Select the button type, then choose the product or service you want to sell.
In the Product tab, fill out the product or service details.
Under Price, select the appropriate pricing option and enter the required details.
(Optional) Turn on Images to show product visuals on the payment page.
(Optional) Add quantity, variants, and inventory to help customers choose the correct options.
If you selected Customer-set price, turn on Label for Invoice ID so customers can enter an invoice number at checkout, and mark it as required if you need to match payments to specific invoices or orders.
Use stacked buttons to show multiple payment options together, and a single button when you only need one primary button. See Customize checkout and buttons to change button layout, colors, and behaviors.
(Optional) In the Checkout tab, add shipping, taxes, discounts, and handling fees.
(Optional) In the Confirmation tab, turn on Auto-return and enter the URL where customers are redirected after successful payment.
After your buttons are created, add them to your website so customers can see and use them during checkout. You can choose to display multiple payment options together or show just a single button, depending on your preference.
Customers see multiple PayPal payment options, such as PayPal, Pay Later, and cards in one stacked experience. Choose your preferred code language, HTML or React, from the Code language dropdown to view the relevant example.
Button code is out of date after updating product details
In most cases, you don’t need to update the button code. The button uses configuration stored on PayPal servers, so your changes take effect after you save them in your PayPal account. However, if you change the product’s currency code, ensure you replace the existing button code with the updated code.