gplay purchases
gplay purchases
Section titled “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.
gplay purchases products
Section titled “gplay purchases products”Verify and manage in-app product purchases.
gplay purchases products <subcommand> [flags]gplay purchases products get
Section titled “gplay purchases products get”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 | `` |
gplay purchases products acknowledge
Section titled “gplay purchases products acknowledge”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 | `` |
gplay purchases products consume
Section titled “gplay purchases products consume”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 | `` |
gplay purchases productsv2
Section titled “gplay purchases productsv2”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.
gplay purchases productsv2 get
Section titled “gplay purchases productsv2 get”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 | `` |
gplay purchases subscriptions
Section titled “gplay purchases subscriptions”Verify and manage subscription purchases.
gplay purchases subscriptions <subcommand> [flags]gplay purchases subscriptions get
Section titled “gplay purchases subscriptions get”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 | `` |
gplay purchases subscriptions acknowledge
Section titled “gplay purchases subscriptions acknowledge”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 | `` |
gplay purchases subscriptions cancel
Section titled “gplay purchases subscriptions cancel”Cancel a subscription.
gplay purchases subscriptions cancel --package <name> --subscription-id <id> --token <token> --confirmCancel 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 | `` |
gplay purchases subscriptions defer
Section titled “gplay purchases subscriptions defer”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 | `` |
gplay purchases subscriptions revoke
Section titled “gplay purchases subscriptions revoke”Revoke a subscription immediately.
gplay purchases subscriptions revoke --package <name> --subscription-id <id> --token <token> --confirmRevoke 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 | `` |
gplay purchases subscriptionsv2
Section titled “gplay purchases subscriptionsv2”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.
gplay purchases subscriptionsv2 get
Section titled “gplay purchases subscriptionsv2 get”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 | `` |
gplay purchases subscriptionsv2 cancel
Section titled “gplay purchases subscriptionsv2 cancel”Cancel a subscription purchase (v2 API).
gplay purchases subscriptionsv2 cancel --package <name> --token <token> --json <json> --confirmCancel 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 | `` |
gplay purchases subscriptionsv2 defer
Section titled “gplay purchases subscriptionsv2 defer”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 | `` |
gplay purchases subscriptionsv2 revoke
Section titled “gplay purchases subscriptionsv2 revoke”Revoke a subscription purchase (v2 API).
gplay purchases subscriptionsv2 revoke --package <name> --token <token> --json <json> --confirmRevoke 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 | `` |
gplay purchases voided
Section titled “gplay purchases voided”Track voided purchases (refunds, chargebacks).
gplay purchases voided <subcommand> [flags]gplay purchases voided list
Section titled “gplay purchases voided list”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 |