Skip to content

gplay purchases

Verify and manage purchases.

gplay purchases <subcommand> [flags]

Verify and manage in-app purchases and subscriptions.

Use these commands for server-side purchase validation and subscription management.

Verify and manage in-app product purchases.

gplay purchases products <subcommand> [flags]

Get purchase details for verification.

gplay purchases products get --package <name> --product-id <id> --token <token>

Get purchase details for server-side verification.

The response includes:

  • purchaseState: 0=Purchased, 1=Canceled, 2=Pending
  • consumptionState: 0=Not consumed, 1=Consumed
  • acknowledgementState: 0=Not acknowledged, 1=Acknowledged
Flag Description Default
--output Output format: json (default), table, markdown json
--package Package name (applicationId) ``
--pretty Pretty-print JSON output false
--product-id Product ID (SKU) ``
--token Purchase token ``

Acknowledge a purchase.

gplay purchases products acknowledge --package <name> --product-id <id> --token <token>

Acknowledge a purchase.

Purchases must be acknowledged within 3 days or they are automatically refunded. Use this for server-side acknowledgement.

Flag Description Default
--developer-payload Optional developer payload ``
--output Output format: json (default), table, markdown json
--package Package name (applicationId) ``
--pretty Pretty-print JSON output false
--product-id Product ID (SKU) ``
--token Purchase token ``

Consume a purchase (for consumable products).

gplay purchases products consume --package <name> --product-id <id> --token <token>

Consume a purchase.

Use this for consumable products that can be purchased multiple times. After consumption, the product can be purchased again.

Flag Description Default
--output Output format: json (default), table, markdown json
--package Package name (applicationId) ``
--pretty Pretty-print JSON output false
--product-id Product ID (SKU) ``
--token Purchase token ``

Verify in-app product purchases (v2 API).

gplay purchases productsv2 <subcommand> [flags]

Verify in-app product purchases using the newer v2 API.

The v2 API provides enhanced purchase information including multi-quantity purchases and improved status fields.

Get purchase details using v2 API.

gplay purchases productsv2 get --package <name> --token <token>

Get purchase details using the v2 API.

The v2 API returns enhanced purchase information including:

  • productId: The purchased product ID
  • purchaseState: Current state of the purchase
  • consumptionState: Whether the product has been consumed
  • acknowledgementState: Whether acknowledged
  • quantity: Number of items purchased (for multi-quantity)
Flag Description Default
--output Output format: json (default), table, markdown json
--package Package name (applicationId) ``
--pretty Pretty-print JSON output false
--token Purchase token ``

Verify and manage subscription purchases.

gplay purchases subscriptions <subcommand> [flags]

Get subscription purchase details (v2 API).

gplay purchases subscriptions get --package <name> --token <token>

Get subscription purchase details using the v2 API.

The response includes:

  • subscriptionState: Current state of the subscription
  • lineItems: Details of each subscription item
  • acknowledgementState: Whether the subscription is acknowledged
Flag Description Default
--output Output format: json (default), table, markdown json
--package Package name (applicationId) ``
--pretty Pretty-print JSON output false
--token Purchase token ``

Acknowledge a subscription purchase.

gplay purchases subscriptions acknowledge --package <name> --subscription-id <id> --token <token>

Acknowledge a subscription purchase using the legacy purchases.subscriptions.acknowledge API.

Subscriptions must be acknowledged within 3 days or they are automatically refunded. Use this when server-side acknowledgement is required.

Flag Description Default
--developer-payload Optional developer payload ``
--output Output format: json (default), table, markdown json
--package Package name (applicationId) ``
--pretty Pretty-print JSON output false
--subscription-id Subscription ID ``
--token Purchase token ``

Cancel a subscription.

gplay purchases subscriptions cancel --package <name> --subscription-id <id> --token <token> --confirm

Cancel a subscription.

The subscription remains active until the end of the current billing period, then will not renew.

Flag Description Default
--confirm Confirm cancellation false
--output Output format: json (default), table, markdown json
--package Package name (applicationId) ``
--pretty Pretty-print JSON output false
--subscription-id Subscription ID ``
--token Purchase token ``

Defer billing for a subscription.

