{"meta":{"title":"Конечные точки REST API для GitHub Marketplace","intro":"Использование REST API для взаимодействия с GitHub Marketplace","product":"REST API","breadcrumbs":[{"href":"/ru/enterprise-cloud@latest/rest","title":"REST API"},{"href":"/ru/enterprise-cloud@latest/rest/apps","title":"Приложения"},{"href":"/ru/enterprise-cloud@latest/rest/apps/marketplace","title":"Marketplace"}],"documentType":"article"},"body":"# Конечные точки REST API для {% data variables.product.prodname\\_marketplace %}\n\nИспользование REST API для взаимодействия с GitHub Marketplace\n\n## О GitHub Marketplace\n\nДополнительные сведения о GitHub Marketplaceсм. в разделе [Маркетплейс GitHub](/ru/enterprise-cloud@latest/apps/publishing-apps-to-github-marketplace).\n\nЭти конечные точки позволяют узнать, какие клиенты используют тарифный план, просмотреть покупки клиента и узнать, есть ли у учетной записи активная подписка.\n\n### Тестирование с использованием суррогатных конечных точек\n\nВы можете [протестировать данные GitHub App](/ru/enterprise-cloud@latest/apps/publishing-apps-to-github-marketplace/using-the-github-marketplace-api-in-your-app/testing-your-app) с **помощью ступеных данных**. Cуррогатные данные — это жестко закодированные, выдуманные данные, которые не изменяются в зависимости от фактических подписок.\n\nДля тестирования с использованием суррогатных данных используйте суррогатную конечную точку вместо ее рабочего аналога. Это позволяет проверить успешность логики API перед перечислением GitHub Apps на GitHub Marketplace.\n\nПеред развертыванием GitHub Appобязательно замените ступеные конечные точки рабочими точками.\n\n> \\[!NOTE]\n> Most endpoints use `Authorization: Bearer <YOUR-TOKEN>` and `Accept: application/vnd.github+json` headers, plus `X-GitHub-Api-Version: 2026-03-10`. Curl examples below omit these standard headers for brevity.\n\n## Get a subscription plan for an account\n\n```\nGET /marketplace_listing/accounts/{account_id}\n```\n\nShows 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.\nGitHub 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.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`account_id`** (integer) (required)\n  account\\_id parameter\n\n### HTTP response status codes\n\n* **200** - OK\n\n* **401** - Requires authentication\n\n* **404** - Not Found when the account has not purchased the listing\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  https://api.github.com/marketplace_listing/accounts/ACCOUNT_ID\n```\n\n**Response schema (Status: 200):**\n\n* `url`: required, string\n* `type`: required, string\n* `id`: required, integer\n* `login`: required, string\n* `organization_billing_email`: string\n* `email`: string or null\n* `marketplace_pending_change`: object or null:\n  * `is_installed`: boolean\n  * `effective_date`: string\n  * `unit_count`: integer or null\n  * `id`: integer\n  * `plan`: `Marketplace Listing Plan`:\n    * `url`: required, string, format: uri\n    * `accounts_url`: required, string, format: uri\n    * `id`: required, integer\n    * `number`: required, integer\n    * `name`: required, string\n    * `description`: required, string\n    * `monthly_price_in_cents`: required, integer\n    * `yearly_price_in_cents`: required, integer\n    * `price_model`: required, string, enum: `FREE`, `FLAT_RATE`, `PER_UNIT`\n    * `has_free_trial`: required, boolean\n    * `unit_name`: required, string or null\n    * `state`: required, string\n    * `bullets`: required, array of string\n* `marketplace_purchase`: required, object:\n  * `billing_cycle`: string\n  * `next_billing_date`: string or null\n  * `is_installed`: boolean\n  * `unit_count`: integer or null\n  * `on_free_trial`: boolean\n  * `free_trial_ends_on`: string or null\n  * `updated_at`: string\n  * `plan`: `Marketplace Listing Plan`:\n    * `url`: required, string, format: uri\n    * `accounts_url`: required, string, format: uri\n    * `id`: required, integer\n    * `number`: required, integer\n    * `name`: required, string\n    * `description`: required, string\n    * `monthly_price_in_cents`: required, integer\n    * `yearly_price_in_cents`: required, integer\n    * `price_model`: required, string, enum: `FREE`, `FLAT_RATE`, `PER_UNIT`\n    * `has_free_trial`: required, boolean\n    * `unit_name`: required, string or null\n    * `state`: required, string\n    * `bullets`: required, array of string\n\n## List plans\n\n```\nGET /marketplace_listing/plans\n```\n\nLists all plans that are part of your GitHub Enterprise Cloud Marketplace listing.\nGitHub 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.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`per_page`** (integer)\n  The number of results per page (max 100). For more information, see \"Using pagination in the REST API.\"\n  Default: `30`\n\n* **`page`** (integer)\n  The page number of the results to fetch. For more information, see \"Using pagination in the REST API.\"\n  Default: `1`\n\n### HTTP response status codes\n\n* **200** - OK\n\n* **401** - Requires authentication\n\n* **404** - Resource not found\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  https://api.github.com/marketplace_listing/plans\n```\n\n**Response schema (Status: 200):**\n\nArray of `Marketplace Listing Plan`:\n\n* `url`: required, string, format: uri\n* `accounts_url`: required, string, format: uri\n* `id`: required, integer\n* `number`: required, integer\n* `name`: required, string\n* `description`: required, string\n* `monthly_price_in_cents`: required, integer\n* `yearly_price_in_cents`: required, integer\n* `price_model`: required, string, enum: `FREE`, `FLAT_RATE`, `PER_UNIT`\n* `has_free_trial`: required, boolean\n* `unit_name`: required, string or null\n* `state`: required, string\n* `bullets`: required, array of string\n\n## List accounts for a plan\n\n```\nGET /marketplace_listing/plans/{plan_id}/accounts\n```\n\nReturns 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.\nGitHub 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.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`plan_id`** (integer) (required)\n  The unique identifier of the plan.\n\n* **`sort`** (string)\n  The property to sort the results by.\n  Default: `created`\n  Can be one of: `created`, `updated`\n\n* **`direction`** (string)\n  To return the oldest accounts first, set to asc. Ignored without the sort parameter.\n  Can be one of: `asc`, `desc`\n\n* **`per_page`** (integer)\n  The number of results per page (max 100). For more information, see \"Using pagination in the REST API.\"\n  Default: `30`\n\n* **`page`** (integer)\n  The page number of the results to fetch. For more information, see \"Using pagination in the REST API.\"\n  Default: `1`\n\n### HTTP response status codes\n\n* **200** - OK\n\n* **401** - Requires authentication\n\n* **404** - Resource not found\n\n* **422** - Validation failed, or the endpoint has been spammed.\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  https://api.github.com/marketplace_listing/plans/PLAN_ID/accounts\n```\n\n**Response schema (Status: 200):**\n\nArray of `Marketplace Purchase`:\n\n* `url`: required, string\n* `type`: required, string\n* `id`: required, integer\n* `login`: required, string\n* `organization_billing_email`: string\n* `email`: string or null\n* `marketplace_pending_change`: object or null:\n  * `is_installed`: boolean\n  * `effective_date`: string\n  * `unit_count`: integer or null\n  * `id`: integer\n  * `plan`: `Marketplace Listing Plan`:\n    * `url`: required, string, format: uri\n    * `accounts_url`: required, string, format: uri\n    * `id`: required, integer\n    * `number`: required, integer\n    * `name`: required, string\n    * `description`: required, string\n    * `monthly_price_in_cents`: required, integer\n    * `yearly_price_in_cents`: required, integer\n    * `price_model`: required, string, enum: `FREE`, `FLAT_RATE`, `PER_UNIT`\n    * `has_free_trial`: required, boolean\n    * `unit_name`: required, string or null\n    * `state`: required, string\n    * `bullets`: required, array of string\n* `marketplace_purchase`: required, object:\n  * `billing_cycle`: string\n  * `next_billing_date`: string or null\n  * `is_installed`: boolean\n  * `unit_count`: integer or null\n  * `on_free_trial`: boolean\n  * `free_trial_ends_on`: string or null\n  * `updated_at`: string\n  * `plan`: `Marketplace Listing Plan`:\n    * `url`: required, string, format: uri\n    * `accounts_url`: required, string, format: uri\n    * `id`: required, integer\n    * `number`: required, integer\n    * `name`: required, string\n    * `description`: required, string\n    * `monthly_price_in_cents`: required, integer\n    * `yearly_price_in_cents`: required, integer\n    * `price_model`: required, string, enum: `FREE`, `FLAT_RATE`, `PER_UNIT`\n    * `has_free_trial`: required, boolean\n    * `unit_name`: required, string or null\n    * `state`: required, string\n    * `bullets`: required, array of string\n\n## Get a subscription plan for an account (stubbed)\n\n```\nGET /marketplace_listing/stubbed/accounts/{account_id}\n```\n\nShows 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.\nGitHub 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.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`account_id`** (integer) (required)\n  account\\_id parameter\n\n### HTTP response status codes\n\n* **200** - OK\n\n* **401** - Requires authentication\n\n* **404** - Not Found when the account has not purchased the listing\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  https://api.github.com/marketplace_listing/stubbed/accounts/ACCOUNT_ID\n```\n\n**Response schema (Status: 200):**\n\nSame response schema as [Get a subscription plan for an account](#get-a-subscription-plan-for-an-account).\n\n## List plans (stubbed)\n\n```\nGET /marketplace_listing/stubbed/plans\n```\n\nLists all plans that are part of your GitHub Enterprise Cloud Marketplace listing.\nGitHub 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.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`per_page`** (integer)\n  The number of results per page (max 100). For more information, see \"Using pagination in the REST API.\"\n  Default: `30`\n\n* **`page`** (integer)\n  The page number of the results to fetch. For more information, see \"Using pagination in the REST API.\"\n  Default: `1`\n\n### HTTP response status codes\n\n* **200** - OK\n\n* **401** - Requires authentication\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  https://api.github.com/marketplace_listing/stubbed/plans\n```\n\n**Response schema (Status: 200):**\n\nSame response schema as [List plans](#list-plans).\n\n## List accounts for a plan (stubbed)\n\n```\nGET /marketplace_listing/stubbed/plans/{plan_id}/accounts\n```\n\nReturns 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.\nGitHub 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.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`plan_id`** (integer) (required)\n  The unique identifier of the plan.\n\n* **`sort`** (string)\n  The property to sort the results by.\n  Default: `created`\n  Can be one of: `created`, `updated`\n\n* **`direction`** (string)\n  To return the oldest accounts first, set to asc. Ignored without the sort parameter.\n  Can be one of: `asc`, `desc`\n\n* **`per_page`** (integer)\n  The number of results per page (max 100). For more information, see \"Using pagination in the REST API.\"\n  Default: `30`\n\n* **`page`** (integer)\n  The page number of the results to fetch. For more information, see \"Using pagination in the REST API.\"\n  Default: `1`\n\n### HTTP response status codes\n\n* **200** - OK\n\n* **401** - Requires authentication\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  https://api.github.com/marketplace_listing/stubbed/plans/PLAN_ID/accounts\n```\n\n**Response schema (Status: 200):**\n\nSame response schema as [List accounts for a plan](#list-accounts-for-a-plan).\n\n## List subscriptions for the authenticated user\n\n```\nGET /user/marketplace_purchases\n```\n\nLists the active subscriptions for the authenticated user.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`per_page`** (integer)\n  The number of results per page (max 100). For more information, see \"Using pagination in the REST API.\"\n  Default: `30`\n\n* **`page`** (integer)\n  The page number of the results to fetch. For more information, see \"Using pagination in the REST API.\"\n  Default: `1`\n\n### HTTP response status codes\n\n* **200** - OK\n\n* **304** - Not modified\n\n* **401** - Requires authentication\n\n* **404** - Resource not found\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  https://api.github.com/user/marketplace_purchases\n```\n\n**Response schema (Status: 200):**\n\nArray of `User Marketplace Purchase`:\n\n* `billing_cycle`: required, string\n* `next_billing_date`: required, string or null, format: date-time\n* `unit_count`: required, integer or null\n* `on_free_trial`: required, boolean\n* `free_trial_ends_on`: required, string or null, format: date-time\n* `updated_at`: required, string or null, format: date-time\n* `account`: required, `Marketplace Account`:\n  * `url`: required, string, format: uri\n  * `id`: required, integer\n  * `type`: required, string\n  * `node_id`: string\n  * `login`: required, string\n  * `email`: string or null, format: email\n  * `organization_billing_email`: string or null, format: email\n* `plan`: required, `Marketplace Listing Plan`:\n  * `url`: required, string, format: uri\n  * `accounts_url`: required, string, format: uri\n  * `id`: required, integer\n  * `number`: required, integer\n  * `name`: required, string\n  * `description`: required, string\n  * `monthly_price_in_cents`: required, integer\n  * `yearly_price_in_cents`: required, integer\n  * `price_model`: required, string, enum: `FREE`, `FLAT_RATE`, `PER_UNIT`\n  * `has_free_trial`: required, boolean\n  * `unit_name`: required, string or null\n  * `state`: required, string\n  * `bullets`: required, array of string\n\n## List subscriptions for the authenticated user (stubbed)\n\n```\nGET /user/marketplace_purchases/stubbed\n```\n\nLists the active subscriptions for the authenticated user.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`per_page`** (integer)\n  The number of results per page (max 100). For more information, see \"Using pagination in the REST API.\"\n  Default: `30`\n\n* **`page`** (integer)\n  The page number of the results to fetch. For more information, see \"Using pagination in the REST API.\"\n  Default: `1`\n\n### HTTP response status codes\n\n* **200** - OK\n\n* **304** - Not modified\n\n* **401** - Requires authentication\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  https://api.github.com/user/marketplace_purchases/stubbed\n```\n\n**Response schema (Status: 200):**\n\nSame response schema as [List subscriptions for the authenticated user](#list-subscriptions-for-the-authenticated-user)."}