Skip to main content
Die REST-API verfügt jetzt über eine Versionskontrolle. Weitere Informationen findest du unter Informationen zur API-Versionsverwaltung.

REST-API-Endpunkte für GitHub Marketplace

Verwende die REST-API, um mit dem GitHub Marketplace zu interagieren.

Informationen zum GitHub Marketplace

Weitere Informationen zu GitHub Marketplace findest du unter GitHub Marketplace.

Anhand dieser Endpunkte kannst du erkennen, welche Kunden einen Preisplan verwenden, du kannst die Käufe eines Kunden anzeigen, und du kannst feststellen, ob ein Konto über ein aktives Abonnement verfügt.

Testen mit Stubendpunkten

Du kannst deine test your GitHub App mit Stubdaten testen. Stubdaten sind hartcodierte Dummydaten, die sich nicht basierend auf tatsächlichen Abonnements ändern.

Verwende zum Testen mit Stubdaten einen Stubendpunkt anstelle des Produktionsendpunkts. Auf diese Weise kannst du testen, ob die API-Logik funktioniert, bevor du GitHub Apps auf dem GitHub Marketplace anbietest.

Ersetze die Stubendpunkte durch Produktionsendpunkte, bevor du deine GitHub App bereitstellst.

Get a subscription plan for an account

Shows whether the user or organization account actively subscribes to a plan listed by the authenticated GitHub App. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change.

GitHub Apps must use a JWT to access this endpoint. OAuth apps must use basic authentication with their client ID and client secret to access this endpoint.

Differenzierte Zugriffstoken für "Get a subscription plan for an account"

Dieser Endpunkt funktioniert nicht mit GitHub-App-Benutzerzugriffstoken, GitHub-App-Installationszugriffstoken oder differenzierten persönlichen Zugriffstoken.

Parameter für „Get a subscription plan for an account“

Header
Name, type, BESCHREIBUNG
accept string

Setting to application/vnd.github+json is recommended.

Pfadparameter
Name, type, BESCHREIBUNG
account_id integer Erforderlich

account_id parameter

HTTP-Antwortstatuscodes für „Get a subscription plan for an account“

StatuscodeBESCHREIBUNG
200

OK

401

Requires authentication

404

Not Found when the account has not purchased the listing

Codebeispiele für „Get a subscription plan for an account“

If you access GitHub at GHE.com, replace api.github.com with your enterprise's dedicated subdomain at api.SUBDOMAIN.ghe.com.

Anforderungsbeispiel

get/marketplace_listing/accounts/{account_id}
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/marketplace_listing/accounts/ACCOUNT_ID

Response

Status: 200
{ "url": "https://api.github.com/orgs/github", "type": "Organization", "id": 4, "login": "github", "organization_billing_email": "billing@github.com", "email": "billing@github.com", "marketplace_pending_change": { "effective_date": "2017-11-11T00:00:00Z", "unit_count": null, "id": 77, "plan": { "url": "https://api.github.com/marketplace_listing/plans/1111", "accounts_url": "https://api.github.com/marketplace_listing/plans/1111/accounts", "id": 1111, "number": 2, "name": "Startup", "description": "A professional-grade CI solution", "monthly_price_in_cents": 699, "yearly_price_in_cents": 7870, "price_model": "FLAT_RATE", "has_free_trial": true, "state": "published", "unit_name": null, "bullets": [ "Up to 10 private repositories", "3 concurrent builds" ] } }, "marketplace_purchase": { "billing_cycle": "monthly", "next_billing_date": "2017-11-11T00:00:00Z", "unit_count": null, "on_free_trial": true, "free_trial_ends_on": "2017-11-11T00:00:00Z", "updated_at": "2017-11-02T01:12:12Z", "plan": { "url": "https://api.github.com/marketplace_listing/plans/1313", "accounts_url": "https://api.github.com/marketplace_listing/plans/1313/accounts", "id": 1313, "number": 3, "name": "Pro", "description": "A professional-grade CI solution", "monthly_price_in_cents": 1099, "yearly_price_in_cents": 11870, "price_model": "FLAT_RATE", "has_free_trial": true, "unit_name": null, "state": "published", "bullets": [ "Up to 25 private repositories", "11 concurrent builds" ] } } }

List plans

Lists all plans that are part of your GitHub Enterprise Cloud Marketplace listing.

GitHub Apps must use a JWT to access this endpoint. OAuth apps must use basic authentication with their client ID and client secret to access this endpoint.

Differenzierte Zugriffstoken für "List plans"

