Play Developer Api Reference 标志

Play Developer Api Reference

组织
RevenueCat
play-developer-api-reference

Use this skill as a quick reference for billing related Google Play Developer API REST endpoints, covering purchases.products, purchases.subscriptionsv2, purchases.voidedpurchases, and monetization endpoints. Lists paths, auth scopes, and typical request shapes.

概览

发布者RevenueCat
代码仓库play-billing-skills
技能名称play-developer-api-reference
星标数
58
复刻数
0
附带文件
仅含指令
许可协议Apache-2.0
链接
  • Markdown 格式的指令

    模型按需加载的 SKILL.md 文件,因此只有在请求确实匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 指令自成一体

    模型所需的一切都包含在指令中,无需同步额外文件。

  • 开源

    由 RevenueCat 发布于 GitHub。请在安装前查看源内容。

安装

在 TypingMind 中安装 Play Developer Api Reference AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/RevenueCat/play-billing-skills/tree/main/google-play/play-developer-api-reference
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/RevenueCat/play-billing-skills.git /tmp/play-billing-skills
mkdir -p .claude/skills
cp -r /tmp/play-billing-skills/google-play/play-developer-api-reference .claude/skills/play-developer-api-reference
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Play Developer Api Reference,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Play Developer Api Reference。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Play Developer Api Reference 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会获取指令,因此未使用的技能不会产生额外费用。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

Google Play Developer API Quick Reference

Phase 0: Intent

Use this skill when you need to look up a Google Play Developer API endpoint used for billing, subscription lifecycle management, one time product handling, refunds, voided purchase reconciliation, or catalog management. The skill returns exact REST paths, HTTP methods, response field names, query parameters, and auth scopes so you can build or debug server side calls against androidpublisher.googleapis.com.

Typical questions this skill answers:

  • Which endpoint returns the current state of a subscription token?
  • How do I cancel, revoke, or defer a subscription from the backend?
  • What fields does SubscriptionPurchaseV2 return?
  • Which path consumes or acknowledges a one time product?
  • How do I page through voided purchases?
  • What monetization endpoints manage subscriptions, base plans, and offers?
  • Which quota bucket applies to my call?

Phase 1: Locate

All endpoint tables, response field schemas, and quota guidance live in the full appendix on revenuecat.com. Jump directly to the section that matches your use case:

You want to...Go to section
Inspect or mutate a subscription purchaseSubscription Purchases
Read fields on a subscription responseSubscriptionPurchaseV2 Response (Key Fields)
Inspect, acknowledge, or consume a one time productOne Time Product Purchases
Read fields on a product purchase responseProductPurchase Response (Key Fields)
Issue a refundOrders
Reconcile refunds or chargebacksVoided Purchases
Query parameters for the voided purchases listQuery Parameters for Voided Purchases
Manage subscription productsCatalog Management: Subscriptions
Manage base plansCatalog Management: Base Plans
Manage offersCatalog Management: Offers
Manage a one time product (the default surface)Catalog Management: One Time Products (monetization.onetimeproducts)
Manage a legacy one time product never migrated off inappproductsLegacy One Time Products (inappproducts)
Understand quota bucketsRate Limiting

Phase 2: Reference

Base URL for every endpoint:

text
https://androidpublisher.googleapis.com/androidpublisher/v3/

Subscription Purchases

