{"meta":{"title":"在应用中使用 GitHub Marketplace API","intro":"了解如何将 GitHub Marketplace API 和 web 挂钩集成到用于 GitHub Marketplace 的应用程序中。","product":"应用","breadcrumbs":[{"href":"/zh/apps","title":"应用"},{"href":"/zh/apps/github-marketplace","title":"GitHub市场"},{"href":"/zh/apps/github-marketplace/using-the-github-marketplace-api-in-your-app","title":"Marketplace API 使用"}],"documentType":"subcategory"},"body":"# 在应用中使用 GitHub Marketplace API\n\n了解如何将 GitHub Marketplace API 和 web 挂钩集成到用于 GitHub Marketplace 的应用程序中。\n\n## Links\n\n* [GitHub Marketplace API 的 REST 端点](/zh/apps/github-marketplace/using-the-github-marketplace-api-in-your-app/rest-endpoints-for-the-github-marketplace-api)\n\n  要帮助管理 GitHub Marketplace 上的应用程序，请使用这些 GitHub Marketplace API 端点。\n\n* [GitHub Marketplace API 的 web 挂钩事件](/zh/apps/github-marketplace/using-the-github-marketplace-api-in-your-app/webhook-events-for-the-github-marketplace-api)\n\n  GitHub Marketplace 应用程序通过 Marketplace 购买事件 webhook 接收有关用户计划更改的信息。 当用户购买、取消或更改其付款计划时，就会触发 Marketplace 购买事件。\n\n* [测试你的应用程序](/zh/apps/github-marketplace/using-the-github-marketplace-api-in-your-app/testing-your-app)\n\n  GitHub 建议在将上架信息提交到 GitHub Marketplace 之前，先使用 API 和 web 挂钩测试你的应用，以便为客户提供理想的体验。 在应用审核专家批准您的应用程序之前，它必须能够妥善处理计费流程。\n\n* [处理新购买和免费试用](/zh/apps/github-marketplace/using-the-github-marketplace-api-in-your-app/handling-new-purchases-and-free-trials)\n\n  当客户购买付费计划、免费试用或免费版本的 GitHub Marketplace 应用时，你将收到包含 <c1><c0 /> 事件和 <c2 /> 操作的 Webhook，这将启动购买流程。\n\n* [处理计划更改](/zh/apps/github-marketplace/using-the-github-marketplace-api-in-your-app/handling-plan-changes)\n\n  升级或降级 GitHub Marketplace 应用会触发带有 marketplace\\_purchase 操作的  webhook，从而启动升级或降级流程。\n\n* [处理计划取消](/zh/apps/github-marketplace/using-the-github-marketplace-api-in-your-app/handling-plan-cancellations)\n\n  取消 GitHub Marketplace 应用会触发带有 marketplace\\_purchase 操作的  webhook，从而启动取消流程。"}