REST Resource: externaltransactions

Resource: ExternalTransaction

The details of an external transaction.

JSON representation
{
  "packageName": string,
  "externalTransactionId": string,
  "originalPreTaxAmount": {
    object (Price)
  },
  "originalTaxAmount": {
    object (Price)
  },
  "currentPreTaxAmount": {
    object (Price)
  },
  "currentTaxAmount": {
    object (Price)
  },
  "testPurchase": {
    object (ExternalTransactionTestPurchase)
  },
  "transactionTime": string,
  "createTime": string,
  "transactionState": enum (TransactionState),
  "userTaxAddress": {
    object (ExternalTransactionAddress)
  },
  "transactionProgramCode": integer,
  "externalOfferInitialAcquisitionDetails": {
    object (ExternalOfferInitialAcquisitionDetails)
  },

  // Union field transaction_type can be only one of the following:
  "oneTimeTransaction": {
    object (OneTimeExternalTransaction)
  },
  "recurringTransaction": {
    object (RecurringExternalTransaction)
  }
  // End of list of possible types for union field transaction_type.
}
Fields
packageName

string

Output only. The resource name of the external transaction. The package name of the application the inapp products were sold (for example, 'com.some.app').

externalTransactionId

string

Output only. The id of this transaction. All transaction ids under the same package name must be unique. Set when creating the external transaction.

originalPreTaxAmount

object (Price)

Required. The original transaction amount before taxes. This represents the pre-tax amount originally notified to Google before any refunds were applied.

originalTaxAmount

object (Price)

Required. The original tax amount. This represents the tax amount originally notified to Google before any refunds were applied.

currentPreTaxAmount

object (Price)

Output only. The current transaction amount before tax. This represents the current pre-tax amount including any refunds that may have been applied to this transaction.

currentTaxAmount

object (Price)

Output only. The current tax amount. This represents the current tax amount including any refunds that may have been applied to this transaction.

testPurchase

object (ExternalTransactionTestPurchase)

Output only. If set, this transaction was a test purchase. Google will not charge for a test transaction.

transactionTime

string (Timestamp format)

Required. The time when the transaction was completed.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

createTime

string (Timestamp format)

Output only. The time when this transaction was created. This is the time when Google was notified of the transaction.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

transactionState

enum (TransactionState)

Output only. The current state of the transaction.

userTaxAddress

object (ExternalTransactionAddress)

Required. User address for tax computation.

transactionProgramCode

integer

