You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

咨询可管理Apple/Google In-App Products的API及网站集成方案

Answer

Great question! Both Google and Apple offer official APIs that let you manage in-app products directly from your own website or backend system—no more manual trips to their developer portals. Here's a detailed breakdown for each platform:

Google Play Platform

Google provides the Google Play Developer API which supports full CRUD (Create, Read, Update, Delete) operations for in-app products. Here's what you need to get started:

  • First, enable the API in your Google Cloud Console and link it to your Google Play Developer account.
  • Authenticate requests using a service account with appropriate permissions (like Edit access to your app's in-app products).
  • Key endpoints for managing products:
    • POST /applications/{packageName}/inappproducts to create a new in-app product
    • PUT /applications/{packageName}/inappproducts/{sku} to update an existing product
    • DELETE /applications/{packageName}/inappproducts/{sku} to remove a product
  • Example curl request for creating a product (replace placeholders with your own details):
    curl -X POST \
      "https://androidpublisher.googleapis.com/androidpublisher/v3/applications/com.your.app.package/inappproducts" \
      -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
      -H "Content-Type: application/json" \
      -d '{
        "sku": "premium_lifetime",
        "status": "ACTIVE",
        "defaultPrice": {
          "priceMicros": "19990000",
          "currency": "USD"
        },
        "listings": {
          "en-US": {
            "title": "Lifetime Premium Access",
            "description": "Unlock all features forever"
          }
        }
      }'
    

Apple App Store Platform

Apple's App Store Connect API lets you manage all types of in-app purchases (consumable, non-consumable, subscriptions). Key details:

  • Generate an API key in App Store Connect and assign it roles like In-App Purchase Manager or Admin to grant necessary permissions.
  • Authenticate each request using JSON Web Tokens (JWT) signed with your API key.
  • Relevant endpoints:
    • For non-consumable/consumable products: Use endpoints under apps/{id}/inAppPurchases
    • For subscriptions: Use endpoints under apps/{id}/subscriptions
  • Important restriction: Apple only allows deleting products that are in the DRAFT state. Active products can be removed from sale but not fully deleted.

Quick Tips

  • Test all API operations in sandbox environments first (Google Play's internal test tracks, Apple's sandbox) before touching production.
  • Keep authentication credentials (service account keys, API tokens) secure—never expose them in client-side code.
  • Both platforms enforce rate limits, so plan batch operations to avoid hitting those limits.

内容的提问来源于stack exchange,提问作者Mohan

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.25 04:08:51