## Create a new valuation for an entity `client.Entities.Valuation.New(ctx, id, body) (*Valuation, error)` **post** `/entities/{id}/valuation` Add a new valuation to the entity's history ### Parameters - `id string` - `body EntityValuationNewParams` - `DirectlyHeldAssets param.Field[[]EntityValuationNewParamsDirectlyHeldAsset]` List of assets to include in this valuation - `AssetClassID string` Asset class ID to associate with this asset - `DisplayName string` Display name of the asset - `Value float64` Value of this asset in USD - `ExternalID string` External ID for the asset - `EffectiveDate param.Field[Time]` The date this valuation is effective - `Description param.Field[string]` Free-form notes about this valuation ### Returns - `type Valuation struct{…}` - `ID string` Unique identifier with valuationv2_ prefix - `CreatedAt Time` Timestamp when the valuation was created - `DirectlyHeldAssetValue float64` Total value of all directly held assets in USD - `DirectlyHeldAssets []ValuationDirectlyHeldAsset` List of individual assets in this valuation - `ID string` Asset ID - `AssetClass ValuationDirectlyHeldAssetAssetClass` - `ID string` Asset class ID - `DisplayName string` Display name of the asset class - `DisplayName string` Display name of the asset - `Value float64` Value of this asset in USD - `ExternalID string` External ID from the static asset (if available) - `EffectiveDate Time` The date this valuation is effective - `EntityID string` Entity ID this valuation belongs to - `TotalValue float64` Total value of all assets minus liabilities in USD - `UpdatedAt Time` Timestamp when the valuation was last updated - `Description string` Free-form notes about this valuation ### Example ```go package main import ( "context" "fmt" "time" "github.com/withluminary/go-sdk" "github.com/withluminary/go-sdk/option" ) func main() { client := withluminary.NewClient( option.WithClientID("My Client ID"), option.WithClientSecret("My Client Secret"), ) valuation, err := client.Entities.Valuation.New( context.TODO(), "id", withluminary.EntityValuationNewParams{ DirectlyHeldAssets: []withluminary.EntityValuationNewParamsDirectlyHeldAsset{withluminary.EntityValuationNewParamsDirectlyHeldAsset{ AssetClassID: "asset_class_01ARZ3NDEKTSV4RRFFQ69G5FAV", DisplayName: "Apple Inc. Stock", Value: 50000, }}, EffectiveDate: time.Now(), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", valuation.ID) } ``` #### Response ```json { "id": "valuationv2_01ARZ3NDEKTSV4RRFFQ69G5FAV", "created_at": "2024-01-15T09:30:00Z", "directly_held_asset_value": 1000000, "directly_held_assets": [ { "id": "assetv2_01ARZ3NDEKTSV4RRFFQ69G5FAV", "asset_class": { "id": "asset_class_01ARZ3NDEKTSV4RRFFQ69G5FAV", "display_name": "Equities" }, "display_name": "Apple Inc. Stock", "value": 50000, "external_id": "AAPL-12345" } ], "effective_date": "2024-01-15", "entity_id": "entity_01ARZ3NDEKTSV4RRFFQ69G5FAV", "total_value": 1000000, "updated_at": "2024-01-20T14:45:00Z", "description": "description" } ```