Optional. The transaction program code, used to help determine service fee for eligible apps participating in partner programs. Developers participating in the Play Media Experience Program (https://play.google.com/console/about/programs/mediaprogram/) must provide the program code when reporting alternative billing transactions. If you are an eligible developer, please contact your BDM for more information on how to set this field. Note: this field can not be used for external offers transactions.

externalOfferInitialAcquisitionDetails

object (ExternalOfferInitialAcquisitionDetails)

Optional. Details about the first time a user/device completed a transaction using external offers. Not required for transactions made using user choice billing or alternative billing only.

Union field transaction_type. The type of transaction that was performed. transaction_type can be only one of the following:
oneTimeTransaction

object (OneTimeExternalTransaction)

This is a one-time transaction and not part of a subscription.

recurringTransaction

object (RecurringExternalTransaction)

This transaction is part of a recurring series of transactions.

ExternalTransactionTestPurchase

This type has no fields.

Represents a transaction performed using a test account. These transactions will not be charged by Google.

OneTimeExternalTransaction

Represents a one-time transaction.

JSON representation
{
  "externalTransactionToken": string
}
Fields
externalTransactionToken

string

Input only. Provided during the call to Create. Retrieved from the client when the alternative billing flow is launched.

RecurringExternalTransaction

Represents a transaction that is part of a recurring series of payments. This can be a subscription or a one-time product with multiple payments (such as preorder).

JSON representation
{

  // Union field source can be only one of the following:
  "initialExternalTransactionId": string,
  "externalTransactionToken": string,
  "migratedTransactionProgram": enum (ExternalTransactionProgram)
  // End of list of possible types for union field source.

  // Union field product_details can be only one of the following:
  "externalSubscription": {
    object (ExternalSubscription)
  },
  "otherRecurringProduct": {
    object (OtherRecurringProduct)
  }
  // End of list of possible types for union field product_details.
}
Fields

Union field source.

source can be only one of the following:

initialExternalTransactionId

string

The external transaction id of the first transaction of this recurring series of transactions. For example, for a subscription this would be the transaction id of the first payment. Required when creating recurring external transactions.

externalTransactionToken

string

Input only. Provided during the call to Create. Retrieved from the client when the alternative billing flow is launched. Required only for the initial purchase.

migratedTransactionProgram

enum (ExternalTransactionProgram)

Input only. Provided during the call to Create. Must only be used when migrating a subscription from manual monthly reporting to automated reporting.

Union field product_details. Required. Details of the product in the recurring external transaction. product_details can be only one of the following:
externalSubscription

object (ExternalSubscription)

Details of an external subscription.

otherRecurringProduct

object (OtherRecurringProduct)

Details of a recurring external transaction product which doesn't belong to any other specific category.

ExternalTransactionProgram

Represents the external transaction program experienced by the user to complete the transaction.

Enums
EXTERNAL_TRANSACTION_PROGRAM_UNSPECIFIED Unspecified transaction program. Not used.
USER_CHOICE_BILLING User choice billing, where a user may choose between Google Play Billing developer-managed billing.
ALTERNATIVE_BILLING_ONLY Alternative billing only, where users may only use developer-manager billing.

ExternalSubscription

Details of an external subscription.

JSON representation
{
  "subscriptionType": enum (SubscriptionType)
}
Fields
subscriptionType

enum (SubscriptionType)

Required. The type of the external subscription.

SubscriptionType

The types of an external subscription.

Enums
SUBSCRIPTION_TYPE_UNSPECIFIED Unspecified, do not use.
RECURRING This is a recurring subscription where the user is charged every billing cycle.
PREPAID This is a prepaid subscription where the user pays up front.

OtherRecurringProduct

This type has no fields.

Details of a recurring external transaction product which doesn't belong to any other more specific category.

TransactionState

The state of a transaction being made.

Enums
TRANSACTION_STATE_UNSPECIFIED Unspecified transaction state. Not used.
TRANSACTION_REPORTED The transaction has been successfully reported to Google.
TRANSACTION_CANCELED The transaction has been fully refunded.

ExternalTransactionAddress

User's address for the external transaction.

JSON representation
{
  "regionCode": string,
  "administrativeArea": string
}
Fields
regionCode

string

Required. Two letter region code based on ISO-3166-1 Alpha-2 (UN region codes).

administrativeArea

string

Optional. Top-level administrative subdivision of the country/region. Only required for transactions in India. Valid values are "ANDAMAN AND NICOBAR ISLANDS", "ANDHRA PRADESH", "ARUNACHAL PRADESH", "ASSAM", "BIHAR", "CHANDIGARH", "CHHATTISGARH", "DADRA AND NAGAR HAVELI", "DADRA AND NAGAR HAVELI AND DAMAN AND DIU", "DAMAN AND DIU", "DELHI", "GOA", "GUJARAT", "HARYANA", "HIMACHAL PRADESH", "JAMMU AND KASHMIR", "JHARKHAND", "KARNATAKA", "KERALA", "LADAKH", "LAKSHADWEEP", "MADHYA PRADESH", "MAHARASHTRA", "MANIPUR", "MEGHALAYA", "MIZORAM", "NAGALAND", "ODISHA", "PUDUCHERRY", "PUNJAB", "RAJASTHAN", "SIKKIM", "TAMIL NADU", "TELANGANA", "TRIPURA", "UTTAR PRADESH", "UTTARAKHAND", and "WEST BENGAL".

ExternalOfferInitialAcquisitionDetails

Details about the first time a user/device completed a transaction using external offers.

JSON representation
{
  "externalTransactionId": string
}
Fields
externalTransactionId

string

Required. The external transaction id of the first completed purchase made by the user.

Methods

createexternaltransaction

Creates a new external transaction.

getexternaltransaction

Gets an existing external transaction.

refundexternaltransaction

Refunds or partially refunds an existing external transaction.