API guide

Product mappings

Product mappings

Use product mappings when your storefront product IDs need to resolve to StackFill templates.

Create a mapping

curl https://api.stackfill.com/v1/product_mappings \
  -H "Authorization: Bearer stackfill_live_sk_REPLACE_ME" \
  -H "Content-Type: application/json" \
  -d '{
    "template_id": "tpl_123",
    "embed_application_id": "embapp_123",
    "external_product_id": "business-card",
    "external_variant_id": "standard",
    "title": "Business card"
  }'

Resolve from a browser

curl https://api.stackfill.com/v1/product_mappings/resolve \
  -H "X-StackFill-Publishable-Key: stackfill_live_pk_REPLACE_ME" \
  -H "Content-Type: application/json" \
  -d '{"external_product_id":"business-card","external_variant_id":"standard"}'

Common errors

product_mapping_exists means the same product, variant, and embed application combination already exists.

product_mapping_not_found means no active mapping points to a live template.

See Product mappings reference.