Products

Get Product Component

Changed on

Retrieves one of your product components by its fcomp_ identifier, with the nutrition you recorded for it. Nutrient values are per 100 g.

A component you have not registered nutrition for is a 404, even when the name itself exists in Flex's shared component table.

get/v1/product_components/{id}

Request

  • Base URL
    https://api.withflex.com
  • URL
    https://api.withflex.com/v1/product_components/{id}
  • Auth
    HTTP bearer

Path parameters

idstring required

The component's fcomp_ identifier.

Example:fcomp_01J9XR8M3K7VZ8N2YB4WJ6T0RA

Response

An envelope wrapping a single product component object.

Example response

{
  "product_component": {
    "component_id": "fcomp_01J9XR8M3K7VZ8N2YB4WJ6T0RA",
    "component_nutrition_id": "fcn_01J9XR8M3K7VZ8N2YB4WJ6T0RA",
    "name": "string",
    "shared": true,
    "test_mode": true,
    "category": "string",
    "serving_size_g": 0,
    "nutrition": {
      "calories": 0,
      "total_fat_g": 0,
      "saturated_fat_g": 0,
      "trans_fat_g": 0,
      "carbohydrate_g": 0,
      "fiber_g": 0,
      "protein_g": 0,
      "sodium_mg": 0,
      "added_sugar_g": 0
    },
    "vegan": true,
    "gluten_free": true,
    "canonical_food_key": "string",
    "client_reference_id": "string",
    "metadata": {},
    "created_at": "string",
    "updated_at": "string"
  }
}

Changes