StackFill API
Self-serve embeds and API setup
Teams create their own embed applications, API keys, product mappings, and copy-paste snippets from the workspace dashboard.
Onboarding flow
- Create an embed app in Dashboard - Integrations and add the exact storefront origin, such as
https://shop.example.com. - Copy the reveal-once publishable key. StackFill only shows full key values at creation time.
- Create a product mapping that connects your storefront product ID, variant, or SKU to a live StackFill template.
- Paste the widget snippet on the allowed storefront, or create sessions from your backend with a secret key.
Browser widget
Use a publishable key only on browser pages. The key is origin-restricted by the embed app settings.
<script src="https://cdn.stackfill.com/widget/v1.js" async></script>
<button
type="button"
data-stackfill-open
data-stackfill-key="stackfill_live_pk_REVEAL_ONCE"
data-stackfill-product="demo-card">
Personalize
</button>
Server-created sessions
Use a secret or restricted key when your cart or backend controls customer, order, or metadata values.
curl https://api.stackfill.com/v1/embed/sessions \
-H "Authorization: Bearer stackfill_live_sk_REVEAL_ONCE" \
-H "Content-Type: application/json" \
-d '{
"external_product_id": "demo-card",
"customer": {
"email": "customer@example.com",
"name": "Customer Name"
}
}'
Core endpoints
| Method | Path | Use |
|---|---|---|
POST | /v1/embed/sessions/guest | Create a widget session with a publishable key. |
POST | /v1/embed/sessions | Create a server-controlled session with a secret or restricted key. |
POST | /v1/product_mappings/resolve | Resolve an external product or SKU to a template. |
GET | /v1/templates | List team templates for API integrations. |