All articles
Playbook8 min read

Google Play service account permissions decide who can refund your orders, so grant the narrowest set that works

One Play Console permission lets a service account refund any order and cancel any subscription. Here's which Google Play service account permissions refund tooling really needs, what a leaked key can do on each store, and how to scope, rotate and revoke the keys.

A brass key on a dark desk beside a laptop and a phone, standing in for the Google Play service account permissions that control refunds

Key takeaways

  • Google Play's Manage orders and subscriptions permission lets the holder view orders, refund orders and cancel subscriptions, so any service account that holds it can move money back to your buyers.
  • Google's Play Developer API guide says the Google Play Billing APIs need two Play Console permissions: View financial data, orders, and cancellation survey responses, and Manage orders and subscriptions.
  • The Google Play Developer API's orders.refund method can refund any one-time purchase or subscription order up to 3 years old, and with revoke set to true it ends the buyer's access immediately.
  • Google Cloud service account keys don't expire by default, and Google says a key committed to a code repository must be deleted in IAM, because removing it from the repository isn't enough.
  • Apple's In-App Purchase key can't issue refunds, but it can call the App Store Server API, including the endpoints that extend subscription renewal dates by up to 90 days, an extension Apple says can't be reversed.
  • Only an Account Holder or Admin can generate an In-App Purchase key in App Store Connect, the private key downloads only once, and a revoked key can't be reinstated.

Give one service account two Play Console permissions and it can refund any order in your app. That's not a misconfiguration. It's exactly how Google built the Google Play Developer API, and it's why the JSON key behind your refund tooling deserves the same care as the login to your bank.

Most teams set this up once, under deadline, by ticking whatever made the first API call succeed. This guide goes the other way. It lists which Google Play service account permissions refund and chargeback work actually needs, what each store lets a stolen key do, and how to keep the blast radius small.

What the Google Play service account permissions actually allow

A service account is a robot user. You create it in Google Cloud, then invite its email address in Play Console under Users and permissions, the same way you'd invite a colleague. From then on it can do whatever those permissions allow, through the API, at any hour, with no second factor.

The two permissions the billing APIs require

Google's Play Developer API guide is specific. To use the Google Play Billing APIs, you grant two permissions: View financial data, orders, and cancellation survey responses, and Manage orders and subscriptions. The first lets the account read orders and use the Purchases API. The second is the one that touches money.

Play Console permissionWhat Google says it allowsCan it send money back to buyers
View financial data, orders, and cancellation survey responsesView financial reports, sales reports and orders, access the Purchases API, download cancellation survey responsesNo
Manage orders and subscriptionsView orders, refund orders, cancel subscriptionsYes
Admin (all permissions)Every other permission, plus inviting users and changing their permissionsYes, and it can grant itself more

What a key with refund rights can do

The Google Play Developer API's orders.refund method refunds a user's subscription or in-app purchase order. Google says orders older than 3 years can't be refunded, which means everything newer can. Set revoke to true and the buyer's access ends immediately. For subscriptions, purchases.subscriptionsv2.revoke with a full refund does the same job.

Those are the right tools when you mean to use them. Google's own fraud guidance tells you to refund and revoke a purchase that fails your checks rather than let it time out. The problem is a key that can do this for every app in your account when it only needed one.

What a leaked key can cost you in money

Run the numbers before you decide how much effort this is worth. On Google Play, a key with Manage orders and subscriptions can refund orders one call at a time, and every refund sends the sale back to the buyer. A script doesn't get tired. The ceiling is your order history for the last 3 years.

The costs that don't come back with the refund

A refund reverses the sale. It doesn't reverse what you spent serving it. That spend stays on your books whether the refund was a customer's choice or an attacker's.

  • Compute you already ran: GPU and server time behind every generation, render or model response the buyer received.
  • API calls you already paid for: per-request charges from model providers, maps, speech or data vendors.
  • Storage you keep paying for: the files and history those accounts still hold on your servers.
  • Payouts you already sent: creator, affiliate or seller payouts tied to those purchases don't return with the refund.

The Apple side has a different shape

Apple's App Store Server API has no endpoint that issues a refund. Apple decides refunds. But the same In-App Purchase key can extend a subscriber's renewal date by up to 90 days, twice in 365 days per customer, or for every active subscriber of a product in one mass request. Apple says an extension can't be reversed. For those days, the subscriber isn't billed and still uses your app, so your compute, storage and API bills keep running against no revenue.

What a stolen key can doGoogle Play service account with Manage orders and subscriptionsApple In-App Purchase key
Refund an orderYes, orders up to 3 years oldNo, only Apple refunds
End a buyer's accessYes, revoke on refundNo
Cancel or extend subscriptionsCancel, yesExtend renewal dates up to 90 days, irreversible
Read purchase dataYes, with the view permissionYes, transaction and refund history
Answer refund reviewsYes, orders.reviewrefundYes, Send Consumption Information
Scope to one appYes, through app permissionsNo, the key works across your team's apps

