Skip to main content

Using the GitHub Marketplace API in your app

Learn how to integrate the GitHub Marketplace API and webhook events into your app for the GitHub Marketplace .

REST endpoints for the GitHub Marketplace API

To help manage your app on GitHub Marketplace, use these GitHub Marketplace API endpoints.

Webhook events for the GitHub Marketplace API

A GitHub Marketplace app receives information about changes to a user's plan from the Marketplace purchase event webhook. A Marketplace purchase event is triggered when a user purchases, cancels, or changes their payment plan.

Testing your app

GitHub recommends testing your app with APIs and webhooks before submitting your listing to GitHub Marketplace so you can provide an ideal experience for customers. Before an onboarding expert approves your app, it must adequately handle the billing flows.

Handling new purchases and free trials

When a customer purchases a paid plan, free trial, or the free version of your GitHub Marketplace app, you'll receive the marketplace_purchase event webhook with the purchased action, which kicks off the purchasing flow.

Handling plan changes

Upgrading or downgrading a GitHub Marketplace app triggers the marketplace_purchase event webhook with the changed action, which kicks off the upgrade or downgrade flow.

Handling plan cancellations

Cancelling a GitHub Marketplace app triggers the marketplace_purchase event webhook with the cancelled action, which kicks off the cancellation flow.