gplay purchases subscriptions defer --package <name> --subscription-id <id> --token <token> --json <json>

Defer billing for a subscription.

JSON format: { “deferralInfo”: { “expectedExpiryTimeMillis”: 1735689600000, “desiredExpiryTimeMillis”: 1738368000000 } }

The new expiry time must be:

  • In the future
  • Before the current billing period ends
  • No more than one year ahead
Flag Description Default
--json DeferralInfo JSON (or @file) ``
--output Output format: json (default), table, markdown json
--package Package name (applicationId) ``
--pretty Pretty-print JSON output false
--subscription-id Subscription ID ``
--token Purchase token ``

Revoke a subscription immediately.

gplay purchases subscriptions revoke --package <name> --subscription-id <id> --token <token> --confirm

Revoke a subscription immediately.

Unlike cancel, this immediately ends the subscription and the user loses access right away.

Flag Description Default
--confirm Confirm revocation false
--output Output format: json (default), table, markdown json
--package Package name (applicationId) ``
--pretty Pretty-print JSON output false
--subscription-id Subscription ID ``
--token Purchase token ``

Verify and mutate subscription purchases (v2 API).

gplay purchases subscriptionsv2 <subcommand> [flags]

Verify and mutate subscription purchases using the v2 API.

The mutation commands accept Google API request JSON with –json so new request fields can be used without waiting for CLI-specific flags.

Get subscription purchase details (v2 API).

gplay purchases subscriptionsv2 get --package <name> --token <token>
Flag Description Default
--output Output format: json (default), table, markdown json
--package Package name (applicationId) ``
--pretty Pretty-print JSON output false
--token Purchase token ``

Cancel a subscription purchase (v2 API).

gplay purchases subscriptionsv2 cancel --package <name> --token <token> --json <json> --confirm

Cancel a subscription purchase using the v2 API.

JSON format: { “cancellationContext”: { “cancellationType”: “USER_REQUESTED_STOP_RENEWALS” } }

Flag Description Default
--confirm Confirm cancellation false
--json CancelSubscriptionPurchaseRequest JSON (or @file) ``
--output Output format: json (default), table, markdown json
--package Package name (applicationId) ``
--pretty Pretty-print JSON output false
--token Purchase token ``

Defer subscription renewal (v2 API).

gplay purchases subscriptionsv2 defer --package <name> --token <token> --json <json>

Defer subscription renewal using the v2 API.

JSON format: { “deferralContext”: { “deferDuration”: “P7D”, “etag”: “<etag from purchases subscriptionsv2 get>” } }

Flag Description Default
--json DeferSubscriptionPurchaseRequest JSON (or @file) ``
--output Output format: json (default), table, markdown json
--package Package name (applicationId) ``
--pretty Pretty-print JSON output false
--token Purchase token ``

Revoke a subscription purchase (v2 API).

gplay purchases subscriptionsv2 revoke --package <name> --token <token> --json <json> --confirm

Revoke a subscription purchase using the v2 API.

JSON format: { “revocationContext”: { “fullRefund”: {} } }

Flag Description Default
--confirm Confirm revocation false
--json RevokeSubscriptionPurchaseRequest JSON (or @file) ``
--output Output format: json (default), table, markdown json
--package Package name (applicationId) ``
--pretty Pretty-print JSON output false
--token Purchase token ``

Track voided purchases (refunds, chargebacks).

gplay purchases voided <subcommand> [flags]

List voided purchases.

gplay purchases voided list --package <name> [--start-time <ms>] [--end-time <ms>]

List voided purchases (refunds and chargebacks).

Use this to track:

  • Refunds issued by you or Google
  • Chargebacks from payment processors

The –type flag filters by voided source: 0 = All voided purchases 1 = Refunds only 2 = Chargebacks only

Flag Description Default
--end-time End time in milliseconds since epoch 0
--include-quantity Include quantity information false
--max-results Maximum results per page 100
--output Output format: json (default), table, markdown json
--package Package name (applicationId) ``
--paginate Fetch all pages false
--pretty Pretty-print JSON output false
--start-time Start time in milliseconds since epoch 0
--type Voided source type: 0=All, 1=Refund, 2=Chargeback 0