How to scope Google Play service account permissions

Play Console separates account permissions from app permissions. App permissions apply only to the apps you select. That one setting does more for your safety than anything else on this list.

Grant on one app, not the whole account

Invite each service account with app permissions on the apps it serves. A refund tool for one game doesn't need refund rights on your meditation app. One trap: View financial data, orders, and cancellation survey responses exists only at account level, and its app-level equivalent is called View financial data. Pick the app-level one when you scope.

Split reading from refunding

Not every job needs Manage orders and subscriptions. Analytics that only read orders can run on an account with view rights and nothing else. Keep the refund-capable key on the one service that actually calls orders.refund, orders.reviewrefund or the revoke endpoints.

Never give a robot Admin

Admin grants every permission, and Google lists inviting users and managing their permissions among its rights. A leaked Admin key can widen its own access or invite someone new. No refund workflow needs it.

Ask vendors how they connect

Some tools ask you to upload a JSON key. Others give you their own service account email to invite, so no key of yours ever leaves your control and you can remove their access from Users and permissions in one click. If a vendor needs refund rights, ask which permissions, on which apps, and why.

A developer at a desk revoking access on a laptop, with a row of keys on wall hooks and one hook empty, illustrating how to remove Google Play service account permissions

How to store, rotate and revoke the keys

Both stores say the same thing in different words. Don't put keys in a code repository and don't ship them in your app. The differences are in what happens after something goes wrong.

Google Cloud keys don't expire on their own

Google Cloud's guidance notes that service account keys don't have an expiry time by default. It recommends rotating them routinely and disabling keys you no longer use. If a key lands in a repository, Google says to delete it in IAM as quickly as possible, because deleting it from the repository isn't enough. Google Cloud can also automatically disable leaked keys it detects when the Service Account Key Exposure Response constraint is set to DISABLE_KEY, but it doesn't guarantee it'll catch every leak.

Apple keys download once and revoke for good

Only an Account Holder or Admin can generate an In-App Purchase key. Apple keeps the public half, you download the private .p8 file once, and Apple doesn't keep a copy. If you suspect a key is compromised, Apple says to revoke it immediately in App Store Connect under Users and Access, Integrations, In-App Purchase. A revoked key can't be reinstated, and revoking it also stops redemption of promotional offers signed with it, so update those offers before or right after.

TaskGoogle Play service accountApple In-App Purchase key
Who can create itCreated in Google Cloud, then invited in Play Console Users and permissionsAccount Holder or Admin
Can you download the secret againYou create a new keyNo, one download only
Default expiryNoneNone, until you revoke it
How to cut access fastDelete the key in IAM, or remove the account in Play ConsoleRevoke the key in App Store Connect
Side effects of cutting accessAny tool using that account stops calling the APIPromotional offers signed with it stop redeeming

A short checklist

  • One service account per job, invited with app permissions on only the apps it serves.
  • Manage orders and subscriptions only on the account that really refunds, revokes or answers reviews.
  • No Admin on any robot account.
  • Keys in a secret manager, never in a repository, a build log or a mobile app.
  • A written list of every key, who created it and which service uses it, so a revoke doesn't break your refund replies.
  • A review of Play Console Users and permissions and App Store Connect keys whenever someone leaves the team or a vendor is dropped.

Frequently asked questions

Which Play Console permissions does a service account need for refunds and chargebacks?
It needs Manage orders and subscriptions to refund orders, cancel subscriptions and work with orders, plus view access to orders. Google's Play Developer API guide lists View financial data, orders, and cancellation survey responses and Manage orders and subscriptions as the two permissions the Google Play Billing APIs require.
Can a Google Play service account refund orders?
Yes, if it holds the Manage orders and subscriptions permission. Google's help page says that permission lets users view orders, refund orders and cancel subscriptions, and the orders.refund API method refunds any order up to 3 years old.
Can someone with my App Store In-App Purchase key refund my customers?
No. The App Store Server API has no refund endpoint, because Apple makes refund decisions. A stolen key can still read transaction and refund history, send consumption information, and extend subscription renewal dates by up to 90 days, which Apple says can't be reversed.
Do Google Play service account keys expire?
Not by default. Google Cloud's guidance says keys you create and download have no expiry time unless you configure one, and it recommends rotating keys routinely and disabling the ones you no longer use.
What should I do if my service account JSON key was committed to GitHub?
Delete the key in Google Cloud IAM right away and create a new one. Google says removing the key from the repository isn't enough, because anyone who copied it can still use it until the key itself is deleted.

Sources and further reading

RefundHalt

The refund autopilot for the App Store and Google Play

Keep reading

The next refund request is already on its way.

Set up RefundHalt in the time it takes to read another support email about a refund you didn't get to contest.