Understanding the billing cycle
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 APIのためのwebhookイベント."
Providing billing services in your app's UI
Customers should be able to perform the following actions from your app's website:
- Customers should be able to modify or cancel their GitHub Marketplace plans for personal and organizational accounts separately.
- GitHub Marketplaceから購入した有料プランをキャンセルした顧客は、そのアプリケーションに無料プランがあれば自動的にダウングレードされなければなりません。 顧客がGitHub Marketplaceのサブスクリプションをキャンセルした場合、GitHubは自動的にアプリケーションをアンインストールしないので、顧客は無料の機能を使い続けられることが期待できます。 顧客は以前のプランを再度有効にできるようにすることが強く推奨されます。
- 次の形式でアップグレード URL を指定すると、顧客はアプリのユーザー インターフェイスからアップグレードできるようになります。
https://www.github.com/marketplace/<LISTING_NAME>/upgrade/<LISTING_PLAN_NUMBER>/<CUSTOMER_ACCOUNT_ID>
- シート(ユニット単位の価格プラン)もしくは無制限のコラボレーターを提供するプランを購入した場合、どのユーザがアプリケーションにアクセスできるかを、顧客がアプリケーションのWebサイトから変更できるようにするべきです。
- 以下の変更は、顧客が自分のアカウントで、アプリケーションのWebサイトの支払い、プロフィール、もしくはアカウント設定のセクションにおいてすぐに見ることができるようになっているべきです。
- 現在のプランと価格。
- 購入された新しいプラン。
- アップグレード、ダウングレード、キャンセル、無料トライアルの残り日数。
- 支払いサイクルの変更(月または年単位)。
- 定額及びユニット単位のプランの利用状況と残りのリソース。 たとえば、価格プランがユニット単位であれば、アプリケーションのサイトは使用されたユニットと使用可能なユニットを表示すべきです。
Billing services for upgrades, downgrades, and cancellations
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 "Using the GitHub Marketplace API in your app."
You can use the marketplace_purchase
webhook's effective_date
key to determine when a plan change will occur and periodically synchronize the List accounts for a plan.
Upgrades
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
アクションを含む Webhook を受け取ります。
For information about building upgrade and downgrade workflows into your app, see "Handling plan changes."
Downgrades and cancellations
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 "Handling plan cancellations."