Retrieve a recipe
const url = 'https://api.stocksmith.io/api/v1/recipes/1';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.stocksmith.io/api/v1/recipes/1 \ --header 'Authorization: Bearer <token>'Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”Recipe ID
Responses
Section titled “ Responses ”Recipe details
object
object
ID of the associated product
Decimal string
object
Which endpoint resolves ingredient_id: materials for ‘material’, components for ‘component’
ID of the material or component. Null only when a component’s record is missing
Deprecated: use ingredient_id. Populated for materials only, null for components
Deprecated: use ingredient_name
Decimal string
Unit of measure name
Total materials cost. Omitted for view-only users.
object
Decimal string, e.g. ‘8.75’
ISO 4217 code, e.g. ‘USD’
Per-unit materials cost. Omitted for view-only users.
object
Decimal string, e.g. ‘8.75’
ISO 4217 code, e.g. ‘USD’
Total estimated labour cost. Omitted for view-only users.
object
Decimal string, e.g. ‘8.75’
ISO 4217 code, e.g. ‘USD’
Per-unit estimated labour cost. Omitted for view-only users.
object
Decimal string, e.g. ‘8.75’
ISO 4217 code, e.g. ‘USD’
Total cost of goods sold. Omitted for view-only users.
object
Decimal string, e.g. ‘8.75’
ISO 4217 code, e.g. ‘USD’
Per-unit cost of goods sold. Omitted for view-only users.
object
Decimal string, e.g. ‘8.75’
ISO 4217 code, e.g. ‘USD’
Example
{ "recipe": { "ingredients": [ { "ingredient_type": "material" } ] }}Missing or invalid Bearer token
object
Error message
Example generated
{ "error": "example"}Recipe not found
object
Error message
Example generated
{ "error": "example"}