---
title: "How do I create or generate a recipe?"
slug: "how-do-i-create-or-generate-a-recipe"
description: "Create a recipe in LUSID"
tags: ["recipe", "create a recipe", "valuation recipe"]
updated: 2025-01-16T11:35:55Z
published: 2025-01-16T11:35:55Z
canonical: "support.lusid.com/how-do-i-create-or-generate-a-recipe"
---

> ## Documentation Index
> Fetch the complete documentation index at: https://support.lusid.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How do I create or generate a recipe?

## Creating a recipe by hand

**Required reading**: [What is a recipe?](/v1/docs/what-is-a-recipe)

### Using the LUSID REST API

1. [Obtain an API access token](/v1/docs/how-do-i-obtain-and-use-a-short-lived-api-access-token-from-okta).
2. Call the [UpsertConfigurationRecipe](https://www.lusid.com/docs/api#operation/UpsertConfigurationRecipe) API, specifying at a minimum:
  - A `scope` and `code` that together uniquely identify the recipe.
  - At least one [market data rule](/v1/docs/recipes-locating-market-data) in the `marketRules` array of the `market` section that enables LUSID to retrieve market data suitable to value the instruments held.

By default, a recipe uses a built-in pricing model for each type of instrument (such as `SimpleStatic` for instruments of type `Equity`); you can specify [vendor model rules](/v1/docs/recipes-changing-the-default-pricing-models-for-instrument-types) to choose more sophisticated pricing models if you wish. A recipe also has many options that default to sensible values; you can choose to [override these](/v1/docs/recipes-changing-default-recipe-options).

For example, to create a simple recipe that might be suitable to value a portfolio of equities using market prices that are:

- Supplied by EDI
- Loaded into the LUSID Quote Store using FIGI identifiers
- Encapsulated in a `MyQuoteScope`:

```json
curl -X POST "https://<your-domain>.lusid.com/api/api/recipes" 
  -H "Content-Type: application/json-patch+json" 
  -H "Authorization: Bearer <your-API-access-token>" 
  -d '{
 "configurationRecipe": {
   "scope": "Recipes",
   "code": "SimpleEquityPricer",
   "market": {
     "marketRules": [
       {
         "key": "Quote.Figi.*",
         "supplier": "Edi",
         "dataScope": "MyQuoteScope",
         "quoteType": "Price",
         "field": "mid",
         "quoteInterval": "2D.0D"
       }
     ]
   },
   "description": "Simple recipe to value equities using price * units"
 }
}'
```

### Using the LUSID web app

This functionality is coming soon. At the moment, you can list your recipes by [signing into the LUSID web app](https://www.lusid.com/app/home) and navigating to the **Data Management > Recipes** dashboard.

To examine a recipe in JSON form, select it and click the **View** or **Edit** button. Note a **Create recipe** button exists but currently there is no wizard to help you do so.

![](https://cdn.document360.io/d575ad81-c0ed-4980-bbd1-d59ac5c3de82/Images/Documentation/75902f03-69cf-43d1-9e03-b0b7b0ed5994.png)

## Asking LUSID to generate a recipe for you

You can specify a portfolio to value and characteristics of appropriate market prices in the LUSID Quote Store and ask LUSID to generate a recipe that calculates the value of each position by multiplying the price of the underlying instrument by the number of units held.

> **Note**: Alternatively, you can supply a simple recipe and ask LUSID to create a more sophisticated recipe for you.

To do this:

1. [Obtain an API access token](/v1/docs/how-do-i-obtain-and-use-a-short-lived-api-access-token-from-okta).
2. Call the [GenerateConfigurationRecipe](https://www.lusid.com/docs/api#operation/GenerateConfigurationRecipe) API, specifying:
  - The `scope` and `code` of a transaction portfolio to value.
  - One or more quote `scopes` encapsulating prices for the underlying instruments loaded into the LUSID Quote Store.

For example, to value a portfolio with a `scope` of `Growth` and `code` of `UKEquities` using prices encapsulated in a quote `scope` of `MyQuoteScope`:

```json
curl -X POST "https://<your-domain>.lusid.com/api/api/aggregation/Growth/UKEquities/$generateconfigurationrecipe" 
  -H "Content-Type: application/json-patch+json" 
  -H "Authorization: Bearer <your-API-access-token>"
  -d '{
  "recipeCreationMarketDataScopes": [
    "MyQuoteScope"
  ],
  "effectiveAt": "2022-11-01"
}'
```

LUSID might generate a recipe like the one below (note all recipe options are set to sensible default values):

```json
{
  "scope": "Growth",
  "code": "LUSID_generated_recipe",
  "market": {
    "marketRules": [
      {
        "key": "Quote.Figi.*",
        "supplier": "Lusid",
        "dataScope": "MyQuoteScope",
        "quoteType": "Price",
        "field": "mid",
        "priceSource": "",
        "sourceSystem": "Lusid"
      },
      {
        "key": "Fx.*.*",
        "supplier": "Lusid",
        "dataScope": "default",
        "quoteType": "Price",
        "field": "mid",
        "priceSource": "",
        "sourceSystem": "Lusid"
      }
    ],
    "suppliers": {},
    "options": {
      "defaultSupplier": "Lusid",
      "defaultInstrumentCodeType": "LusidInstrumentId",
      "defaultScope": "default",
      "attemptToInferMissingFx": false,
      "calendarScope": "CoppClarkHolidayCalendars",
      "conventionScope": "Conventions"
    },
    "specificRules": []
  },
  "pricing": {
    "modelRules": [],
    "modelChoice": {},
    "options": {
      "modelSelection": {
        "library": "Lusid",
        "model": "SimpleStatic"
      },
      "useInstrumentTypeToDeterminePricer": false,
      "allowAnyInstrumentsWithSecUidToPriceOffLookup": false,
      "allowPartiallySuccessfulEvaluation": false,
      "produceSeparateResultForLinearOtcLegs": false,
      "enableUseOfCachedUnitResults": false,
      "windowValuationOnInstrumentStartEnd": false,
      "removeContingentCashflowsInPaymentDiary": false,
      "useChildSubHoldingKeysForPortfolioExpansion": false,
      "validateDomesticAndQuoteCurrenciesAreConsistent": false
    },
    "resultDataRules": []
  },
  "aggregation": {
    "options": {
      "useAnsiLikeSyntax": false,
      "allowPartialEntitlementSuccess": false,
      "applyIso4217Rounding": false
    }
  },
  "inheritedRecipes": [],
  "description": "- recipe has been supplemented with additional market data rules",
  "holding": {
    "taxLotLevelHoldings": true
  }
}
```
