Skip to main content

Product Card Definitions Reference

Product Cards

Create reusable product card definitions for recommendation and merchandising experiences.

Audience: Frontend and merchandising teams standardizing product presentation blocks.

Critical: Product card definitions are site-scoped and managed under /api/v1/product-card-definitions/* endpoints.

Who This Page Is For

Use this page when you need to build, template, preview, and govern card layouts used in recommendation and product display contexts.

Quick Start (2-5 Minutes)

1

List templates and fields

Inspect available starter templates and product field metadata.

GET /api/v1/product-card-definitions/templates
GET /api/v1/product-card-definitions/product-fields
2

Create definition

Create site-specific product card definition from scratch.

POST /api/v1/product-card-definitions/site/:siteId
3

Create from template

Bootstrap from predefined layout and give it a custom name.

POST /api/v1/product-card-definitions/site/:siteId/from-template/:templateId
4

Preview with product payload

Generate preview output before assigning to live widgets.

POST /api/v1/product-card-definitions/:id/site/:siteId/preview
5

Duplicate and evolve

Clone definitions for A/B or regional variants.

POST /api/v1/product-card-definitions/:id/site/:siteId/duplicate

Product card endpoints

GET    /api/v1/product-card-definitions/templates
GET    /api/v1/product-card-definitions/product-fields
GET    /api/v1/product-card-definitions/site/:siteId
GET    /api/v1/product-card-definitions/:id/site/:siteId
POST   /api/v1/product-card-definitions/site/:siteId
POST   /api/v1/product-card-definitions/site/:siteId/from-template/:templateId
PUT    /api/v1/product-card-definitions/:id/site/:siteId
POST   /api/v1/product-card-definitions/:id/site/:siteId/duplicate
POST   /api/v1/product-card-definitions/:id/site/:siteId/preview
DELETE /api/v1/product-card-definitions/:id/site/:siteId

Required Fields / Minimum Payload

FieldRequiredTypeUsed by eventsDescription
siteIdRequireduuidAll site-scoped product card routesSite ownership boundary.
nameRequiredstringCreate/update/from-templateDefinition name shown in selection UIs.
product card config payloadRequiredobjectCreate/update definitionLayout, field mapping, style, and behavior configuration.
product (preview payload)OptionalobjectPreview endpointSample product payload for preview rendering.

Event or Endpoint Decision Matrix

ScenarioUse ThisWhy
Need quick start card layouttemplates + from-template endpointFast bootstrap from curated presets.
Need fully custom cardPOST /product-card-definitions/site/:siteIdCustom design and mapping control.
Need safe variant testingduplicate endpointClone baseline without risking production config.
Need pre-release visual validationpreview endpointRender preview before attachment to live placements.
Need cleanup of deprecated cardDELETE endpointRemoves obsolete definition cleanly.

Common Errors and Fixes

Preview fails with missing fields

Cause: Preview product payload missing required mapped fields.

Fix: Use product-fields metadata and provide complete sample payload.

Card appears inconsistent across widgets

Cause: Multiple divergent definitions assigned inconsistently.

Fix: Standardize definition assignment policy per placement type.

Template create fails

Cause: templateId invalid for selected site context.

Fix: Fetch templates first and use exact template ID.

Changes unexpectedly impact live experiences

Cause: Direct update of production definition without duplication.

Fix: Duplicate first, test, then switch assignment deliberately.

Production Checklist

  • Product card definitions have versioning and ownership metadata.Required
  • Preview is required before production assignment changes.Required
  • Templates are used for consistency where applicable.Required
  • Definition duplication is preferred for risky changes.Required
  • Deprecated cards are cleaned up to reduce drift.Required

Next Steps