EndpointMethodPathDescription
purchases.subscriptionsv2.getGETapplications/{packageName}/purchases/subscriptionsv2/tokens/{token}Get the current state of a subscription. This is the source of truth.
purchases.subscriptionsv2.revokePOSTapplications/{packageName}/purchases/subscriptionsv2/tokens/{token}:revokeRevoke a subscription immediately. User loses access right away.
purchases.subscriptionsv2.deferPOSTapplications/{packageName}/purchases/subscriptionsv2/tokens/{token}:deferDefer the next billing date (min 1 day, max 1 year extension).
purchases.subscriptionsv2.cancelPOSTapplications/{packageName}/purchases/subscriptionsv2/tokens/{token}:cancelCancel a subscription. User retains access until expiryTime.
purchases.subscriptions.acknowledgePOSTapplications/{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:acknowledgeAcknowledge a subscription purchase.
purchases.subscriptions.cancel / purchases.subscriptions.deferPOSTv1 paths with {subscriptionId}Deprecated. Use the subscriptionsv2 methods above. (purchases.subscriptions.get has been removed.)

Request bodies: cancel {"cancellationContext": {"cancellationType": "USER_REQUESTED_STOP_RENEWALS" | "DEVELOPER_REQUESTED_STOP_PAYMENTS"}}; defer {"deferralContext": {"etag": "<etag from subscriptionsv2.get>", "deferDuration": "604800s", "validateOnly": false}} (response itemExpiryTimeDetails[]); revoke {"revocationContext": {"fullRefund": {}}} or proratedRefund: {} or itemBasedRefund: {"productId": "..."}.

SubscriptionPurchaseV2 Response (Key Fields)
FieldTypeDescription
kindstringAlways "androidpublisher#subscriptionPurchaseV2"
subscriptionStatestring (enum)SUBSCRIPTION_STATE_PENDING, SUBSCRIPTION_STATE_ACTIVE, SUBSCRIPTION_STATE_PAUSED, SUBSCRIPTION_STATE_IN_GRACE_PERIOD, SUBSCRIPTION_STATE_ON_HOLD, SUBSCRIPTION_STATE_CANCELED, SUBSCRIPTION_STATE_EXPIRED, SUBSCRIPTION_STATE_PENDING_PURCHASE_CANCELED
lineItems[]arrayOne entry per base plan/offer in the subscription
lineItems[].productIdstringThe subscription product ID
lineItems[].expiryTimetimestampWhen this line item expires
lineItems[].autoRenewingPlanobjectPresent for auto renewing plans. Contains autoRenewEnabled.
lineItems[].prepaidPlanobjectPresent for prepaid plans. Contains allowExtendAfterTime.
lineItems[].offerDetailsobjectOffer applied to this line item. Contains offerTags[], basePlanId.
linkedPurchaseTokenstringIf this purchase replaces another, the token of the replaced purchase.
startTimetimestampWhen the subscription was first purchased.
regionCodestringISO 3166-1 alpha-2 country code of the user.
canceledStateContextobjectWhy the subscription was canceled. Contains one of userInitiatedCancellation, systemInitiatedCancellation, developerInitiatedCancellation, or replacementCancellation. Present for CANCELED and EXPIRED states.
acknowledgementStatestringACKNOWLEDGEMENT_STATE_PENDING or ACKNOWLEDGEMENT_STATE_ACKNOWLEDGED
externalAccountIdentifiersobjectContains obfuscatedExternalAccountId and obfuscatedExternalProfileId.
pausedStateContextobjectPresent when paused. Contains autoResumeTime.

One Time Product Purchases

EndpointMethodPathDescription
purchases.products.getGETapplications/{packageName}/purchases/products/{productId}/tokens/{token}Get the state of a one time product purchase.
purchases.productsv2.getproductpurchasev2GETapplications/{packageName}/purchases/productsv2/tokens/{token}Get one time product purchase using v2 API (no productId required).
purchases.products.acknowledgePOSTapplications/{packageName}/purchases/products/{productId}/tokens/{token}:acknowledgeAcknowledge a one time product purchase.
purchases.products.consumePOSTapplications/{packageName}/purchases/products/{productId}/tokens/{token}:consumeConsume a one time product (makes it available for repurchase).
ProductPurchase Response (Key Fields)
FieldTypeDescription
kindstringAlways "androidpublisher#productPurchase"
purchaseTimeMillislongTime of purchase in milliseconds since epoch.
purchaseStateinteger0 = Purchased, 1 = Canceled, 2 = Pending
consumptionStateinteger0 = Not consumed, 1 = Consumed
orderIdstringThe order ID for this transaction.
acknowledgementStateinteger0 = Not acknowledged, 1 = Acknowledged
purchaseTokenstringThe purchase token.
productIdstringThe product ID.
quantityintegerQuantity purchased (for multi quantity purchases).
obfuscatedExternalAccountIdstringObfuscated account ID set during purchase.
obfuscatedExternalProfileIdstringObfuscated profile ID set during purchase.
regionCodestringISO 3166-1 alpha-2 country code.

Orders

EndpointMethodPathDescription
orders.getGETapplications/{packageName}/orders/{orderId}Get order details for a single order.
orders.batchgetGETapplications/{packageName}/orders:batchGetGet order details for a list of orders.
orders.refundPOSTapplications/{packageName}/orders/{orderId}:refundRefund an order. Add ?revoke=true to also end access (and future renewals). Orders older than 3 years cannot be refunded.
orders.reviewrefundPOSTapplications/{packageName}/orders/{orderId}:reviewrefundAnswer a pendingRefundReviewNotification (chargeback) within 24 hours. Body: pendingRefundToken, refundPreference (APPROVE / DECLINE / NEUTRAL), sampleContentProvided.

Voided Purchases

EndpointMethodPathDescription
purchases.voidedpurchases.listGETapplications/{packageName}/purchases/voidedpurchasesList voided (refunded/revoked) purchases. Supports pagination and filtering by time.
Query Parameters for Voided Purchases
ParameterTypeDescription
startTimelongMilliseconds since epoch. Only return purchases voided after this time. Cannot be older than 30 days (default: now minus 30 days); ignored when token is set.
endTimelongMilliseconds since epoch. Only return purchases voided before this time.
startIndexintegerPagination offset. Only when indexed paging is enabled; prefer token.
tokenstringContinuation token from tokenPagination.nextPageToken of the previous page.
maxResultsintegerMaximum results per page (default 1000, max 1000).
typeinteger0 = voided one time purchases only (default), 1 = one time purchases and subscriptions. With 1, key records by orderId because subscription renewals share a purchase token.
includeQuantityBasedPartialRefundbooleanInclude partial quantity based refunds.

Catalog Management: Subscriptions

EndpointMethodPathDescription
monetization.subscriptions.createPOSTapplications/{packageName}/subscriptionsCreate a new subscription.
monetization.subscriptions.getGETapplications/{packageName}/subscriptions/{productId}Get subscription details.
monetization.subscriptions.listGETapplications/{packageName}/subscriptionsList all subscriptions.
monetization.subscriptions.patchPATCHapplications/{packageName}/subscriptions/{productId}Update subscription fields.
monetization.subscriptions.deleteDELETEapplications/{packageName}/subscriptions/{productId}Delete a draft subscription.
monetization.subscriptions.batchGetGETapplications/{packageName}/subscriptions:batchGetGet multiple subscriptions (up to 100).
monetization.subscriptions.batchUpdatePOSTapplications/{packageName}/subscriptions:batchUpdateUpdate multiple subscriptions (up to 100).

Catalog Management: Base Plans

EndpointMethodPathDescription
monetization.subscriptions.basePlans.activatePOST...basePlans/{basePlanId}:activateActivate a base plan.
monetization.subscriptions.basePlans.deactivatePOST...basePlans/{basePlanId}:deactivateDeactivate a base plan.
monetization.subscriptions.basePlans.deleteDELETE...basePlans/{basePlanId}Delete a base plan.
monetization.subscriptions.basePlans.migratePricesPOST...basePlans/{basePlanId}:migratePricesEnd a legacy price cohort by migrating subscribers to the current price.
monetization.subscriptions.basePlans.batchMigratePricesPOST...basePlans:batchMigratePricesBatch price migration.
monetization.subscriptions.basePlans.batchUpdateStatesPOST...basePlans:batchUpdateStatesBatch activate/deactivate.

Catalog Management: Offers

EndpointMethodPathDescription
monetization.subscriptions.basePlans.offers.createPOST...offersCreate an offer.
monetization.subscriptions.basePlans.offers.getGET...offers/{offerId}Get offer details.
monetization.subscriptions.basePlans.offers.listGET...offersList offers for a base plan.
monetization.subscriptions.basePlans.offers.patchPATCH...offers/{offerId}Update an offer.
monetization.subscriptions.basePlans.offers.deleteDELETE...offers/{offerId}Delete a draft offer.
monetization.subscriptions.basePlans.offers.activatePOST...offers/{offerId}:activateActivate an offer.
monetization.subscriptions.basePlans.offers.deactivatePOST...offers/{offerId}:deactivateDeactivate an offer.
monetization.subscriptions.basePlans.offers.batchGetPOST...offers:batchGetGet multiple offers.
monetization.subscriptions.basePlans.offers.batchUpdatePOST...offers:batchUpdateUpdate multiple offers.
monetization.subscriptions.basePlans.offers.batchUpdateStatesPOST...offers:batchUpdateStatesBatch activate/deactivate offers.

Catalog Management: One Time Products (monetization.onetimeproducts)

The default surface for one time products: covers products created here and catalogs migrated from inappproducts. Once a product is migrated, it can no longer be reached through inappproducts.

EndpointMethodPathDescription
monetization.onetimeproducts.getGETapplications/{packageName}/oneTimeProducts/{productId}Get product details.
monetization.onetimeproducts.listGETapplications/{packageName}/oneTimeProductsList all one time products.
monetization.onetimeproducts.patchPATCHapplications/{packageName}/onetimeproducts/{productId}Create (with allowMissing=true) or update a product. Requires updateMask and regionsVersion.version; there is no create method.
monetization.onetimeproducts.batchGetGETapplications/{packageName}/oneTimeProducts:batchGetGet multiple products.
monetization.onetimeproducts.batchUpdatePOSTapplications/{packageName}/oneTimeProducts:batchUpdateCreate or update up to 100 products.
monetization.onetimeproducts.deleteDELETEapplications/{packageName}/oneTimeProducts/{productId}Delete a product.
monetization.onetimeproducts.batchDeletePOSTapplications/{packageName}/oneTimeProducts:batchDeleteDelete multiple products.
monetization.onetimeproducts.purchaseOptions.batchUpdateStatesPOSTapplications/{packageName}/oneTimeProducts/{productId}/purchaseOptions:batchUpdateStatesActivate or deactivate purchase options. A new purchase option starts Draft and is invisible to the Play Billing Library until activated.
monetization.onetimeproducts.purchaseOptions.offers.activate / .deactivate / .cancelPOST.../purchaseOptions/{purchaseOptionId}/offers/{offerId}:activate (or :deactivate, :cancel)Change the state of one offer.
monetization.onetimeproducts.purchaseOptions.offers.batchUpdate / .batchUpdateStates / .listPOST / POST / GET.../purchaseOptions/{purchaseOptionId}/offers:batchUpdate (or :batchUpdateStates, or no suffix for list)Bulk update, bulk activate or deactivate, or list offers under one purchase option.

Legacy One Time Products (inappproducts)

Only for one time products never migrated off the inappproducts service. See Catalog Management: One Time Products (monetization.onetimeproducts) above for everything else.

EndpointMethodPathDescription
inappproducts.insertPOSTapplications/{packageName}/inappproductsCreate a one time product.
inappproducts.getGETapplications/{packageName}/inappproducts/{sku}Get product details.
inappproducts.listGETapplications/{packageName}/inappproductsList all one time products.
inappproducts.patchPATCHapplications/{packageName}/inappproducts/{sku}Update product fields.
inappproducts.updatePUTapplications/{packageName}/inappproducts/{sku}Replace product entirely.
inappproducts.deleteDELETEapplications/{packageName}/inappproducts/{sku}Delete a product.
inappproducts.batchGetGETapplications/{packageName}/inappproducts:batchGetGet multiple products (up to 100).
inappproducts.batchUpdatePOSTapplications/{packageName}/inappproducts:batchUpdateUpdate multiple products (up to 100).
inappproducts.batchDeletePOSTapplications/{packageName}/inappproducts:batchDeleteDelete multiple products.

Rate Limiting

Quota bucketAPIs in the bucketDefault quota
SubscriptionsSubscriptionPurchases and SubscriptionPurchasesV2 calls not listed under Subscription Updates (for example purchases.subscriptionsv2.get, purchases.subscriptions.acknowledge)3,000 queries per minute, independent per bucket
Subscription Updatespurchases.subscriptionsv2.revoke and the deprecated v1 purchases.subscriptions.cancel / .defer (Google's quota page does not yet list subscriptionsv2.cancel or .defer)3,000 queries per minute, independent per bucket
One-time Purchasespurchases.products.*, purchases.productsv2.*3,000 queries per minute, independent per bucket
Ordersorders.*, purchases.voidedpurchases.list3,000 queries per minute, independent per bucket
ExternalTransactionsexternaltransactions.*3,000 queries per minute for the bucket; createexternaltransaction and refundexternaltransaction also share a 1,200 queries per minute limit (get calls do not count)
Publishing, Monetization, and Reply to ReviewsPublishing APIs, monetization.*, Permissions APIs, Reply to Reviews APIs3,000 queries per minute, independent per bucket

There are no Read, Write, or Sensitive query tiers; catalog writes are additionally limited per app per hour by latencyTolerance (see catalog-management). Quota is measured per project, per minute, per bucket, and each bucket's quota is independent of the others. When you exceed a bucket's quota, the API returns HTTP 429 (Too Many Requests). Implement exponential backoff for quota errors. You can monitor usage in Google Cloud Console > IAM & Admin > Quotas (service androidpublisher.googleapis.com).

Phase 3: Auth and Scopes

Every call to androidpublisher.googleapis.com uses OAuth 2.0. The only scope you need for billing operations is:

text
https://www.googleapis.com/auth/androidpublisher

Guidance for a server side integration:

  1. Create a service account in a Google Cloud project that has the Google Play Android Developer API enabled.
  2. Grant the service account access in Play Console under Users and permissions. Assign only the permissions you need. For subscription reads assign "View financial data, orders, and cancellation survey responses". For purchase mutations (refund, cancel, revoke, defer) assign "Manage orders and subscriptions". For catalog calls (monetization.*, inappproducts.*) assign "Manage store presence".
  3. Mint a short lived access token from the service account JSON key using your platform's Google auth client. Cache the token until a minute before expiry.
  4. Send Authorization: Bearer <token> on every request. Set Content-Type: application/json for POST, PATCH, and PUT bodies.
  5. Use exponential backoff for HTTP 429 and 5xx responses. Treat 401 as "refresh token" and 403 as "fix permissions", not as retry candidates.

Typical request shape for a subscription state lookup:

http
GET /androidpublisher/v3/applications/com.example.app/purchases/subscriptionsv2/tokens/abc123 HTTP/1.1
Host: androidpublisher.googleapis.com
Authorization: Bearer ya29.a0Af...
Accept: application/json

Typical request shape for a cancel call:

http
POST /androidpublisher/v3/applications/com.example.app/purchases/subscriptionsv2/tokens/abc123:cancel HTTP/1.1
Host: androidpublisher.googleapis.com
Authorization: Bearer ya29.a0Af...
Content-Type: application/json

{"cancellationContext": {"cancellationType": "USER_REQUESTED_STOP_RENEWALS"}}

Typical request shape for a voided purchases page:

http
GET /androidpublisher/v3/applications/com.example.app/purchases/voidedpurchases?maxResults=1000&type=1 HTTP/1.1
Host: androidpublisher.googleapis.com
Authorization: Bearer ya29.a0Af...

References

常见问题

Play Developer Api Reference AI 技能有什么作用?

Use this skill as a quick reference for billing related Google Play Developer API REST endpoints, covering purchases.products, purchases.subscriptionsv2, purchases.voidedpurchases, and monetization endpoints. Lists paths, auth scopes, and typical request shapes.

为什么在 TypingMind 中使用 Play Developer Api Reference?

因为您只需安装一次,就能搭配任何模型使用。Play Developer Api Reference 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型,甚至可以在聊天中途切换模型,而不会影响技能正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Play Developer Api Reference?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/RevenueCat/play-billing-skills/tree/main/google-play/play-developer-api-reference。TypingMind 会读取其中的 SKILL.md,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Play Developer Api Reference?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Play Developer Api Reference 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以搭配 Play Developer Api Reference 使用,包括 GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等,都可在 TypingMind 中使用您自己的 API 密钥接入。

Play Developer Api Reference AI 技能免费吗?

是的。该技能源自 RevenueCat 在 GitHub 上以 Apache-2.0 许可证发布的项目。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