Customers can choose a monthly or yearly billing cycle when they purchase your app. All changes customers make to the billing cycle and plan selection will trigger a
marketplace_purchase event. You can refer to the
marketplace_purchase webhook payload to see which billing cycle a customer selects and when the next billing date begins (
effective_date). For more information about webhook payloads, see "GitHub Marketplace webhook events."
Customers must be able to perform the following actions from your app's website:
- Customers must be able to modify or cancel their GitHub Marketplace plans for personal and organizational accounts separately.
- 取消从 GitHub Marketplace 购买的付费计划的客户必须被自动降级到该应用程序的免费计划（如果有）。 当客户取消 GitHub Marketplace 订阅时，GitHub 不会自动卸载应用程序，因此客户可以预期免费功能仍然有效。 强烈建议允许客户重新启用他们以前的计划。
- 如果您用以下格式提供升级 URL，客户必须能够从应用程序的 UI 升级：
- 固定费用和每单位计划的使用情况和剩余资源。 例如，如果定价计划是按单位计费，则应用程序的网站应显示已用单位和可用单位。
Follow these guidelines for upgrades, downgrades, and cancellations to maintain a clear and consistent billing process. For more detailed instructions about the GitHub Marketplace purchase events, see "Billing flows."
You can use the
effective_date key to determine when a plan change will occur and periodically synchronize the List accounts for a plan.
When a customer upgrades their pricing plan or changes their billing cycle from monthly to yearly, you should make the change effective for them immediately. You need to apply a pro-rated discount to the new plan and change the billing cycle.
如果客户升级其计划但付款失败，GitHub 会将其 GitHub Marketplace 订阅还原到以前的状态。 GitHub 还会向客户发送一封电子邮件，通知他们失败的情况，并允许他们重新尝试购买。 您将会收到带有
changed 操作的 web 挂钩，要求您还原到以前的计划。
For information about building upgrade and downgrade workflows into your app, see "Upgrading and downgrading plans."
Downgrades occur when a customer moves to a free plan from a paid plan, selects a plan with a lower cost than their current plan, or changes their billing cycle from yearly to monthly. When downgrades or cancellations occur, you don't need to provide a refund. Instead, the current plan will remain active until the last day of the current billing cycle. The
marketplace_purchase event will be sent when the new plan takes effect at the beginning of the customer's next billing cycle.
When a customer cancels a plan, you must:
Automatically downgrade them to the free plan, if it exists.
当客户取消 GitHub Marketplace 订阅时，GitHub 不会自动卸载应用程序，因此客户可以预期免费功能仍然有效。
Enable them to upgrade the plan through GitHub if they would like to continue the plan at a later time.
For information about building cancellation workflows into your app, see "Cancelling plans."