Dieser Endpunkt funktioniert nicht mit GitHub-App-Benutzerzugriffstoken, GitHub-App-Installationszugriffstoken oder differenzierten persönlichen Zugriffstoken.

Parameter für „List plans“

Header
Name, type, BESCHREIBUNG
accept string

Setting to application/vnd.github+json is recommended.

Abfrageparameter
Name, type, BESCHREIBUNG
per_page integer

The number of results per page (max 100). For more information, see "Using pagination in the REST API."

Standard: 30

page integer

The page number of the results to fetch. For more information, see "Using pagination in the REST API."

Standard: 1

HTTP-Antwortstatuscodes für „List plans“

StatuscodeBESCHREIBUNG
200

OK

401

Requires authentication

404

Resource not found

Codebeispiele für „List plans“

If you access GitHub at GHE.com, replace api.github.com with your enterprise's dedicated subdomain at api.SUBDOMAIN.ghe.com.

Anforderungsbeispiel

get/marketplace_listing/plans
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/marketplace_listing/plans

Response

Status: 200
[ { "url": "https://api.github.com/marketplace_listing/plans/1313", "accounts_url": "https://api.github.com/marketplace_listing/plans/1313/accounts", "id": 1313, "number": 3, "name": "Pro", "description": "A professional-grade CI solution", "monthly_price_in_cents": 1099, "yearly_price_in_cents": 11870, "price_model": "FLAT_RATE", "has_free_trial": true, "unit_name": null, "state": "published", "bullets": [ "Up to 25 private repositories", "11 concurrent builds" ] } ]

List accounts for a plan

Returns user and organization accounts associated with the specified plan, including free plans. For per-seat pricing, you see the list of accounts that have purchased the plan, including the number of seats purchased. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change.

GitHub Apps must use a JWT to access this endpoint. OAuth apps must use basic authentication with their client ID and client secret to access this endpoint.

Differenzierte Zugriffstoken für "List accounts for a plan"

Dieser Endpunkt funktioniert nicht mit GitHub-App-Benutzerzugriffstoken, GitHub-App-Installationszugriffstoken oder differenzierten persönlichen Zugriffstoken.

Parameter für „List accounts for a plan“

Header
Name, type, BESCHREIBUNG
accept string

Setting to application/vnd.github+json is recommended.

Pfadparameter
Name, type, BESCHREIBUNG
plan_id integer Erforderlich

The unique identifier of the plan.

Abfrageparameter
Name, type, BESCHREIBUNG
sort string

The property to sort the results by.

Standard: created

Kann eine der Folgenden sein: created, updated

direction string

To return the oldest accounts first, set to asc. Ignored without the sort parameter.

Kann eine der Folgenden sein: asc, desc

per_page integer

The number of results per page (max 100). For more information, see "Using pagination in the REST API."

Standard: 30

page integer

The page number of the results to fetch. For more information, see "Using pagination in the REST API."

Standard: 1

HTTP-Antwortstatuscodes für „List accounts for a plan“

StatuscodeBESCHREIBUNG
200

OK

401

Requires authentication

404

Resource not found

422

Validation failed, or the endpoint has been spammed.

Codebeispiele für „List accounts for a plan“

If you access GitHub at GHE.com, replace api.github.com with your enterprise's dedicated subdomain at api.SUBDOMAIN.ghe.com.

Anforderungsbeispiel

get/marketplace_listing/plans/{plan_id}/accounts
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/marketplace_listing/plans/PLAN_ID/accounts

Response

Status: 200
[ { "url": "https://api.github.com/orgs/github", "type": "Organization", "id": 4, "login": "github", "organization_billing_email": "billing@github.com", "marketplace_pending_change": { "effective_date": "2017-11-11T00:00:00Z", "unit_count": null, "id": 77, "plan": { "url": "https://api.github.com/marketplace_listing/plans/1111", "accounts_url": "https://api.github.com/marketplace_listing/plans/1111/accounts", "id": 1111, "number": 2, "name": "Startup", "description": "A professional-grade CI solution", "monthly_price_in_cents": 699, "yearly_price_in_cents": 7870, "price_model": "FLAT_RATE", "has_free_trial": true, "state": "published", "unit_name": null, "bullets": [ "Up to 10 private repositories", "3 concurrent builds" ] } }, "marketplace_purchase": { "billing_cycle": "monthly", "next_billing_date": "2017-11-11T00:00:00Z", "unit_count": null, "on_free_trial": true, "free_trial_ends_on": "2017-11-11T00:00:00Z", "updated_at": "2017-11-02T01:12:12Z", "plan": { "url": "https://api.github.com/marketplace_listing/plans/1313", "accounts_url": "https://api.github.com/marketplace_listing/plans/1313/accounts", "id": 1313, "number": 3, "name": "Pro", "description": "A professional-grade CI solution", "monthly_price_in_cents": 1099, "yearly_price_in_cents": 11870, "price_model": "FLAT_RATE", "has_free_trial": true, "unit_name": null, "state": "published", "bullets": [ "Up to 25 private repositories", "11 concurrent builds" ] } } } ]

