Google Play Android Developer API . monetization . onetimeproducts . purchaseOptions

Instance Methods

offers()

Returns the offers Resource.

batchDelete(packageName, productId, body=None, x__xgafv=None)

Deletes purchase options across one or multiple one-time products. By default this operation will fail if there are any existing offers under the deleted purchase options. Use the force parameter to override the default behavior.

batchUpdateStates(packageName, productId, body=None, x__xgafv=None)

Activates or deactivates purchase options across one or multiple one-time products.

close()

Close httplib2 connections.

Method Details

batchDelete(packageName, productId, body=None, x__xgafv=None)
Deletes purchase options across one or multiple one-time products. By default this operation will fail if there are any existing offers under the deleted purchase options. Use the force parameter to override the default behavior.

Args:
  packageName: string, Required. The parent app (package name) of the purchase options to delete. (required)
  productId: string, Required. The product ID of the parent one-time product, if all purchase options to delete belong to the same one-time product. If this batch delete spans multiple one-time products, set this field to "-". (required)
  body: object, The request body.
    The object takes the form of:

{ # Request message for BatchDeletePurchaseOption.
  "requests": [ # Required. A list of delete requests of up to 100 elements. All requests must delete purchase options from different one-time products.
    { # Request message for deleting a purchase option.
      "force": True or False, # Optional. This field has no effect for purchase options with no offers under them. For purchase options with associated offers: * If `force` is set to false (default), an error will be returned. * If `force` is set to true, any associated offers under the purchase option will be deleted.
      "latencyTolerance": "A String", # Optional. The latency tolerance for the propagation of this product update. Defaults to latency-sensitive.
      "packageName": "A String", # Required. The parent app (package name) of the purchase option to delete.
      "productId": "A String", # Required. The parent one-time product (ID) of the purchase option to delete.
      "purchaseOptionId": "A String", # Required. The purchase option ID of the purchase option to delete.
    },
  ],
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format
batchUpdateStates(packageName, productId, body=None, x__xgafv=None)
Activates or deactivates purchase options across one or multiple one-time products.

Args:
  packageName: string, Required. The parent app (package name) of the updated purchase options. (required)
  productId: string, Required. The product ID of the parent one-time product, if all updated purchase options belong to the same one-time product. If this batch update spans multiple one-time products, set this field to "-". (required)
  body: object, The request body.
    The object takes the form of:

{ # Request message for BatchUpdatePurchaseOptionStates.
  "requests": [ # Required. The update request list of up to 100 elements. All requests must update different purchase options.
    { # Request message to update the state of a one-time product purchase option.
      "activatePurchaseOptionRequest": { # Request message for UpdatePurchaseOptionState. # Activates a purchase option. Once activated, the purchase option will be available.
        "latencyTolerance": "A String", # Optional. The latency tolerance for the propagation of this product update. Defaults to latency-sensitive.
        "packageName": "A String", # Required. The parent app (package name) of the purchase option to activate.
        "productId": "A String", # Required. The parent one-time product (ID) of the purchase option to activate.
        "purchaseOptionId": "A String", # Required. The purchase option ID of the purchase option to activate.
      },
      "deactivatePurchaseOptionRequest": { # Request message for UpdatePurchaseOptionState. # Deactivates a purchase option. Once deactivated, the purchase option will become unavailable.
        "latencyTolerance": "A String", # Optional. The latency tolerance for the propagation of this product update. Defaults to latency-sensitive.
        "packageName": "A String", # Required. The parent app (package name) of the purchase option to deactivate.
        "productId": "A String", # Required. The parent one-time product (ID) of the purchase option to deactivate.
        "purchaseOptionId": "A String", # Required. The purchase option ID of the purchase option to deactivate.
      },
    },
  ],
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Response message for BatchUpdatePurchaseOptionStates.
  "oneTimeProducts": [ # The list of updated one-time products. This list will match the requests one to one, in the same order.
    { # A single one-time product for an app.
      "listings": [ # Required. Set of localized title and description data. Must not have duplicate entries with the same language_code.
        { # Regional store listing for a one-time product.
          "description": "A String", # Required. The description of this product in the language of this listing. The maximum length is 200 characters.
          "languageCode": "A String", # Required. The language of this listing, as defined by BCP-47, e.g., "en-US".
          "title": "A String", # Required. The title of this product in the language of this listing. The maximum length is 55 characters.
        },
      ],
      "offerTags": [ # Optional. List of up to 20 custom tags specified for this one-time product, and returned to the app through the billing library. Purchase options and offers for this product will also receive these tags in the billing library.
        { # Represents a custom tag specified for a product offer.
          "tag": "A String", # Must conform with RFC-1034. That is, this string can only contain lower-case letters (a-z), numbers (0-9), and hyphens (-), and be at most 20 characters.
        },
      ],
      "packageName": "A String", # Required. Immutable. Package name of the parent app.
      "productId": "A String", # Required. Immutable. Unique product ID of the product. Unique within the parent app. Product IDs must start with a number or lowercase letter, and can contain numbers (0-9), lowercase letters (a-z), underscores (_), and periods (.).
      "purchaseOptions": [ # Required. The set of purchase options for this one-time product.
        { # A single purchase option for a one-time product.
          "buyOption": { # A purchase option that can be bought. # A purchase option that can be bought.
            "legacyCompatible": True or False, # Optional. Whether this purchase option will be available in legacy PBL flows that do not support one-time products model. Up to one "buy" purchase option can be marked as backwards compatible.
            "multiQuantityEnabled": True or False, # Optional. Whether this purchase option allows multi-quantity. Multi-quantity allows buyer to purchase more than one item in a single checkout.
          },
          "newRegionsConfig": { # Pricing information for any new regions Play may launch in the future. # Pricing information for any new locations Play may launch in the future. If omitted, the purchase option will not be automatically available in any new locations Play may launch in the future.
            "availability": "A String", # Required. The regional availability for the new regions config. When set to AVAILABLE, the pricing information will be used for any new regions Play may launch in the future.
            "eurPrice": { # Represents an amount of money with its currency type. # Required. Price in EUR to use for any new regions Play may launch in.
              "currencyCode": "A String", # The three-letter currency code defined in ISO 4217.
              "nanos": 42, # Number of nano (10^-9) units of the amount. The value must be between -999,999,999 and +999,999,999 inclusive. If `units` is positive, `nanos` must be positive or zero. If `units` is zero, `nanos` can be positive, zero, or negative. If `units` is negative, `nanos` must be negative or zero. For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000.
              "units": "A String", # The whole units of the amount. For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar.
            },
            "usdPrice": { # Represents an amount of money with its currency type. # Required. Price in USD to use for any new regions Play may launch in.
              "currencyCode": "A String", # The three-letter currency code defined in ISO 4217.
              "nanos": 42, # Number of nano (10^-9) units of the amount. The value must be between -999,999,999 and +999,999,999 inclusive. If `units` is positive, `nanos` must be positive or zero. If `units` is zero, `nanos` can be positive, zero, or negative. If `units` is negative, `nanos` must be negative or zero. For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000.
              "units": "A String", # The whole units of the amount. For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar.
            },
          },
          "offerTags": [ # Optional. List of up to 20 custom tags specified for this purchase option, and returned to the app through the billing library. Offers for this purchase option will also receive these tags in the billing library.
            { # Represents a custom tag specified for a product offer.
              "tag": "A String", # Must conform with RFC-1034. That is, this string can only contain lower-case letters (a-z), numbers (0-9), and hyphens (-), and be at most 20 characters.
            },
          ],
          "purchaseOptionId": "A String", # Required. Immutable. The unique identifier of this purchase option. Must be unique within the one-time product. It must start with a number or lower-case letter, and can only contain lower-case letters (a-z), numbers (0-9), and hyphens (-). The maximum length is 63 characters.
          "regionalPricingAndAvailabilityConfigs": [ # Regional pricing and availability information for this purchase option.
            { # Regional pricing and availability configuration for a purchase option.
              "availability": "A String", # The availability of the purchase option.
              "price": { # Represents an amount of money with its currency type. # The price of the purchase option in the specified region. Must be set in the currency that is linked to the specified region.
                "currencyCode": "A String", # The three-letter currency code defined in ISO 4217.
                "nanos": 42, # Number of nano (10^-9) units of the amount. The value must be between -999,999,999 and +999,999,999 inclusive. If `units` is positive, `nanos` must be positive or zero. If `units` is zero, `nanos` can be positive, zero, or negative. If `units` is negative, `nanos` must be negative or zero. For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000.
                "units": "A String", # The whole units of the amount. For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar.
              },
              "regionCode": "A String", # Required. Region code this configuration applies to, as defined by ISO 3166-2, e.g., "US".
            },
          ],
          "rentOption": { # A purchase option that can be rented. # A purchase option that can be rented.
            "expirationPeriod": "A String", # Optional. The amount of time the user has after starting consuming the entitlement before it is revoked. Specified in ISO 8601 format.
            "rentalPeriod": "A String", # Required. The amount of time a user has the entitlement for. Starts at purchase flow completion. Specified in ISO 8601 format.
          },
          "state": "A String", # Output only. The state of the purchase option, i.e., whether it's active. This field cannot be changed by updating the resource. Use the dedicated endpoints instead.
          "taxAndComplianceSettings": { # Details about taxation, Google Play policy and legal compliance for one-time product purchase options. # Optional. Details about taxes and legal compliance.
            "withdrawalRightType": "A String", # Optional. Digital content or service classification for products distributed to users in eligible regions. If unset, it defaults to `WITHDRAWAL_RIGHT_DIGITAL_CONTENT`. Refer to the [Help Center article](https://support.google.com/googleplay/android-developer/answer/10463498) for more information.
          },
        },
      ],
      "regionsVersion": { # The version of the available regions being used for the specified resource. # Output only. The version of the regions configuration that was used to generate the one-time product.
        "version": "A String", # Required. A string representing the version of available regions being used for the specified resource. Regional prices and latest supported version for the resource have to be specified according to the information published in [this article](https://support.google.com/googleplay/android-developer/answer/10532353). Each time the supported locations substantially change, the version will be incremented. Using this field will ensure that creating and updating the resource with an older region's version and set of regional prices and currencies will succeed even though a new version is available.
      },
      "restrictedPaymentCountries": { # Countries where the purchase of this product is restricted to payment methods registered in the same country. If empty, no payment location restrictions are imposed. # Optional. Countries where the purchase of this one-time product is restricted to payment methods registered in the same country. If empty, no payment location restrictions are imposed.
        "regionCodes": [ # Required. Region codes to impose payment restrictions on, as defined by ISO 3166-2, e.g. "US".
          "A String",
        ],
      },
      "taxAndComplianceSettings": { # Details about taxation, Google Play policy and legal compliance for one-time products. # Details about taxes and legal compliance.
        "isTokenizedDigitalAsset": True or False, # Whether this one-time product is declared as a product representing a tokenized digital asset.
        "regionalTaxConfigs": [ # Regional tax configuration.
          { # Details about taxation in a given geographical region.
            "eligibleForStreamingServiceTaxRate": True or False, # You must tell us if your app contains streaming products to correctly charge US state and local sales tax. Field only supported in the United States.
            "regionCode": "A String", # Required. Region code this configuration applies to, as defined by ISO 3166-2, e.g. "US".
            "streamingTaxType": "A String", # To collect communications or amusement taxes in the United States, choose the appropriate tax category. [Learn more](https://support.google.com/googleplay/android-developer/answer/10463498#streaming_tax).
            "taxTier": "A String", # Tax tier to specify reduced tax rate. Developers who sell digital news, magazines, newspapers, books, or audiobooks in various regions may be eligible for reduced tax rates. [Learn more](https://support.google.com/googleplay/android-developer/answer/10463498).
          },
        ],
      },
    },
  ],
}
close()
Close httplib2 connections.