Selling with the Buy Button
The [lc_buy_button] shortcode#
Add the shortcode to any page, post or widget that accepts shortcodes. It renders a styled button that opens the Paddle overlay checkout for the given price.
[lc_buy_button price_id="pri_01hxyz…" label="Buy now"]
| Attribute | Description | Default |
|---|---|---|
price_id | Required. The Paddle price ID (pri_…) of a pricing package. Shown under the package name on the Products → Prices panel. | — |
label | Button text. | Buy Now |
color | Background colour as a hex value. | #6366f1 |
size | small, medium or large. | medium |
full_width | yes makes the button span its container. | no |
icon | Emoji or short text shown before the label. Pass an empty string to hide it. | 🛒 |
Examples:
[lc_buy_button price_id="pri_01h…" label="Get the 3-site plan" color="#e67e22" size="large"]
[lc_buy_button price_id="pri_01h…" label="Start yearly subscription" full_width="yes" icon=""]
If price_id is missing the shortcode outputs an HTML comment instead of a button, so nothing broken appears on the page.
What happens on click#
- Paddle.js (loaded only when a client-side token is saved for the active environment) opens the checkout overlay for the price.
- The button passes a one-time checkout token as Paddle custom data and sets the success URL to your portal page.
- After payment Paddle redirects the buyer to the portal, which shows a “Preparing Your License” screen and refreshes every few seconds.
- As soon as the
transaction.completedwebhook has created the account and license, the same token logs the buyer in automatically and their dashboard appears with the new key.
The checkout token stays valid for 6 hours (filterable), so a buyer who finishes checkout slowly is still logged in.
Put several buttons on one pricing page, one per package. They all share a single checkout token per page view, so there is no extra database load.
Was this article helpful?
Tell us what was missing