Get a subscription plan for an account (stubbed)

Shows whether the user or organization account actively subscribes to a plan listed by the authenticated GitHub App. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change.

GitHub Apps must use a JWT to access this endpoint. OAuth apps must use basic authentication with their client ID and client secret to access this endpoint.

Differenzierte Zugriffstoken für "Get a subscription plan for an account (stubbed)"

Dieser Endpunkt funktioniert nicht mit GitHub-App-Benutzerzugriffstoken, GitHub-App-Installationszugriffstoken oder differenzierten persönlichen Zugriffstoken.

Parameter für „Get a subscription plan for an account (stubbed)“

Header
Name, type, BESCHREIBUNG
accept string

Setting to application/vnd.github+json is recommended.

Pfadparameter
Name, type, BESCHREIBUNG
account_id integer Erforderlich

account_id parameter

HTTP-Antwortstatuscodes für „Get a subscription plan for an account (stubbed)“

StatuscodeBESCHREIBUNG
200

OK

401

Requires authentication

404

Not Found when the account has not purchased the listing

Codebeispiele für „Get a subscription plan for an account (stubbed)“

If you access GitHub at GHE.com, replace api.github.com with your enterprise's dedicated subdomain at api.SUBDOMAIN.ghe.com.

Anforderungsbeispiel

get/marketplace_listing/stubbed/accounts/{account_id}
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/marketplace_listing/stubbed/accounts/ACCOUNT_ID

Response

Status: 200
{ "url": "https://api.github.com/orgs/github", "type": "Organization", "id": 4, "login": "github", "organization_billing_email": "billing@github.com", "email": "billing@github.com", "marketplace_pending_change": { "effective_date": "2017-11-11T00:00:00Z", "unit_count": null, "id": 77, "plan": { "url": "https://api.github.com/marketplace_listing/plans/1111", "accounts_url": "https://api.github.com/marketplace_listing/plans/1111/accounts", "id": 1111, "number": 2, "name": "Startup", "description": "A professional-grade CI solution", "monthly_price_in_cents": 699, "yearly_price_in_cents": 7870, "price_model": "FLAT_RATE", "has_free_trial": true, "state": "published", "unit_name": null, "bullets": [ "Up to 10 private repositories", "3 concurrent builds" ] } }, "marketplace_purchase": { "billing_cycle": "monthly", "next_billing_date": "2017-11-11T00:00:00Z", "unit_count": null, "on_free_trial": true, "free_trial_ends_on": "2017-11-11T00:00:00Z", "updated_at": "2017-11-02T01:12:12Z", "plan": { "url": "https://api.github.com/marketplace_listing/plans/1313", "accounts_url": "https://api.github.com/marketplace_listing/plans/1313/accounts", "id": 1313, "number": 3, "name": "Pro", "description": "A professional-grade CI solution", "monthly_price_in_cents": 1099, "yearly_price_in_cents": 11870, "price_model": "FLAT_RATE", "has_free_trial": true, "unit_name": null, "state": "published", "bullets": [ "Up to 25 private repositories", "11 concurrent builds" ] } } }

List plans (stubbed)

Lists all plans that are part of your GitHub Enterprise Cloud Marketplace listing.

GitHub Apps must use a JWT to access this endpoint. OAuth apps must use basic authentication with their client ID and client secret to access this endpoint.

Differenzierte Zugriffstoken für "List plans (stubbed)"

Dieser Endpunkt funktioniert nicht mit GitHub-App-Benutzerzugriffstoken, GitHub-App-Installationszugriffstoken oder differenzierten persönlichen Zugriffstoken.

Parameter für „List plans (stubbed)“

Header
Name, type, BESCHREIBUNG
accept string

Setting to application/vnd.github+json is recommended.

Abfrageparameter
Name, type, BESCHREIBUNG
per_page integer

The number of results per page (max 100). For more information, see "Using pagination in the REST API."

Standard: 30

page integer

The page number of the results to fetch. For more information, see "Using pagination in the REST API."

Standard: 1

HTTP-Antwortstatuscodes für „List plans (stubbed)“

