Generate SmartLabel Pages
The SmartLabel program allows brands to link product packaging to a standardized online web page that can contain much more information than the label alone. This can include allergy information, ingredient provenance, brand information, health and safety advice, brand contact details, and more.
This feature allows a much improved brand-consumer relationship that isn't limited by the minimal space available on most consumer packaged goods. Brands can provide more detailed and up-to-date information to consumers, while being able to comply with labelling regulations and building a closer relationship with their customers.
Using SmartLabel with EVRYTHNG
EVRYTHNG offers a dynamic SmartLabel page that is populated by your own product information in your account. This allows you to create many SmartLabel-enabled product experiences to be created, which can be updated if requirements change or errors are found.
The process for enabling a SmartLabel experience for your food or beverage product is:
- Use one of the methods listed below to populate the required fields that drive the dynamic page template.
- Go to
smartlabel.evrythng.io/foodBeverages
, and specify the Application API Key and product ID asaccess_token
andproduct
. The page loads the product and populates the template. - The SmartLabel page is now ready for use on packaging.
Example Page
You can try this example for a sample product using this link. The data for a similar product is used in the code examples below.
Create with EVRYTHNG CLI
If you're creating a few SmartLabel pages, one approach is to use the interactive evrythng-cli-plugin-smartlabel
plugin for the EVRYTHNG CLI community tool. This topic walks you through entering data for each required field one at a time and provides a helpful description of each. After all the fields have a value, the result is validated and then sent to the API to become an actual product.
- Install the EVRYTHNG CLI with
npm i -g evrythng-cli
- Install the SmartLabel plugin with
npm i -g evrythng-cli-plugin-smartlabel
- Get the ID of the project containing the product.
From here you can choose either of these approaches:
Run the evrythng smartlabel build
command and provide a value for each prompt given until the product is created.
evrythng smartlabel build --project $PROJECT_ID
Alternatively, run the evrythng smartlabel create
command and provide in the command a JSON string of a pre-prepared product, either created by hand or transformed from some other data source. This is also validated before being sent to the API.
For example:
evrythng smartlabel create '{
"customFields": {
"smartLabel:added_sugars_dv": "18",
"smartLabel:added_sugars_g": "9",
"smartLabel:allergens": "Egg,Milk,Soy,Wheat,Tree Nuts",
"smartLabel:calories": "150",
"smartLabel:certifications": "Example Kosher Cert|The Example Kosher Cert attribute includes all products that bear the Example Kosher logo.",
"smartLabel:cholesterol_dv": "0",
"smartLabel:cholesterol_mg": "0",
"smartLabel:claims": "No Artificial Color|Includes all products making a claim related to the product being free of artificial colors.,No Artificial Flavor|Includes all products making a claim related to the product being free of artificial flavor.,No Preservative|The No Preservative Claim includes all products making a claim related to being free of preservatives.",
"smartLabel:company_address": "23 Park Blvd, Palo Alto, CA, USA",
"smartLabel:company_email": "[email protected]",
"smartLabel:company_phone": "+447950821234",
"smartLabel:company_privacy": "https://example.com/privacy-policy/",
"smartLabel:dietary_fiber_dv": "3",
"smartLabel:dietary_fiber_g": "<1",
"smartLabel:gmo_disclosure": "No GMO Used|No GMO products were used in the making of this product.",
"smartLabel:health_and_safety": "The BrandName Promise|BrandName Quality is your assurance of great quality products at the best value everyday - from delicious frozen entrees and freshly baked French bread to home essentials. Quality & satisfaction guaranteed or your money back.,Satisfaction Guarantee|OUR PROMISE - QUALITY & SATISFACTION 100% GUARANTEED OR YOUR MONEY BACK.",
"smartLabel:ingredients": "Enriched Flour, Wheat Flour, Niacin, Reduced Iron, Vitamin B1 [Thiamin Mononitrate], Vitamin B2 [Riboflavin], Folic Acid, Sugar, Vegetable Oil (Soybean and Palm Oil with TBHQ for freshness), Whole Grain Oats, Raisin Paste, Contains 2% or less of Baking Soda, Salt, Spice, Whey, Soy Lecithin",
"smartLabel:product_descriptor": "One shelf unit",
"smartLabel:product_grade": "Premium Quality",
"smartLabel:product_instructions": "Enjoy with Milk|Enjoy these cookies with your favorite choice of milk.",
"smartLabel:product_juice_declaration": "No meat juices used in this product",
"smartLabel:product_meat_legend": "No meat",
"smartLabel:protein_g": "2",
"smartLabel:sat_fat_dv": "10",
"smartLabel:sat_fat_g": "2",
"smartLabel:serving_size": "2 Cookies",
"smartLabel:servings_per_container": "11",
"smartLabel:sodium_dv": "9",
"smartLabel:sodium_mg": "200",
"smartLabel:sugars_g": "10",
"smartLabel:sustainability": "Sustainable Energy|Made using sustainable energy sources",
"smartLabel:total_carbohydrates_dv": "8",
"smartLabel:total_carbohydrates_g": "23",
"smartLabel:total_fat_dv": "8",
"smartLabel:total_fat_g": "6",
"smartLabel:trans_fat_g": "0",
"smartLabel:website_name": "example.com",
"smartLabel:website_url": "https://example.com",
"smartLabel:weight_oz": "12.5"
},
"brand": "BrandName",
"name": "BrandName Oatmeal Cranberry Cookies",
"photos": [
"https://example.com/product.png"
],
"identifiers": {
"gs1:01": "10293847564738"
}
}' --project UnghCKffVg8a9KwRwE5C9qBs
Create through the API
For a larger number of products that require equivalent SmartLabel-compatible product resources in the EVRYTHNG Platform, you'll find it easier to submit each item in a separate API request with a pre-prepared payload that meets the schema detailed below. This allows the loading of SmartLabel data to be automated and pushed from some other system (with the developer responsible for performing the transformation from their own data format).
Warning
Through this method, there is no automatic validation of SmartLabel-specific data against the schema. Add this validation yourself or consider using the CLI plugin
create
command.
Each product added requires one Create a Product request containing the fully formed product payload. For example:
POST /products?project=$PROJECT_ID
Authorization: $OPERATOR_API_KEY
Content-Type: application/json
{
"customFields": {
"smartLabel:added_sugars_dv": "18",
"smartLabel:added_sugars_g": "9",
"smartLabel:allergens": "Egg,Milk,Soy,Wheat,Tree Nuts",
"smartLabel:calories": "150",
"smartLabel:certifications": "Example Kosher Cert|The Example Kosher Cert attribute includes all products that bear the Example Kosher logo.",
"smartLabel:cholesterol_dv": "0",
"smartLabel:cholesterol_mg": "0",
"smartLabel:claims": "No Artificial Color|Includes all products making a claim related to the product being free of artificial colors.,No Artificial Flavor|Includes all products making a claim related to the product being free of artificial flavor.,No Preservative|The No Preservative Claim includes all products making a claim related to being free of preservatives.",
"smartLabel:company_address": "23 Park Blvd, Palo Alto, CA, USA",
"smartLabel:company_email": "[email protected]",
"smartLabel:company_phone": "+447950821234",
"smartLabel:company_privacy": "https://example.com/privacy-policy/",
"smartLabel:dietary_fiber_dv": "3",
"smartLabel:dietary_fiber_g": "<1",
"smartLabel:gmo_disclosure": "No GMO Used|No GMO products were used in the making of this product.",
"smartLabel:health_and_safety": "The BrandName Promise|BrandName Quality is your assurance of great quality products at the best value everyday - from delicious frozen entrees and freshly baked French bread to home essentials. Quality & satisfaction guaranteed or your money back.,Satisfaction Guarantee|OUR PROMISE - QUALITY & SATISFACTION 100% GUARANTEED OR YOUR MONEY BACK.",
"smartLabel:ingredients": "Enriched Flour, Wheat Flour, Niacin, Reduced Iron, Vitamin B1 [Thiamin Mononitrate], Vitamin B2 [Riboflavin], Folic Acid, Sugar, Vegetable Oil (Soybean and Palm Oil with TBHQ for freshness), Whole Grain Oats, Raisin Paste, Contains 2% or less of Baking Soda, Salt, Spice, Whey, Soy Lecithin",
"smartLabel:product_descriptor": "One shelf unit",
"smartLabel:product_grade": "Premium Quality",
"smartLabel:product_instructions": "Enjoy with Milk|Enjoy these cookies with your favorite choice of milk.",
"smartLabel:product_juice_declaration": "No meat juices used in this product",
"smartLabel:product_meat_legend": "No meat",
"smartLabel:protein_g": "2",
"smartLabel:sat_fat_dv": "10",
"smartLabel:sat_fat_g": "2",
"smartLabel:serving_size": "2 Cookies",
"smartLabel:servings_per_container": "11",
"smartLabel:sodium_dv": "9",
"smartLabel:sodium_mg": "200",
"smartLabel:sugars_g": "10",
"smartLabel:sustainability": "Sustainable Energy|Made using sustainable energy sources",
"smartLabel:total_carbohydrates_dv": "8",
"smartLabel:total_carbohydrates_g": "23",
"smartLabel:total_fat_dv": "8",
"smartLabel:total_fat_g": "6",
"smartLabel:trans_fat_g": "0",
"smartLabel:website_name": "example.com",
"smartLabel:website_url": "https://example.com",
"smartLabel:weight_oz": "12.5"
},
"brand": "BrandName",
"name": "BrandName Oatmeal Cranberry Cookies",
"photos": [
"https://example.com/product.png"
],
"identifiers": {
"gs1:01": "10293847564738"
}
}
curl -H "Authorization: $OPERATOR_API_KEY" \
-H "Content-Type: application/json" \
-X POST '/products?project=$PROJECT_ID' \
-d '{
"customFields": {
"smartLabel:added_sugars_dv": "18",
"smartLabel:added_sugars_g": "9",
"smartLabel:allergens": "Egg,Milk,Soy,Wheat,Tree Nuts",
"smartLabel:calories": "150",
"smartLabel:certifications": "Example Kosher Cert|The Example Kosher Cert attribute includes all products that bear the Example Kosher logo.",
"smartLabel:cholesterol_dv": "0",
"smartLabel:cholesterol_mg": "0",
"smartLabel:claims": "No Artificial Color|Includes all products making a claim related to the product being free of artificial colors.,No Artificial Flavor|Includes all products making a claim related to the product being free of artificial flavor.,No Preservative|The No Preservative Claim includes all products making a claim related to being free of preservatives.",
"smartLabel:company_address": "23 Park Blvd, Palo Alto, CA, USA",
"smartLabel:company_email": "[email protected]",
"smartLabel:company_phone": "+447950821234",
"smartLabel:company_privacy": "https://example.com/privacy-policy/",
"smartLabel:dietary_fiber_dv": "3",
"smartLabel:dietary_fiber_g": "<1",
"smartLabel:gmo_disclosure": "No GMO Used|No GMO products were used in the making of this product.",
"smartLabel:health_and_safety": "The BrandName Promise|BrandName Quality is your assurance of great quality products at the best value everyday - from delicious frozen entrees and freshly baked French bread to home essentials. Quality & satisfaction guaranteed or your money back.,Satisfaction Guarantee|OUR PROMISE - QUALITY & SATISFACTION 100% GUARANTEED OR YOUR MONEY BACK.",
"smartLabel:ingredients": "Enriched Flour, Wheat Flour, Niacin, Reduced Iron, Vitamin B1 [Thiamin Mononitrate], Vitamin B2 [Riboflavin], Folic Acid, Sugar, Vegetable Oil (Soybean and Palm Oil with TBHQ for freshness), Whole Grain Oats, Raisin Paste, Contains 2% or less of Baking Soda, Salt, Spice, Whey, Soy Lecithin",
"smartLabel:product_descriptor": "One shelf unit",
"smartLabel:product_grade": "Premium Quality",
"smartLabel:product_instructions": "Enjoy with Milk|Enjoy these cookies with your favorite choice of milk.",
"smartLabel:product_juice_declaration": "No meat juices used in this product",
"smartLabel:product_meat_legend": "No meat",
"smartLabel:protein_g": "2",
"smartLabel:sat_fat_dv": "10",
"smartLabel:sat_fat_g": "2",
"smartLabel:serving_size": "2 Cookies",
"smartLabel:servings_per_container": "11",
"smartLabel:sodium_dv": "9",
"smartLabel:sodium_mg": "200",
"smartLabel:sugars_g": "10",
"smartLabel:sustainability": "Sustainable Energy|Made using sustainable energy sources",
"smartLabel:total_carbohydrates_dv": "8",
"smartLabel:total_carbohydrates_g": "23",
"smartLabel:total_fat_dv": "8",
"smartLabel:total_fat_g": "6",
"smartLabel:trans_fat_g": "0",
"smartLabel:website_name": "example.com",
"smartLabel:website_url": "https://example.com",
"smartLabel:weight_oz": "12.5"
},
"brand": "BrandName",
"name": "BrandName Oatmeal Cranberry Cookies",
"photos": [
"https://example.com/product.png"
],
"identifiers": {
"gs1:01": "10293847564738"
}
}'
Viewing the Result
To view the resulting SmartLabel page, navigate to the following URL where $APPLICATION_API_KEY
is the Application API Key of an application in the project the product containing the data is scoped to, and $PRODUCT_ID
is the id
of the product itself.
https://smartlabel.evrythng.io/foodBeverages?product=$PRODUCT_ID&access_token=$APPLICATION_API_KEY
The page will use the API key to load the product and insert each data item into the template, resulting in a fully functional SmartLabel page.
Required Fields
See the schema product.schema.json
in the CLI plugin repository for a complete list of the fields required on an EVRYTHNG product resource to fully populate the EVRYTHNG SmartLabel page.
Updated almost 2 years ago