You can use HTML data attributes to open a checkout with settings, items, and customer information. They're typically used with overlay checkouts in websites or apps where you don't have full control over the page layout.
Data attributes support all the same properties as the Paddle.Checkout.open() method, letting you:
- Set the initial items list or transaction that a checkout is for
- Set checkout settings, like the theme
- Prefill checkout properties, like customer email and country
- Send custom data to Paddle
Set data attributes on the element that you've turned into a Paddle Checkout button to open a checkout with the properties.
Before you begin
You must include and initialize Paddle.js to use HTML data attributes, but you don't need to use any other JavaScript if you're working with an overlay checkout.
List of attributes
inlineInline checkout mode. Checkout embedded as a frame in the page. RequiresframeTargetinPaddle.Initialize().overlayOverlay checkout mode. Checkout opens in an overlay.
lightLight-themed checkout.darkDark-themed checkout.
(browser default)arArabic (العربية)zh-HansChinese (Simplified) (简化字)zh-TWChinese (Traditional) (正體字)daDanish (Dansk)nlDutch (Nederlands)
+ Show all values− Hide values
enEnglishfrFrench (Français)deGerman (Deutsch)itItalian (Italiano)jaJapanese (日本語)koKorean (한국어)noNorwegian (Norsk)plPolish (Polski)ptPortuguese (Português)trTurkish (Türkçe)ruRussian (Русский)esSpanish (Español)svSwedish (Svenska)
truetruetrue.pri_01gm81eqze2vmmvhpjg13bfeqg1txn_01gp3z8cfkqgdq07hcr3ja0q95data-items array to create a checkout for a transaction you previously created.ctm_01gm82kny0ad1tk358gxmsq87mdata-customer-email.data-customer-id.add_01gm82v81g69n9hdb0v9sw6j40data-customer-address-country-code or data-customer-address-postal-code.USdata-customer-address-id.92663data-customer-address-id.Californiadata-business- properties are passed.Newport Beachdata-business- properties are passed.Balboa Centerdata-business- properties are passed.biz_01gnymqsj1etmestb4yhemdavmdata-business-name or data-business-tax-id.Paddle.com Incdata-business-id.GB08172165data-business-id.truetrue.BF20OFFdata-discount-code or data-discount-id.dsc_01gp0ynsntfpyw2spd2md1wqx1data-discount-code or data-discount-id.{ "crm_user_id": "123" }multi-pagemulti-page.one-pageOne-page checkout experience. Customer information and payment details collected on the same page.multi-pageMulti-page checkout experience. Customer information and payment details collected on separate pages.
txn_01gp3z8cfkqgdq07hcr3ja0q95txn_.truetrue.Examples
This example includes checkout settings and items.
<a href='#' class='paddle_button' data-display-mode='overlay' data-theme='light' data-locale='en' data-items='[ { "priceId": "pri_01gm81eqze2vmmvhpjg13bfeqg", "quantity": 1 }, { "priceId": "pri_01gm82kny0ad1tk358gxmsq87m", "quantity": 1 } ]'> Buy now</a>You can prefill checkout properties to speed up checkout.
This example includes customer, address, and business information. Checkout is opened with this information prefilled, so customers land on the payment screen.
<a href='#' class='paddle_button' data-display-mode='overlay' data-theme='light' data-locale='en' data-items='[ { "priceId": "pri_01gm81eqze2vmmvhpjg13bfeqg", "quantity": 1 }, { "priceId": "pri_01gm82kny0ad1tk358gxmsq87m", "quantity": 1 } ]' data-customer-email='weloveyourproduct@paddle.com' data-customer-address-country-code='US' data-customer-address-postal-code='92663' data-customer-address-region='California' data-customer-address-city='Newport Beach' data-customer-address-first-line='Balboa Center' data-business-name='Paddle.com, Inc' data-business-tax-id='GB802311782'> Buy now</a>You can pass Paddle IDs for customers, addresses, and businesses to build upgrade workflows for logged-in customers.
This example includes a customer ID, address ID, and business ID. Checkout is opened with this information prefilled, so customers land on the payment screen.
data-allow-logout is false, hiding the option to change the customer on the opened checkout.
<a href='#' class='paddle_button' data-display-mode='overlay' data-theme='light' data-locale='en' data-allow-logout='false' data-items='[ { "priceId": "pri_01gm81eqze2vmmvhpjg13bfeqg", "quantity": 1 }, { "priceId": "pri_01gm82kny0ad1tk358gxmsq87m", "quantity": 1 } ]' data-customer-id='ctm_01gm82kny0ad1tk358gxmsq87m' data-customer-address-id='add_01gm82v81g69n9hdb0v9sw6j40' data-business-id='biz_01gnymqsj1etmestb4yhemdavm'> Buy now</a>