StatuscodeBESCHREIBUNG
200

OK

401

Requires authentication

Codebeispiele für „List plans (stubbed)“

If you access GitHub at GHE.com, replace api.github.com with your enterprise's dedicated subdomain at api.SUBDOMAIN.ghe.com.

Anforderungsbeispiel

get/marketplace_listing/stubbed/plans
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/marketplace_listing/stubbed/plans

Response

Status: 200
[ { "url": "https://api.github.com/marketplace_listing/plans/1313", "accounts_url": "https://api.github.com/marketplace_listing/plans/1313/accounts", "id": 1313, "number": 3, "name": "Pro", "description": "A professional-grade CI solution", "monthly_price_in_cents": 1099, "yearly_price_in_cents": 11870, "price_model": "FLAT_RATE", "has_free_trial": true, "unit_name": null, "state": "published", "bullets": [ "Up to 25 private repositories", "11 concurrent builds" ] } ]

List accounts for a plan (stubbed)

Returns repository and organization accounts associated with the specified plan, including free plans. For per-seat pricing, you see the list of accounts that have purchased the plan, including the number of seats purchased. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change.

GitHub Apps must use a JWT to access this endpoint. OAuth apps must use basic authentication with their client ID and client secret to access this endpoint.

Differenzierte Zugriffstoken für "List accounts for a plan (stubbed)"

Dieser Endpunkt funktioniert nicht mit GitHub-App-Benutzerzugriffstoken, GitHub-App-Installationszugriffstoken oder differenzierten persönlichen Zugriffstoken.

Parameter für „List accounts for a plan (stubbed)“

Header
Name, type, BESCHREIBUNG
accept string

Setting to application/vnd.github+json is recommended.

Pfadparameter
Name, type, BESCHREIBUNG
plan_id integer Erforderlich

The unique identifier of the plan.

Abfrageparameter
Name, type, BESCHREIBUNG
sort string

The property to sort the results by.

Standard: created

Kann eine der Folgenden sein: created, updated

direction string

To return the oldest accounts first, set to asc. Ignored without the sort parameter.

Kann eine der Folgenden sein: asc, desc

per_page integer

The number of results per page (max 100). For more information, see "Using pagination in the REST API."

Standard: 30

page integer

The page number of the results to fetch. For more information, see "Using pagination in the REST API."

Standard: 1

HTTP-Antwortstatuscodes für „List accounts for a plan (stubbed)“

StatuscodeBESCHREIBUNG
200

OK

401

Requires authentication

Codebeispiele für „List accounts for a plan (stubbed)“

If you access GitHub at GHE.com, replace api.github.com with your enterprise's dedicated subdomain at api.SUBDOMAIN.ghe.com.

Anforderungsbeispiel

get/marketplace_listing/stubbed/plans/{plan_id}/accounts
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/marketplace_listing/stubbed/plans/PLAN_ID/accounts

Response

Status: 200
[ { "url": "https://api.github.com/orgs/github", "type": "Organization", "id": 4, "login": "github", "organization_billing_email": "billing@github.com", "marketplace_pending_change": { "effective_date": "2017-11-11T00:00:00Z", "unit_count": null, "id": 77, "plan": { "url": "https://api.github.com/marketplace_listing/plans/1111", "accounts_url": "https://api.github.com/marketplace_listing/plans/1111/accounts", "id": 1111, "number": 2, "name": "Startup", "description": "A professional-grade CI solution", "monthly_price_in_cents": 699, "yearly_price_in_cents": 7870, "price_model": "FLAT_RATE", "has_free_trial": true, "state": "published", "unit_name": null, "bullets": [ "Up to 10 private repositories", "3 concurrent builds" ] } }, "marketplace_purchase": { "billing_cycle": "monthly", "next_billing_date": "2017-11-11T00:00:00Z", "unit_count": null, "on_free_trial": true, "free_trial_ends_on": "2017-11-11T00:00:00Z", "updated_at": "2017-11-02T01:12:12Z", "plan": { "url": "https://api.github.com/marketplace_listing/plans/1313", "accounts_url": "https://api.github.com/marketplace_listing/plans/1313/accounts", "id": 1313, "number": 3, "name": "Pro", "description": "A professional-grade CI solution", "monthly_price_in_cents": 1099, "yearly_price_in_cents": 11870, "price_model": "FLAT_RATE", "has_free_trial": true, "unit_name": null, "state": "published", "bullets": [ "Up to 25 private repositories", "11 concurrent builds" ] } } } ]

List subscriptions for the authenticated user

Lists the active subscriptions for the authenticated user.

