BillingFlowParams.Builder  |  Android Developers (original) (raw)

public class BillingFlowParams.Builder


Helps to construct [BillingFlowParams](/reference/com/android/billingclient/api/BillingFlowParams) that are used to initiate a purchase flow.

Summary

Public methods

setObfuscatedAccountId

public BillingFlowParams.Builder setObfuscatedAccountId(String obfuscatedAccountid)

Specifies an optional obfuscated string that is uniquely associated with the purchaser's user account in your app.

Google Play can use this value to detect irregular activity, such as many devices making purchases on the same account within a brief timeframe. Additionally, you can use this field to accurately link the purchase to the in-game character, avatar, or the in-app profile that initiated the purchase.

Do not use this field to store any Personally Identifiable Information (PII) such as emails in cleartext. Storing PII in this field results in purchases being blocked. Google Play recommends that you use either encryption or a one-way hash to generate an obfuscated identifier to send to Google Play.

You can also retrieve this identifier via the [Purchase](/reference/com/android/billingclient/api/Purchase) object.

This identifier is limited to 64 characters.

Optional:

setObfuscatedProfileId

public BillingFlowParams.Builder setObfuscatedProfileId(String obfuscatedProfileId)

Specifies an optional obfuscated string that is uniquely associated with the purchaser's user profile in your app.

Some applications allow users to have multiple profiles within a single account. Use this method to send the user's profile identifier to Google. Setting this field requests the user's obfuscated account id to be pass via [setObfuscatedAccountId](/reference/com/android/billingclient/api/BillingFlowParams.Builder#setObfuscatedAccountId%28java.lang.String%29).

Google Play can use this value to detect irregular activity, such as many devices making purchases on the same account within a brief timeframe. Additionally, you can use this field to accurately link the purchase to the in-game character, avatar, or the in-app profile that initiated the purchase.

Do not use this field to store any Personally Identifiable Information (PII) such as emails in cleartext. Storing PII in this field results in purchases being blocked. Google Play recommends that you use either encryption or a one-way hash to generate an obfuscated identifier to send to Google Play.

You can also retrieve this identifier via the [Purchase](/reference/com/android/billingclient/api/Purchase) object.

This identifier is limited to 64 characters.

Optional:

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-23 UTC.