Revenue class

com.yandex.metrica

public class Revenue

The class contains information about the revenue from in-app purchases.

The Revenue instance should be sent to the AppMetrica server using the YandexMetrica.reportRevenue(Revenue revenue) method.

Nested classes

Methods

Revenue.BuildernewBuilder (double price, @NonNull Currency currency)

Creates the new instance of Revenue.Builder class to pass the data about revenue.

Fields

Currencycurrency

Currency of the purchase.

stringpayload

Additional information to be passed about the purchase. For instance, it can be used for categorizing your products.

doubleprice

Price. It can be negative, e.g. for refunds.

stringproductID

ID of the product purchased. The value can contain up to 200 characters.

Integerquantity

Quantity of products purchased.

Revenue.Receiptreceipt

Information about the in-app purchase order from Google Play.

Method descriptions

newBuilder

public static Revenue.Builder newBuilder(double price, @NonNull Currency currency)

Creates the new instance of Revenue.Builder class to pass the data about revenue.

Parameters:
price

Price. It can be negative, e.g. for refunds.

currency

Currency of the purchase.

Returns:

The instance of the Revenue.Builder class.

Field descriptions

currency

public final Currency currency

Currency of the purchase.

payload

public final String payload

Additional information to be passed about the purchase. For instance, it can be used for categorizing your products.

It should contain the valid JSON string. The maximum size of the value is 30 KB.

price

public final double price

Price. It can be negative, e.g. for refunds.

Example: 0.99

productID

public final String productID

ID of the product purchased. The value can contain up to 200 characters.

quantity

public final Integer quantity

Quantity of products purchased.

It is used in the following formula:
Revenue = quantity * price.
Note. The value cannot be negative. If the value is equal to 0, the purchase is ignored.

receipt

public final Revenue.Receipt receipt

Information about the in-app purchase order from Google Play.