Hosted Platform
Sell digital products from any website using 2DL’s hosted storefront, hosted checkout links, or the universal embed.
Using WordPress? WordPress Plugin docs
Want to see it live? View demo storefront
Requirements
- A website where you can add links/buttons (any platform).
- Ability to update DNS or serve a verification file (for domain verification).
- Stripe Connect onboarding completed for payouts.
What’s new in the hosted platform
- Hosted storefront pages you can link to from anywhere (store homepage, product pages, cart, and collections).
- Storefront templates (Minimal, Clean, Bold, Studio, Dark) with logo/hero branding.
- Storefront customization: accent colors, subtitle + trust row, collections display, announcement text, social links, and seller legal links.
- Receipt + download emails with store branding and a seller-editable (safe) template.
- Verified-purchase reviews shown on hosted product pages to add trust (reviews are collected only from completed purchases).
- Lead magnets (Pro/Studio): offer a free download via email verification.
- Hosted cart promotions: discount code entry, auto-apply promos, and upsell guidance (“near miss”) where applicable.
- Recommendations on cart + receipt (cross-sells / “frequently bought together”).
Step by step setup
- Create a seller account on 2dl.app and create a store (you’ll get a Store ID like store_…).
- Create at least one product (you’ll get a Product ID like prod_…).
- Connect Stripe Connect for payouts.
- Verify your domain(s) in 2dl.app (example: example.com and www.example.com).
Integration options
Option 0. Link to your hosted storefront (recommended)
If you want the fastest setup, publish your storefront in your seller dashboard and link to it from your website. Buyers get a full hosted experience with product pages, cart, and Stripe Checkout.
This option includes the hosted cart UX (promo code entry, auto promos when available, and product recommendations).
- Storefront home: https://2dl.app/s/store_…
- Product page: https://2dl.app/s/store_…/products/prod_…
- Cart: https://2dl.app/s/store_…/cart
- Collection pages: https://2dl.app/s/store_…/c/collection-slug
Option 1. Link to hosted checkout
- Checkout URLs are created per purchase (Stripe Checkout sessions are one-time).
- On your site, use the universal embed button (below) which creates a fresh checkout session on click.
- If you want a plain “Buy now” link/button, link it to a page on your site that contains the embed button.
Option 2. Universal embed button
Add the embed script once per page.
<script src="https://2dl.app/2dl-embed.js" defer></script>
Then add a buy button. Include session_id in your success URL so the real Stripe Checkout session id can be injected on redirect.
<button
data-2dl-buy
data-store-public-id="store_..."
data-product-public-id="prod_..."
data-success-url="https://example.com/success?session_id={CHECKOUT_SESSION_ID}"
data-cancel-url="https://example.com/cancel"
>
Buy now
</button>Success page and downloads
On your success page, read the session_id query param and call the entitlement endpoint. If the payment is confirmed and the entitlement is active, the response includes short lived signed download URLs.
Endpoint
POST https://2dl.app/api/v1/entitlements/by-session
Example request body
{ "store_public_id": "store_...", "session_id": "cs_..." }Minimal browser example
<script>
const params = new URLSearchParams(window.location.search)
const sessionId = params.get('session_id')
async function loadEntitlement() {
const res = await fetch('https://2dl.app/api/v1/entitlements/by-session', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ store_public_id: 'store_...', session_id: sessionId }),
})
const json = await res.json()
return json
}
loadEntitlement().then(console.log).catch(console.error)
</script>Domain verification is required. If your domain is not verified, the browser request fails with ORIGIN_NOT_ALLOWED.
If you can’t (or don’t want to) call from the browser, use a server-to-server integration with Store API keys and proxy the entitlement response from your backend.
Storefront features (hosted pages)
- Templates: Minimal, Clean, Bold, Studio, Dark.
- Branding: logo + hero image, accent color, and button copy.
- Conversion helpers: subtitle + trust row (up to 3 short bullets).
- Catalog: collections, product grids, and sorting behaviors.
- Trust: verified-purchase reviews on hosted product pages.
- Links: social links and seller legal links (terms/refund policy) shown in the footer when configured.
Promotions and recommendations
- Product promos: sales/auto-apply promos (where eligible) and clear discounted price display.
- Hosted cart promos: discount code entry, and buyer email capture when required by a promo rule.
- Upsell guidance: “near miss” messaging + recommended products to help buyers qualify for tiered promos.
- Cross-sell recommendations: show recommended products on cart and receipt pages.
Security and risk controls
- Domain verification + strict browser origin enforcement (prevents copy/paste buy-button theft).
- Rate limits and abuse controls across public endpoints.
- Optional step-up verification (email OTP) in higher-risk flows (for example, checkout or license verification).
- Anti-phishing safeguards for seller-editable receipt templates (plain text, safe tokens, platform-controlled links).
Receipts and download emails
After a successful Stripe payment, 2DL sends the buyer a receipt/download email. Sellers can customize the subject/body (plain text only) in the dashboard while 2DL enforces safe links and a consistent footer.
- Template tokens: {{store_name}}, {{items}}, {{receipt_url}}
- Logo is included automatically (if set), and the receipt link is always controlled by 2DL.
Lead magnets (Pro/Studio)
If you want to offer a free download in exchange for an email, enable the product lead magnet in your seller dashboard. Buyers verify their email before the download is released.
Platform recipes
These recipes all use the same core flow. They differ only in where you paste the script and how you create the button and success page on your platform.
Webflow
- Add the embed script in Webflow. Use Page Settings or Site Settings Custom Code, placed before the closing body tag.
- Add a Button element and set the custom attributes to match the universal embed attributes.
- Create a success page in Webflow (for example /success) and fetch entitlement data using thesession_id query param.
Script
<script src="https://2dl.app/2dl-embed.js" defer></script>
Button attributes
data-2dl-buy
data-store-public-id="store_..."
data-product-public-id="prod_..."
data-success-url="https://yourdomain.com/success?session_id={CHECKOUT_SESSION_ID}"
data-cancel-url="https://yourdomain.com/cancel"Shopify
Shopify does not let you run a custom checkout inside Shopify Checkout. With 2DL, you link out to Stripe Checkout and back to your store site.
- Verify the Shopify domain in 2dl.app. Include your primary domain and any alternate domain Shopify uses.
- Add the embed script to your theme so it loads on the pages where you will place Buy buttons.
- Place the universal embed button in your product template or a custom page section.
- Create a Shopify page to act as the success page, then fetch downloads from the entitlement endpoint.
Script
<script src="https://2dl.app/2dl-embed.js" defer></script>
Button example
<button
data-2dl-buy
data-store-public-id="store_..."
data-product-public-id="prod_..."
data-success-url="https://yourdomain.com/pages/success?session_id={CHECKOUT_SESSION_ID}"
data-cancel-url="https://yourdomain.com/pages/cancel"
>
Buy now
</button>Custom React and Next.js
In React, you can load the script once and render buttons anywhere. In Next.js, use the built in Script component.
Next.js example
import Script from 'next/script'
export default function ProductPage() {
return (
<>
<Script src="https://2dl.app/2dl-embed.js" strategy="afterInteractive" />
<button
data-2dl-buy
data-store-public-id="store_..."
data-product-public-id="prod_..."
data-success-url="https://yourdomain.com/success?session_id={CHECKOUT_SESSION_ID}"
data-cancel-url="https://yourdomain.com/cancel"
>
Buy now
</button>
</>
)
}Success page
Use a client side request to the entitlement endpoint from your success route. The request is allowed only from verified domains.
Squarespace
- Add the script using Squarespace Code Injection so it loads on the page with your buy button.
- Add a Code Block where you want the buy button and paste the button markup with the data attributes.
- Create a success page and use a Code Block to fetch entitlement data and render download links.
Script
<script src="https://2dl.app/2dl-embed.js" defer></script>
Button
<button
data-2dl-buy
data-store-public-id="store_..."
data-product-public-id="prod_..."
data-success-url="https://yourdomain.com/success?session_id={CHECKOUT_SESSION_ID}"
data-cancel-url="https://yourdomain.com/cancel"
>
Buy now
</button>Plain HTML
This is the simplest form. Put the script and the button on your product page.
<script src="https://2dl.app/2dl-embed.js" defer></script>
<button
data-2dl-buy
data-store-public-id="store_..."
data-product-public-id="prod_..."
data-success-url="https://yourdomain.com/success?session_id={CHECKOUT_SESSION_ID}"
data-cancel-url="https://yourdomain.com/cancel"
>
Buy now
</button>Wix
- Add the script in Wix using Custom Code so it loads on the relevant pages.
- Add an HTML Embed element and place the button markup inside it.
- Create a success page and fetch entitlement data to show downloads.
Script
<script src="https://2dl.app/2dl-embed.js" defer></script>
Button
<button
data-2dl-buy
data-store-public-id="store_..."
data-product-public-id="prod_..."
data-success-url="https://yourdomain.com/success?session_id={CHECKOUT_SESSION_ID}"
data-cancel-url="https://yourdomain.com/cancel"
>
Buy now
</button>Framer
- Add the script to your Framer site using custom code in the page or site settings.
- Use an Embed or Code component for the button markup.
- Create a success page route and fetch entitlement data to show downloads.
Script
<script src="https://2dl.app/2dl-embed.js" defer></script>
Button
<button
data-2dl-buy
data-store-public-id="store_..."
data-product-public-id="prod_..."
data-success-url="https://yourdomain.com/success?session_id={CHECKOUT_SESSION_ID}"
data-cancel-url="https://yourdomain.com/cancel"
>
Buy now
</button>Ghost
Ghost supports custom HTML in posts and pages. Add the script and the button to the page where you sell the product.
- Add the script to your theme or site header so it is available on your sales pages.
- Add the button markup in the editor using an HTML card.
- Create a success page and fetch entitlement data for downloads.
Script
<script src="https://2dl.app/2dl-embed.js" defer></script>
Button
<button
data-2dl-buy
data-store-public-id="store_..."
data-product-public-id="prod_..."
data-success-url="https://yourdomain.com/success?session_id={CHECKOUT_SESSION_ID}"
data-cancel-url="https://yourdomain.com/cancel"
>
Buy now
</button>FAQ
Q: Can I use this without WordPress?
A: Yes. That’s what the hosted platform is for.
Q: Do I need to use the universal embed?
A: No. If you don’t want to write code, link to your hosted storefront. Use the universal embed when you want to keep buyers on your own pages until checkout.
Q: Do I need to run my own backend?
A: No. Use hosted checkout links or the universal embed.