Products

Product Sync API offers you the ability to synchronize your branded products in Whisk Studio and use them as ingredients in your recipes.

Let's first understand the Product object and its data structure before looking at its endpoints' description.

Product Object

A Product object is a collection of arrays and attributes that defines the data structure for any given product.

This is how the data structure of a product looks in JSON format:

{
"product": {
"id": "5febbcd1bc31826090025de5",
"name": "Bitchin' Sauce Original",
"gtin": "08801007763910",
"description": "The OG. Where Bitchin’ began. Creamy lemon and garlic. Simple and Satisfying.",
"brand": "Bitchin'",
"created_at": "1609284817642",
"updated_at": "1609284863384",
"images": [
...
],
"language": "en",
"price": {
...
},
"instructions": [
...
],
"ingredients": [
...
],
"url": "https://bitchinsauce.com/",
"author": {
...
},
"amount": {
...
},
"serving_size": {
...
},
"nutrition": [
...
],
"external_product_id": "30252563"
}
}

Core Data

The following attributes define the core of the product:

Attribute

Type

Description

id

string

The product identifier.

name

string

The product’s full name.

gtin

string

The Global Trade Item Number assigned to the product.

description

string

A summary describing the product.

brand

string

The product’s brand name.

created_at

string

The product creation date and time in Unix format

updated_at

string

The last product update date and time in Unix format

language

string

As per ISO 639 standards, a two-letter code indicating the language used in product definition.

url

string

The product’s origin URL.

external_product_id

string

An identifier assigned by the product's author.

In addition to the base attributes, there are objects and arrays contain more information on the product.

Images

This array contains information on one or more images of the product.

"images":[
{
"url":"https://img.cjthemarket.com/images/file/product/973/20191226105710715.jpg",
"responsive":{
"url":"https://whisk-res.cloudinary.com/image/upload/v1602854082/inventory_item/8bade35e90ecf44eac6ec7ae5346d228.jpg",
"width":1200,
"height":1200
}
},
...
],

Attribute

Type

Description

url

string

The product’s image URL.

responsive

object

A responsive image adjusts its size based on the screen size. This object contains attributes to access the image with flexible size based on need.

Responsive

This array contains the following attributes:

Attribute

Type

Description

url

string

Hosted URL of an image.

width

number

Image width.

height

number

Image height.

Price

This object contains information on the product cost.

"price": {
"rrp": {
"currency_code": "USD",
"cents": "500",
}
},

Attribute

Type

Description

rrp

object

This object contains attributes related to the recommended retail price of the product.

Recommended Retail Price (rrp)

Attribute

Type

Description

currency_code

string

The three-letter currency code as per ISO 4217 standards.

units

string

The product’s price in cents. For example, if the currency_code is USD, then 100 cents makes 1 USD.

Instructions

This array contains information on the product instructions.

"instructions": [
{
"text": "Store in the refrigerator.",
"group": "Storage"
}
...
],

Attribute

Type

Description

text

string

Instruction’s text.

group

string

Instruction’s group.

Ingredients

This array contains information on the product ingredients.

"ingredients":[
{
"text":"Water, Grapeseed Oil, Almonds, Lemon Juice, Soy Sauce, Nutritional Yeast, Garlic, Spices, Sea Salt",
"group":"Consolidated"
},
...
],

Attribute

Type

Description

text

string

Ingredient’s description.

group

string

Ingredient’s group.

Author

This object contains information on the Whisk user who created the product.

"author":{
"id":"ehd678gkttgfr58zd",
"name":"Dan",
"image":{
"url":"https://img.cjthemarket.com/images/file/author/973/20191226105710715.jpg",
"responsive":{
"url":"https://whisk-res.cloudinary.com/image/upload/v1602854082/author/8bade35e90ecf44eac6ec7ae5346d228.jpg",
"width":300,
"height":300
}
}
},

Attribute

Type

Description

id

string

The product creator's identifier.

name

string

The product creator's name.

image

object

The product creator's image. See the images array description for more information.

Amount

This object contains information on the product’s quantity.

"amount":{
"unit":"g",
"quantity":200
}

Attribute

Type

Description

unit

string

The measurement unit of the product's quantity.

quantity

number

The product volume or count.

Serving Size

This object contains information on the number of people that can be served by the product.

"serving_size":{
"unit":"g",
"quantity":50
},

Attribute

Type

Description

unit

string

The measurement unit of the product's serving.

quantity

number

The serving volume or count.

Optional Data

The product data structure may include extra information based on any additional parameters included in the API request.

Nutrition

‌This array contains information about the product's nutritional value.

"nutrition":[
{
"label":"Energy",
"code":"NUTRITION_CODE_ENERC_KCAL",
"value":"1200"
"unit":"NUTRITION_UNIT_KCAL"
},
...
],

Attribute

Type

Description

Example

label

string

The name of the nutrient.

Energy

code

enum

The nutrient code.

  • NUTRITION_CODE_ENERC_KCAL

  • NUTRITION_CODE_FAT

  • NUTRITION_CODE_FASAT

  • NUTRITION_CODE_CHOCDF

  • NUTRITION_CODE_SUGAR

  • NUTRITION_CODE_PROCNT

  • NUTRITION_CODE_NA

  • NUTRITION_CODE_FIBTG

  • NUTRITION_CODE_FATRN

  • NUTRITION_CODE_FAMS

  • NUTRITION_CODE_FAPU

  • NUTRITION_CODE_FAT_UNSAT

  • NUTRITION_CODE_CHOLE

  • NUTRITION_CODE_CA

  • NUTRITION_CODE_MG

  • NUTRITION_CODE_K

  • NUTRITION_CODE_FE

  • NUTRITION_CODE_ZN

  • NUTRITION_CODE_P

  • NUTRITION_CODE_VITA_RAE

  • NUTRITION_CODE_VITC

  • NUTRITION_CODE_THIA

  • NUTRITION_CODE_RIBF

  • NUTRITION_CODE_NIA

  • NUTRITION_CODE_VITB6A

  • NUTRITION_CODE_FO

  • NUTRITION_CODE_VITB12

  • NUTRITION_CODE_VITD

  • NUTRITION_CODE_TOCPHA

  • NUTRITION_CODE_VITK1

value

number

The nutrient's value/amount.

1200

unit

enum

The measurement unit of the nutrient's value.

  • NUTRITION_UNIT_G

  • NUTRITION_UNIT_MG

  • NUTRITION_UNIT_MKG

  • NUTRITION_UNIT_KCAL

Endpoints

Product API includes three endpoints that you can periodically use to pull, create, update, or delete products.