Skip to main content

Developer API (2.0.0)

Download OpenAPI specification:Download

Package

Operations about packages.

Get a package

This endpoint requires the following permission(s): project_configuration:packages:read. This endpoint belongs to the Project Configuration domain, which has a default rate limit of 60 requests per minute.

Authorizations:
BearerAuth
path Parameters
project_id
required
string <= 255 characters
Example: proj1ab2c3d4

ID of the project

package_id
required
string [ 1 .. 255 ] characters
Example: pkge1a2b3c4d5

ID of the package

query Parameters
expand
Array of strings[ items [ 1 .. 5000 ] characters ]
Items Value: "product"
Example: expand=product

Specifies which fields in the response should be expanded. Accepted values are: product (requires project_configuration:products:read permission).

Responses

Response samples

Content type
application/json
{
  • "object": "package",
  • "id": "pkge1a2b3c4d5",
  • "lookup_key": "monthly",
  • "display_name": "Monthly discounted with 3-day trial",
  • "position": 1,
  • "created_at": 1658399423658,
  • "products": {
    }
}

Update a package

This endpoint requires the following permission(s): project_configuration:packages:read_write. This endpoint belongs to the Project Configuration domain, which has a default rate limit of 60 requests per minute.

Authorizations:
BearerAuth
path Parameters
project_id
required
string <= 255 characters
Example: proj1ab2c3d4

ID of the project

package_id
required
string [ 1 .. 255 ] characters
Example: pkge1a2b3c4d5

ID of the package

Request Body schema: application/json
required
display_name
string [ 1 .. 1500 ] characters

The display name of the package

position
integer >= 1

The position of the package within the offering

Responses

Request samples

Content type
application/json
{
  • "display_name": "monthly with one-week trial",
  • "position": 2
}

Response samples

Content type
application/json
{
  • "object": "package",
  • "id": "pkge1a2b3c4d5",
  • "lookup_key": "monthly",
  • "display_name": "Monthly discounted with 3-day trial",
  • "position": 1,
  • "created_at": 1658399423658,
  • "products": {
    }
}

Delete a package

This endpoint requires the following permission(s): project_configuration:packages:read_write. This endpoint belongs to the Project Configuration domain, which has a default rate limit of 60 requests per minute.

Authorizations:
BearerAuth
path Parameters
project_id
required
string <= 255 characters
Example: proj1ab2c3d4

ID of the project

package_id
required
string [ 1 .. 255 ] characters
Example: pkge1a2b3c4d5

ID of the package

Responses

Response samples

Content type
application/json
{
  • "object": "app",
  • "id": "string",
  • "deleted_at": 1658399423658
}

Get a list of packages in an offering

This endpoint requires the following permission(s): project_configuration:packages:read. This endpoint belongs to the Project Configuration domain, which has a default rate limit of 60 requests per minute.

Authorizations:
BearerAuth
path Parameters
project_id
required
string <= 255 characters
Example: proj1ab2c3d4

ID of the project

offering_id
required
string [ 1 .. 255 ] characters
Example: ofrnge1a2b3c4d5

ID of the offering

query Parameters
starting_after
string
Example: starting_after=ent12354

Pagination cursor. Pass the id of the last item from the previous page to fetch the next page; omit for the first page.

limit
integer
Default: 20
Example: limit=10

Maximum number of items to return per page. Values below 1 or above 100 are clamped to that range rather than rejected.

expand
Array of strings[ items [ 1 .. 5000 ] characters ]
Items Value: "items.product"
Example: expand=items.product

Specifies which fields in the response should be expanded. Accepted values are: items.product (requires project_configuration:products:read permission).

Responses

Response samples

Content type
application/json
{
  • "object": "list",
  • "items": [
    ],
  • "next_page": "/v2/projects/proj1ab2c3d4/offerings/ofrnge1a2b3c4d5/packages?starting_after=pkgeab21dac",
  • "url": "/v2/projects/proj1ab2c3d4/offerings/ofrnge1a2b3c4d5/packages"
}

Create a package

This endpoint requires the following permission(s): project_configuration:packages:read_write. This endpoint belongs to the Project Configuration domain, which has a default rate limit of 60 requests per minute.

