Skip to main content
설명서에 자주 업데이트를 게시하며 이 페이지의 번역이 계속 진행 중일 수 있습니다. 최신 정보는 영어 설명서를 참조하세요.

GitHub Marketplace API에 대한 웹후크 이벤트

GitHub Marketplace 앱은 Marketplace 구매 이벤트 웹후크에서 사용자의 플랜 변경에 대한 정보를 받습니다. Marketplace 구매 이벤트는 사용자가 결제 플랜을 구매, 취소 또는 변경할 때 트리거됩니다.

Note: This article applies to publishing GitHub Apps in GitHub Marketplace only. For more information about publishing GitHub Actions in GitHub Marketplace, see "Publishing actions in GitHub Marketplace."

About webhooks and GitHub Marketplace

Webhooks POST requests have special headers. See "Webhook events and payloads" for more details. GitHub doesn't resend failed delivery attempts. Ensure your app can receive all webhook payloads sent by GitHub.

Cancellations and downgrades take effect on the first day of the next billing cycle. Events for downgrades and cancellations are sent when the new plan takes effect at the beginning of the next billing cycle. Events for new purchases and upgrades begin immediately. Use the effective_date in the webhook payload to determine when a change will begin.

Note: If you notice any spammy GitHub Marketplace purchases or other malicious behavior, please complete the report abuse form with more information on the user.

About the purchase webhook payload for GitHub Marketplace

Each marketplace_purchase webhook payload will have the following information:

KeyTypeDescription
actionstringThe action performed to generate the webhook. Can be purchased, cancelled, pending_change, pending_change_cancelled, or changed. For more information, see the example webhook payloads below. Note: The pending_change and pending_change_cancelled payloads contain the same keys as shown in the changed payload example.
effective_datestringThe date the action becomes effective.
senderobjectThe person who took the action that triggered the webhook.
marketplace_purchaseobjectThe GitHub Marketplace purchase information.

The marketplace_purchase object has the following keys:

KeyTypeDescription
accountobjectThe organization or user account associated with the subscription. Organization accounts will include organization_billing_email, which is the organization's administrative email address. To find email addresses for personal accounts, you can use the Get the authenticated user endpoint.
billing_cyclestringCan be yearly or monthly. When the account owner has a free GitHub plan and has purchased a free GitHub Marketplace plan, billing_cycle will be nil.
unit_countintegerNumber of units purchased.
on_free_trialbooleantrue when the account is on a free trial.
free_trial_ends_onstringThe date the free trial will expire.
next_billing_datestringThe date that the next billing cycle will start. When the account owner has a free GitHub.com plan and has purchased a free GitHub Marketplace plan, next_billing_date will be nil.
planobjectThe plan purchased by the user or organization.

The plan object has the following keys:

KeyTypeDescription
idintegerThe unique identifier for this plan.
namestringThe plan's name.
descriptionstringThis plan's description.
monthly_price_in_centsintegerThe monthly price of this plan in cents (US currency). For example, a listing that costs 10 US dollars per month will be 1000 cents.
yearly_price_in_centsintegerThe yearly price of this plan in cents (US currency). For example, a listing that costs 100 US dollars per month will be 120000 cents.
price_modelstringThe pricing model for this listing. Can be one of FLAT_RATE, PER_UNIT, or FREE.
has_free_trialbooleantrue when this listing offers a free trial.
unit_namestringThe name of the unit. If the pricing model is not per-unit this will be nil.
bulletarray of stringsThe names of the bullets set in the pricing plan.