Embed
Embed attributes
HTML attributes the Stakk embed script reads from your buy button.
Put these on the same element as data-stakk-product.
Product
| Attribute | Description |
|---|---|
data-stakk-product | Product ID. Required. |
data-stakk-shop | Shop slug or ID. Optional if Stakk.init({ shopId }) already ran |
data-stakk-variant | Variant ID |
data-stakk-quantity | Quantity. Defaults to 1 |
Checkout prefills
| Attribute | Description |
|---|---|
data-stakk-coupon | Coupon code to auto-apply. |
data-stakk-email | Pre-fill customer email |
data-stakk-gateway | Preferred method, for example BITCOIN, STRIPE, PAYPAL |
data-stakk-theme | light, dark, or auto |
data-stakk-locale | Checkout locale, for example de |
data-stakk-affiliate | Affiliate code |
data-stakk-return-url | Redirect after a successful payment |
Custom fields
Product custom fields (username, Discord, license seat, and so on) can be declared two ways.
Per field — the suffix is the field name:
<button
data-stakk-product="PRODUCT_ID"
data-stakk-field-username="alex"
data-stakk-field-discord="buyer#0001"
>
Buy now
</button>JSON object when you have several:
<button
data-stakk-product="PRODUCT_ID"
data-stakk-custom-fields='{"username":"alex","license_seat":"main"}'
>
Buy now
</button>data-stakk-field-{key} is the field name from the product.
Widget
<div
data-stakk-widget
data-stakk-product="PRODUCT_ID"
data-stakk-widget-label="Buy now"
></div>The script injects a buy button into that element.
Hosted query params
The same prefills work on the checkout URL if you open /embed/checkout yourself:
/embed/checkout?shop=SHOP&product=PRODUCT_ID&coupon=SAVE10&email=buyer@example.com&qty=2