Authorizations:
BearerAuth
path Parameters
project_id
required
string <= 255 characters
Example: proj1ab2c3d4

ID of the project

offering_id
required
string [ 1 .. 255 ] characters
Example: ofrnge1a2b3c4d5

ID of the offering

Request Body schema: application/json
required
lookup_key
required
string [ 1 .. 200 ] characters

The lookup_key of the package

display_name
required
string [ 1 .. 1500 ] characters

The display name of the package

position
integer

The position of the package in the offering

Responses

Request samples

Content type
application/json
{
  • "lookup_key": "monthly",
  • "display_name": "monthly with one-week trial",
  • "position": 1
}

Response samples

Content type
application/json
{
  • "object": "package",
  • "id": "pkge1a2b3c4d5",
  • "lookup_key": "monthly",
  • "display_name": "Monthly discounted with 3-day trial",
  • "position": 1,
  • "created_at": 1658399423658,
  • "products": {
    }
}

Get a list of products attached to a given package of an offering

This endpoint requires the following permission(s): project_configuration:packages:read. This endpoint belongs to the Project Configuration domain, which has a default rate limit of 60 requests per minute.

Authorizations:
BearerAuth
path Parameters
project_id
required
string <= 255 characters
Example: proj1ab2c3d4

ID of the project

package_id
required
string [ 1 .. 255 ] characters
Example: pkge1a2b3c4d5

ID of the package

query Parameters
starting_after
string
Example: starting_after=ent12354

Pagination cursor. Pass the id of the last item from the previous page to fetch the next page; omit for the first page.

limit
integer
Default: 20
Example: limit=10

Maximum number of items to return per page. Values below 1 or above 100 are clamped to that range rather than rejected.

Responses

Response samples

Content type
application/json
{
  • "object": "list",
  • "items": [
    ],
  • "next_page": "/v2/projects/proj1ab2c3d4/packages/pkge1a2b3c4d5/products?starting_after=prod1a2b3c4d5",
  • "url": "/v2/projects/proj1ab2c3d4/packages/pkge1a2b3c4d5/products"
}

Attach a set of products to a package

This endpoint requires the following permission(s): project_configuration:packages:read_write. This endpoint belongs to the Project Configuration domain, which has a default rate limit of 60 requests per minute.

Authorizations:
BearerAuth
path Parameters
project_id
required
string <= 255 characters
Example: proj1ab2c3d4

ID of the project

package_id
required
string [ 1 .. 255 ] characters
Example: pkge1a2b3c4d5

ID of the package

Request Body schema: application/json
required
required
Array of objects (PackageProductIDAssociation) [ 1 .. 50 ] characters

Product association list

Array
product_id
required
string [ 1 .. 255 ] characters
eligibility_criteria
required
string (EligibilityCriteria)
Enum: "all" "google_sdk_lt_6" "google_sdk_ge_6"

Responses

Request samples

Content type
application/json
Example
{
  • "products": [
    ]
}

Response samples

Content type
application/json
{
  • "object": "package",
  • "id": "pkge1a2b3c4d5",
  • "lookup_key": "monthly",
  • "display_name": "Monthly discounted with 3-day trial",
  • "position": 1,
  • "created_at": 1658399423658,
  • "products": {
    }
}

Detach a set of products from a package

This endpoint requires the following permission(s): project_configuration:packages:read_write. This endpoint belongs to the Project Configuration domain, which has a default rate limit of 60 requests per minute.

Authorizations:
BearerAuth
path Parameters
project_id
required
string <= 255 characters
Example: proj1ab2c3d4

ID of the project

package_id
required
string [ 1 .. 255 ] characters
Example: pkge1a2b3c4d5

ID of the package

Request Body schema: application/json
required
product_ids
required
Array of strings [ 1 .. 50 ] characters [ items [ 1 .. 255 ] characters ]

IDs of the products to detach from the package

Responses

Request samples

Content type
application/json
{
  • "product_ids": [
    ]
}

Response samples

Content type
application/json
{
  • "object": "package",
  • "id": "pkge1a2b3c4d5",
  • "lookup_key": "monthly",
  • "display_name": "Monthly discounted with 3-day trial",
  • "position": 1,
  • "created_at": 1658399423658,
  • "products": {
    }
}