Use this page with AI

Copy this into your coding assistant and add your request.

Read https://openiap.dev/docs/apis/android/create-billing-program-reporting-details-android and https://openiap.dev/llms.txt. Follow the reading instructions, detailed reference, and linked guides relevant to my task before making changes.
Inspect my existing project and reuse its framework and conventions. Ask me for missing product decisions. Implement the requested behavior and run the applicable checks.
Show the working result, the commands and actual test results, and any remaining limitations. Keep your explanation brief.

My request: [describe what customers should be able to do]
See an example request →

Android createBillingProgramReportingDetailsAndroid

Creates the reporting details and external transaction token used by a Google Play Billing Program. The exact timing depends on the program. For External Offer, create fresh details immediately before every external-link launch; do not create them after payment or cache them for reuse.

Wraps BillingClient.createBillingProgramReportingDetailsAsync(...) — returns the external transaction token used to report a Developer-Provided Billing transaction. The Billing Programs surface starts in Play Billing 8.2.0, while External Offer integration requires Play Billing 8.2.1+. The optional developer billing type parameter is available in OpenIAP 2.1.0 and openiap-google 2.3.0 for Billing Choice, which requires Play Billing 9.1.0+. See the Google Play Billing reference.

Signature

kt
// Returns BillingProgramReportingDetailsAndroid with externalTransactionToken
// Token must be reported to Google Play backend within 24 hours
// Throws OpenIapError.NotPrepared if billing client not ready
suspend fun createBillingProgramReportingDetails(
    program: BillingProgramAndroid,
    developerBillingType: DeveloperBillingTypeAndroid? = null
): BillingProgramReportingDetailsAndroid

Parameters#

  • program (required, BillingProgramAndroid) — Billing program identifier.
  • developerBillingType (optional, DeveloperBillingTypeAndroid) — Billing Choice reporting destination. Use 'in-app' for native in-app developer billing, or 'external-link' when the developer billing option uses a link.

Returns#

Promise<BillingProgramReportingDetailsAndroid> — payload to report a Developer-Provided Billing transaction:

  • externalTransactionToken (string) — Token to send to Google's reporting API. Required for compliance.

Example

kt
// External Offer: create immediately before each launch; never cache.
val details = openIapStore.createBillingProgramReportingDetails(
    BillingProgramAndroid.ExternalOffer
)