Differenzierte Zugriffstoken für "List subscriptions for the authenticated user"

Dieser Endpunkt funktioniert mit den folgenden differenzierten Tokentypen.:

Das differenzierte Token erfordert keine Berechtigungen.

Parameter für „List subscriptions for the authenticated user“

Header
Name, type, BESCHREIBUNG
accept string

Setting to application/vnd.github+json is recommended.

Abfrageparameter
Name, type, BESCHREIBUNG
per_page integer

The number of results per page (max 100). For more information, see "Using pagination in the REST API."

Standard: 30

page integer

The page number of the results to fetch. For more information, see "Using pagination in the REST API."

Standard: 1

HTTP-Antwortstatuscodes für „List subscriptions for the authenticated user“

StatuscodeBESCHREIBUNG
200

OK

304

Not modified

401

Requires authentication

404

Resource not found

Codebeispiele für „List subscriptions for the authenticated user“

If you access GitHub at GHE.com, replace api.github.com with your enterprise's dedicated subdomain at api.SUBDOMAIN.ghe.com.

Anforderungsbeispiel

get/user/marketplace_purchases
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/user/marketplace_purchases

Response

Status: 200
[ { "billing_cycle": "monthly", "next_billing_date": "2017-11-11T00:00:00Z", "unit_count": null, "on_free_trial": true, "free_trial_ends_on": "2017-11-11T00:00:00Z", "updated_at": "2017-11-02T01:12:12Z", "account": { "login": "github", "id": 4, "node_id": "MDEyOk9yZ2FuaXphdGlvbjE=", "url": "https://api.github.com/orgs/github", "email": null, "organization_billing_email": "billing@github.com", "type": "Organization" }, "plan": { "url": "https://api.github.com/marketplace_listing/plans/1313", "accounts_url": "https://api.github.com/marketplace_listing/plans/1313/accounts", "id": 1313, "number": 3, "name": "Pro", "description": "A professional-grade CI solution", "monthly_price_in_cents": 1099, "yearly_price_in_cents": 11870, "price_model": "FLAT_RATE", "has_free_trial": true, "unit_name": null, "state": "published", "bullets": [ "Up to 25 private repositories", "11 concurrent builds" ] } } ]

List subscriptions for the authenticated user (stubbed)

Lists the active subscriptions for the authenticated user.

Differenzierte Zugriffstoken für "List subscriptions for the authenticated user (stubbed)"

Dieser Endpunkt funktioniert mit den folgenden differenzierten Tokentypen.:

Das differenzierte Token erfordert keine Berechtigungen.

Parameter für „List subscriptions for the authenticated user (stubbed)“

Header
Name, type, BESCHREIBUNG
accept string

Setting to application/vnd.github+json is recommended.

Abfrageparameter
Name, type, BESCHREIBUNG
per_page integer

The number of results per page (max 100). For more information, see "Using pagination in the REST API."

Standard: 30

page integer

The page number of the results to fetch. For more information, see "Using pagination in the REST API."

Standard: 1

HTTP-Antwortstatuscodes für „List subscriptions for the authenticated user (stubbed)“

StatuscodeBESCHREIBUNG
200

OK

304

Not modified

401

Requires authentication

Codebeispiele für „List subscriptions for the authenticated user (stubbed)“

If you access GitHub at GHE.com, replace api.github.com with your enterprise's dedicated subdomain at api.SUBDOMAIN.ghe.com.

Anforderungsbeispiel

get/user/marketplace_purchases/stubbed
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/user/marketplace_purchases/stubbed

Response

Status: 200
[ { "billing_cycle": "monthly", "next_billing_date": "2017-11-11T00:00:00Z", "unit_count": null, "on_free_trial": true, "free_trial_ends_on": "2017-11-11T00:00:00Z", "updated_at": "2017-11-02T01:12:12Z", "account": { "login": "github", "id": 4, "node_id": "MDEyOk9yZ2FuaXphdGlvbjE=", "url": "https://api.github.com/orgs/github", "email": null, "organization_billing_email": "billing@github.com", "type": "Organization" }, "plan": { "url": "https://api.github.com/marketplace_listing/plans/1313", "accounts_url": "https://api.github.com/marketplace_listing/plans/1313/accounts", "id": 1313, "number": 3, "name": "Pro", "description": "A professional-grade CI solution", "monthly_price_in_cents": 1099, "yearly_price_in_cents": 11870, "price_model": "FLAT_RATE", "has_free_trial": true, "unit_name": null, "state": "published", "bullets": [ "Up to 25 private repositories", "11 concurrent builds" ] } } ]