BillingClient.BillingResponseCode

public static abstract @interface BillingClient.BillingResponseCode
implements Annotation

com.android.billingclient.api.BillingClient.BillingResponseCode


Possible response codes.

Summary

Constants

int BILLING_UNAVAILABLE

A user billing error occurred during processing.

int DEVELOPER_ERROR

Error resulting from incorrect usage of the API.

int ERROR

Fatal error during the API action.

int FEATURE_NOT_SUPPORTED

The requested feature is not supported by the Play Store on the current device.

int ITEM_ALREADY_OWNED

The purchase failed because the item is already owned.

int ITEM_NOT_OWNED

Requested action on the item failed since it is not owned by the user.

int ITEM_UNAVAILABLE

The requested product is not available for purchase.

int NETWORK_ERROR

A network error occurred during the operation.

int OK

Success.

int SERVICE_DISCONNECTED

The app is not connected to the Play Store service via the Google Play Billing Library.

int SERVICE_TIMEOUT

This constant is deprecated. See SERVICE_UNAVAILABLE which will be used instead of this code.

int SERVICE_UNAVAILABLE

The service is currently unavailable.

int USER_CANCELED

Transaction was canceled by the user.

Inherited methods

Constants

BILLING_UNAVAILABLE

public static final int BILLING_UNAVAILABLE

A user billing error occurred during processing.

Examples where this error may occur:

  • The Play Store app on the user's device is out of date.
  • The user is in an unsupported country.
  • The user is an enterprise user and their enterprise admin has disabled users from making purchases.
  • Google Play is unable to charge the user’s payment method.

Letting the user retry may succeed if the condition causing the error has changed (e.g. An enterprise user's admin has allowed purchases for the organization).

Constant Value: 3 (0x00000003)

DEVELOPER_ERROR

public static final int DEVELOPER_ERROR

Error resulting from incorrect usage of the API.

Examples where this error may occur:

  • Invalid arguments such as providing an empty product list where required.
  • Misconfiguration of the app such as not signing the app or not having the necessary permissions in the manifest.

Constant Value: 5 (0x00000005)

ERROR

public static final int ERROR

Fatal error during the API action.

This is an internal Google Play error that may be transient or due to an unexpected condition during processing. You can automatically retry (e.g. with exponential back off) for this case and contact Google Play if issues persist. Be mindful of how long you retry if the retry is happening during a user interaction.

Constant Value: 6 (0x00000006)

FEATURE_NOT_SUPPORTED

public static final int FEATURE_NOT_SUPPORTED

The requested feature is not supported by the Play Store on the current device.

If your app would like to check if a feature is supported before trying to use the feature your app can call BillingClient.isFeatureSupported(String) to check if a feature is supported. For a list of feature types that can be supported, see BillingClient.FeatureType.

For example: Before calling BillingClient.showInAppMessages(Activity, InAppMessageParams, InAppMessageResponseListener) API, you can call BillingClient.isFeatureSupported(String) with the BillingClient.FeatureType.IN_APP_MESSAGING featureType to check if it is supported.

Constant Value: -2 (0xfffffffe)

ITEM_ALREADY_OWNED

public static final int ITEM_ALREADY_OWNED

The purchase failed because the item is already owned.

Make sure your app is up-to-date with recent purchases using guidance in the Fetching purchases section in the integration guide. If this error occurs despite making the check for recent purchases, then it may be due to stale purchase information that was cached on the device by Play. When you receive this error, the cache should get updated. After this, your purchases should be reconciled, and you can process them as outlined in the processing purchases section in the integration guide.

Constant Value: 7 (0x00000007)

ITEM_NOT_OWNED

public static final int ITEM_NOT_OWNED

Requested action on the item failed since it is not owned by the user.

Make sure your app is up-to-date with recent purchases using guidance in the Fetching purchases section in the integration guide. If this error occurs despite making the check for recent purchases, then it may be due to stale purchase information cached on the device by Play. When you receive this error, the cache should get updated. After this, your purchases should be reconciled, and you can process the purchases accordingly. For example, if you are trying to consume an item and if the updated purchase information says it is already consumed, you can ignore the error now.

Constant Value: 8 (0x00000008)

ITEM_UNAVAILABLE

public static final int ITEM_UNAVAILABLE

The requested product is not available for purchase.

Please ensure the product is available in the user’s country. If you recently changed the country availability and are still receiving this error then it may be because of a propagation delay.

Constant Value: 4 (0x00000004)

NETWORK_ERROR

public static final int NETWORK_ERROR

A network error occurred during the operation.

This error indicates that there was a problem with the network connection between the device and Play systems. This could potentially also be due to the user not having an active network connection.

Constant Value: 12 (0x0000000c)

OK

public static final int OK

Success.

Constant Value: 0 (0x00000000)

SERVICE_DISCONNECTED

public static final int SERVICE_DISCONNECTED

The app is not connected to the Play Store service via the Google Play Billing Library.

Examples where this error may occur:

Since this state is transient, your app should automatically retry (e.g. with exponential back off) to recover from this error. Be mindful of how long you retry if the retry is happening during a user interaction. The retry should lead to a call to BillingClient.startConnection(BillingClientStateListener) right after or in some time after you received this code.

Constant Value: -1 (0xffffffff)

SERVICE_TIMEOUT

public static final int SERVICE_TIMEOUT

This constant is deprecated.
See SERVICE_UNAVAILABLE which will be used instead of this code.

The request has reached the maximum timeout before Google Play responds.

Since this state is transient, your app should automatically retry (e.g. with exponential back off) to recover from this error. Be mindful of how long you retry if the retry is happening during a user interaction.

Constant Value: -3 (0xfffffffd)

SERVICE_UNAVAILABLE

public static final int SERVICE_UNAVAILABLE

The service is currently unavailable.

Since this state is transient, your app should automatically retry (e.g. with exponential back off) to recover from this error. Be mindful of how long you retry if the retry is happening during a user interaction.

Constant Value: 2 (0x00000002)

USER_CANCELED

public static final int USER_CANCELED

Transaction was canceled by the user.

Constant Value: 1 (0x00000001)