Stakk Docs
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

AttributeDescription
data-stakk-productProduct ID. Required.
data-stakk-shopShop slug or ID. Optional if Stakk.init({ shopId }) already ran
data-stakk-variantVariant ID
data-stakk-quantityQuantity. Defaults to 1

Checkout prefills

AttributeDescription
data-stakk-couponCoupon code to auto-apply.
data-stakk-emailPre-fill customer email
data-stakk-gatewayPreferred method, for example BITCOIN, STRIPE, PAYPAL
data-stakk-themelight, dark, or auto
data-stakk-localeCheckout locale, for example de
data-stakk-affiliateAffiliate code
data-stakk-return-urlRedirect 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