marketplace_subs
Creates, updates, deletes, gets or lists a marketplace_subs resource.
Overview
| Name | marketplace_subs |
| Type | Resource |
| Id | github.apps.marketplace_subs |
Fields
The following fields are returned by SELECT queries:
- get_subscription_plan_for_account
- list_accounts_for_plan
Response
| Name | Datatype | Description |
|---|---|---|
id | integer | |
email | string | |
login | string | |
marketplace_pending_change | object | |
marketplace_purchase | object | |
organization_billing_email | string | |
type | string | |
url | string |
Response
| Name | Datatype | Description |
|---|---|---|
id | integer | |
email | string | |
login | string | |
marketplace_pending_change | object | |
marketplace_purchase | object | |
organization_billing_email | string | |
type | string | |
url | string |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_subscription_plan_for_account | select | account_id | 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. | |
list_accounts_for_plan | select | plan_id | sort, direction, per_page, page | 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. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
account_id | integer | account_id parameter |
plan_id | integer | The unique identifier of the plan. |
direction | string | To return the oldest accounts first, set to asc. Ignored without the sort parameter. |
page | integer | The page number of the results to fetch. For more information, see "Using pagination in the REST API." |
per_page | integer | The number of results per page (max 100). For more information, see "Using pagination in the REST API." |
sort | string | The property to sort the results by. |
SELECT examples
- get_subscription_plan_for_account
- list_accounts_for_plan
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.
SELECT
id,
email,
login,
marketplace_pending_change,
marketplace_purchase,
organization_billing_email,
type,
url
FROM github.apps.marketplace_subs
WHERE account_id = '{{ account_id }}' -- required
;
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.
SELECT
id,
email,
login,
marketplace_pending_change,
marketplace_purchase,
organization_billing_email,
type,
url
FROM github.apps.marketplace_subs
WHERE plan_id = '{{ plan_id }}' -- required
AND sort = '{{ sort }}'
AND direction = '{{ direction }}'
AND per_page = '{{ per_page }}'
AND page = '{{ page }}'
;