2.16.0 (latest) 2.15.0 2.14.0 2.13.0 2.12.0 2.11.0 2.10.0 2.9.0 2.8.0 2.7.0 2.6.0 2.5.0 2.4.0 2.3.0 2.2.0 2.1.0 2.0.0 1.6.0 1.5.0 1.4.0 1.3.0 1.2.0 1.1.0 1.0.0

    public sealed class PriceInfo : IMessage<PriceInfo>, IEquatable<PriceInfo>, IDeepCloneable<PriceInfo>, IBufferMessage, IMessage

Reference documentation and code samples for the Retail v2 API class PriceInfo.

The price information of a \[Product\]\[google.cloud.retail.v2.Product\].

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> PriceInfo

## Implements

[IMessage](https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.md.txt)[PriceInfo](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Retail.V2/latest/Google.Cloud.Retail.V2.PriceInfo.md.txt), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[PriceInfo](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Retail.V2/latest/Google.Cloud.Retail.V2.PriceInfo.md.txt), [IDeepCloneable](https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.md.txt)[PriceInfo](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Retail.V2/latest/Google.Cloud.Retail.V2.PriceInfo.md.txt), [IBufferMessage](https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.md.txt), [IMessage](https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.md.txt)

## Inherited Members

[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

[Google.Cloud.Retail.V2](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Retail.V2/latest/Google.Cloud.Retail.V2.md.txt)

## Assembly

Google.Cloud.Retail.V2.dll

## Constructors

### PriceInfo()

    public PriceInfo()

### PriceInfo(PriceInfo)

    public PriceInfo(PriceInfo other)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `other` | `PriceInfo` |

## Properties

### Cost

    public float Cost { get; set; }

The costs associated with the sale of a particular product. Used for gross
profit reporting.

- Profit = \[price\]\[google.cloud.retail.v2.PriceInfo.price\] - \[cost\]\[google.cloud.retail.v2.PriceInfo.cost\]

Google Merchant Center property
[cost_of_goods_sold](https://support.google.com/merchants/answer/9017895).

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `float` |   |

### CurrencyCode

    public string CurrencyCode { get; set; }

The 3-letter currency code defined in [ISO
4217](https://www.iso.org/iso-4217-currency-codes.html).

If this field is an unrecognizable currency code, an INVALID_ARGUMENT
error is returned.

The \[Product.Type.VARIANT\]\[google.cloud.retail.v2.Product.Type.VARIANT\]
\[Product\]\[google.cloud.retail.v2.Product\]s with the same
\[Product.primary_product_id\]\[google.cloud.retail.v2.Product.primary_product_id\]
must share the same
\[currency_code\]\[google.cloud.retail.v2.PriceInfo.currency_code\]. Otherwise,
a FAILED_PRECONDITION error is returned.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### OriginalPrice

    public float OriginalPrice { get; set; }

Price of the product without any discount. If zero, by default set to be
the \[price\]\[google.cloud.retail.v2.PriceInfo.price\]. If set,
\[original_price\]\[google.cloud.retail.v2.PriceInfo.original_price\] should be
greater than or equal to \[price\]\[google.cloud.retail.v2.PriceInfo.price\],
otherwise an INVALID_ARGUMENT error is thrown.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `float` |   |

### Price

    public float Price { get; set; }

Price of the product.

Google Merchant Center property
[price](https://support.google.com/merchants/answer/6324371). Schema.org
property [Offer.price](https://schema.org/price).

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `float` |   |

### PriceEffectiveTime

    public Timestamp PriceEffectiveTime { get; set; }

The timestamp when the \[price\]\[google.cloud.retail.v2.PriceInfo.price\]
starts to be effective. This can be set as a future timestamp, and the
\[price\]\[google.cloud.retail.v2.PriceInfo.price\] is only used for search
after
\[price_effective_time\]\[google.cloud.retail.v2.PriceInfo.price_effective_time\].
If so, the
\[original_price\]\[google.cloud.retail.v2.PriceInfo.original_price\] must be
set and \[original_price\]\[google.cloud.retail.v2.PriceInfo.original_price\]
is used before
\[price_effective_time\]\[google.cloud.retail.v2.PriceInfo.price_effective_time\].

Do not set if \[price\]\[google.cloud.retail.v2.PriceInfo.price\] is always
effective because it will cause additional latency during search.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `Timestamp` |   |

### PriceExpireTime

    public Timestamp PriceExpireTime { get; set; }

The timestamp when the \[price\]\[google.cloud.retail.v2.PriceInfo.price\]
stops to be effective. The \[price\]\[google.cloud.retail.v2.PriceInfo.price\]
is used for search before
\[price_expire_time\]\[google.cloud.retail.v2.PriceInfo.price_expire_time\]. If
this field is set, the
\[original_price\]\[google.cloud.retail.v2.PriceInfo.original_price\] must be
set and \[original_price\]\[google.cloud.retail.v2.PriceInfo.original_price\]
is used after
\[price_expire_time\]\[google.cloud.retail.v2.PriceInfo.price_expire_time\].

Do not set if \[price\]\[google.cloud.retail.v2.PriceInfo.price\] is always
effective because it will cause additional latency during search.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `Timestamp` |   |

### PriceRange

    public PriceInfo.Types.PriceRange PriceRange { get; set; }

Output only. The price range of all the child
\[Product.Type.VARIANT\]\[google.cloud.retail.v2.Product.Type.VARIANT\]
\[Product\]\[google.cloud.retail.v2.Product\]s grouped together on the
\[Product.Type.PRIMARY\]\[google.cloud.retail.v2.Product.Type.PRIMARY\]
\[Product\]\[google.cloud.retail.v2.Product\]. Only populated for
\[Product.Type.PRIMARY\]\[google.cloud.retail.v2.Product.Type.PRIMARY\]
\[Product\]\[google.cloud.retail.v2.Product\]s.

Note: This field is OUTPUT_ONLY for
\[ProductService.GetProduct\]\[google.cloud.retail.v2.ProductService.GetProduct\].
Do not set this field in API requests.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `PriceInfoTypesPriceRange` |   |