Implement badges

ℹ️

Before you begin

Contact your Customer Success Manager to have badges enabled for your company.

How Constructor returns badges

Constructor includes badge assignments in the API response for the following surfaces:

Badge information appears in the labels field within each item in a results array. If Constructor does not assign any badges to an item, then the labels field will be empty.

"results": [
  {
    "labels": {
      "__cnstrc_is_context_bestseller": { "display_name": "is_context_bestseller", "value": null },
      "__cnstrc_is_global_bestseller": { "display_name": "is_global_bestseller", "value": null },
      "__cnstrc_times_was_bought_last_week": { "display_name": "times_was_bought_last_week", "value": "63" }
    }
  }
]

Render badges on your storefront

Your team is responsible for parsing the labels field and deciding how badges appear in your storefront. This includes:

Design: What the badges look like (e.g., style, color, shape, etc.)

Display rules: How many badges to show per item, and in what order.

ℹ️

Preview badges in the Constructor dashboard

You can use Interact to preview returned badges for specific search results pages, browse category pages, and collections. Learn more about previewing badges in Interact.


Did this page help you?