Skip to content

Planship API 0.1.1

health


GET /api/v1/health

Health

Description

Basic health check

Response 200 OK

Schema of the response body
{
    "title": "Response Health Api V1 Health Get"
}

auth


POST /api/v1/auth/token

Get Access Token

Description

Obtain an access token for client credentials

Input parameters

Parameter In Type Default Nullable Description
basic header string N/A No

Response 200 OK

{
    "access_token": "string",
    "token_type": "string",
    "expires_in": 0
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "title": "TokenResponse",
    "required": [
        "access_token",
        "token_type",
        "expires_in"
    ],
    "type": "object",
    "properties": {
        "access_token": {
            "title": "Access Token",
            "type": "string"
        },
        "token_type": {
            "title": "Token Type",
            "type": "string"
        },
        "expires_in": {
            "title": "Expires In",
            "type": "integer"
        }
    },
    "description": "An OAuth2 Token response."
}

products


GET /api/v1/products

List Products

Description

List all products in the current organization. Organization is determined by the Planship API auth token.

Input parameters

Parameter In Type Default Nullable Description
oAuth2ClientCredentials header string N/A No
limit query integer 100 No
skip query integer 0 No

Response 200 OK

[
    {
        "id": "7adaf60c-3962-4312-ad12-a82b47363970",
        "name": "string",
        "slug": "string"
    }
]
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "title": "Response List Products Api V1 Products Get",
    "type": "array",
    "items": {
        "$ref": "#/components/schemas/IdNameSlugOrmBase"
    }
}

Response 422 Unprocessable Entity

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string"
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "title": "HTTPValidationError",
    "type": "object",
    "properties": {
        "detail": {
            "title": "Detail",
            "type": "array",
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            }
        }
    }
}

GET /api/v1/products/{slug}

Get Product

Description

Get a product with a given slug in the current organization. Organization is determined by the Planship API auth token.

Input parameters

Parameter In Type Default Nullable Description
oAuth2ClientCredentials header string N/A No
slug path string No

Response 200 OK

{
    "description": "string",
    "name": "string",
    "organization_id": "e829e09e-3157-49b2-8ae6-4f95513140c0",
    "slug": "string",
    "id": "daa3f9f0-fe07-4712-9d13-92820571e484"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "title": "Product",
    "required": [
        "name",
        "organization_id",
        "slug",
        "id"
    ],
    "type": "object",
    "properties": {
        "description": {
            "title": "Description",
            "type": "string",
            "default": ""
        },
        "name": {
            "title": "Name",
            "type": "string"
        },
        "organization_id": {
            "title": "Organization Id",
            "type": "string",
            "format": "uuid"
        },
        "slug": {
            "title": "Slug",
            "type": "string"
        },
        "id": {
            "title": "Id",
            "type": "string",
            "format": "uuid"
        }
    }
}

Response 422 Unprocessable Entity

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string"
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "title": "HTTPValidationError",
    "type": "object",
    "properties": {
        "detail": {
            "title": "Detail",
            "type": "array",
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            }
        }
    }
}

GET /api/v1/products/{slug}/levers

List Product Levers

Description

List all levers for the product with a given slug in the current organization. Organization is determined by the Planship API auth token.

Input parameters

Parameter In Type Default Nullable Description
oAuth2ClientCredentials header string N/A No
slug path string No

Response 200 OK

[
    {
        "id": "a85e281c-075b-4123-a3d7-187f3a206d5c",
        "name": "string",
        "slug": "string"
    }
]
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "title": "Response List Product Levers Api V1 Products  Slug  Levers Get",
    "type": "array",
    "items": {
        "$ref": "#/components/schemas/IdNameSlugOrmBase"
    }
}

Response 422 Unprocessable Entity

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string"
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "title": "HTTPValidationError",
    "type": "object",
    "properties": {
        "detail": {
            "title": "Detail",
            "type": "array",
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            }
        }
    }
}

GET /api/v1/products/{product_slug}/levers/{slug}

Get Product Lever

Description

Get the product lever for given product and lever slugs in the current organization. Organization is determined by the Planship API auth token.

Input parameters

Parameter In Type Default Nullable Description
oAuth2ClientCredentials header string N/A No
product_slug path string No
slug path string No

Response 200 OK

{
    "slug": "string",
    "id": "510d4eec-ca2c-4101-8ccd-3d9351fe9955",
    "display_order": 0,
    "display_name": "string",
    "display_description": "string",
    "display_extra_attributes": {},
    "configuration": {},
    "description": "string",
    "name": "string",
    "entitlement_display_value_template": "string",
    "entitlement_display_name_template": "string",
    "entitlement_display_description_template": "string",
    "lever_type_id": "270e8523-a4ec-466d-a09e-cc77e10efd4b",
    "product_id": "7c642823-745e-41ce-821b-899d116a2b87",
    "metering_ids": [
        "string"
    ],
    "entitlement_schema_json": {}
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "title": "Lever",
    "required": [
        "slug",
        "id",
        "name",
        "lever_type_id",
        "product_id",
        "metering_ids"
    ],
    "type": "object",
    "properties": {
        "slug": {
            "title": "Slug",
            "type": "string"
        },
        "id": {
            "title": "Id",
            "type": "string",
            "format": "uuid"
        },
        "display_order": {
            "title": "Display Order",
            "type": "integer"
        },
        "display_name": {
            "title": "Display Name",
            "type": "string",
            "default": ""
        },
        "display_description": {
            "title": "Display Description",
            "type": "string",
            "default": ""
        },
        "display_extra_attributes": {
            "title": "Display Extra Attributes",
            "type": "object",
            "additionalProperties": {
                "type": "string"
            },
            "default": {}
        },
        "configuration": {
            "title": "Configuration",
            "type": "object"
        },
        "description": {
            "title": "Description",
            "type": "string",
            "default": ""
        },
        "name": {
            "title": "Name",
            "type": "string"
        },
        "entitlement_display_value_template": {
            "title": "Entitlement Display Value Template",
            "type": "string",
            "default": ""
        },
        "entitlement_display_name_template": {
            "title": "Entitlement Display Name Template",
            "type": "string",
            "default": ""
        },
        "entitlement_display_description_template": {
            "title": "Entitlement Display Description Template",
            "type": "string",
            "default": ""
        },
        "lever_type_id": {
            "title": "Lever Type Id",
            "type": "string",
            "format": "uuid"
        },
        "product_id": {
            "title": "Product Id",
            "type": "string",
            "format": "uuid"
        },
        "metering_ids": {
            "title": "Metering Ids",
            "type": "array",
            "items": {
                "type": "string"
            }
        },
        "entitlement_schema_json": {
            "title": "Entitlement Schema Json",
            "type": "object"
        }
    }
}

Response 422 Unprocessable Entity

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string"
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "title": "HTTPValidationError",
    "type": "object",
    "properties": {
        "detail": {
            "title": "Detail",
            "type": "array",
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            }
        }
    }
}

GET /api/v1/products/{slug}/plans

List Product Plans

Description

List all plans for the product with a given slug in the current organization. Organization is determined by the Planship API auth token.

Input parameters

Parameter In Type Default Nullable Description
oAuth2ClientCredentials header string N/A No
order_by query string No
public_only query boolean False No
slug path string No

Response 200 OK

[
    {
        "slug": "string",
        "name": "string",
        "description": "string",
        "order": 0
    }
]
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "title": "Response List Product Plans Api V1 Products  Slug  Plans Get",
    "type": "array",
    "items": {
        "$ref": "#/components/schemas/PlanInList"
    }
}

Response 422 Unprocessable Entity

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string"
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "title": "HTTPValidationError",
    "type": "object",
    "properties": {
        "detail": {
            "title": "Detail",
            "type": "array",
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            }
        }
    }
}

GET /api/v1/products/{product_slug}/plans/{slug}

Get Product Plan

Description

Get the product plan for given product and lever slugs in the current organization. Organization is determined by the Planship API auth token.

Input parameters

Parameter In Type Default Nullable Description
oAuth2ClientCredentials header string N/A No
product_slug path string No
slug path string No

Response 200 OK

{
    "slug": "string",
    "name": "string",
    "description": "string",
    "order": 0,
    "entitlements": [
        {
            "value": "string",
            "name": "string",
            "description": "string",
            "order": 0,
            "configuration": {}
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "title": "Plan",
    "required": [
        "slug",
        "name",
        "description",
        "entitlements"
    ],
    "type": "object",
    "properties": {
        "slug": {
            "title": "Slug",
            "type": "string"
        },
        "name": {
            "title": "Name",
            "type": "string",
            "description": "Plan name"
        },
        "description": {
            "title": "Description",
            "type": "string",
            "description": "Plan description"
        },
        "order": {
            "title": "Order",
            "type": "integer",
            "description": "Plan display order"
        },
        "entitlements": {
            "title": "Entitlements",
            "type": "array",
            "items": {
                "$ref": "#/components/schemas/PlanEntitlement"
            }
        }
    }
}

Response 422 Unprocessable Entity

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string"
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "title": "HTTPValidationError",
    "type": "object",
    "properties": {
        "detail": {
            "title": "Detail",
            "type": "array",
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            }
        }
    }
}

GET /api/v1/products/{product_slug}/plans/{slug}/entitlements

Get Product Plan Entitlements

Description

List all entitlements for the product plan with given product and plan slugs in the current organization. Organization is determined by the Planship API auth token.

Input parameters

Parameter In Type Default Nullable Description
oAuth2ClientCredentials header string N/A No
product_slug path string No
slug path string No

Response 200 OK

[
    {
        "id": "66bc483b-ece6-482d-abff-32359381beb9",
        "name": "string"
    }
]
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "title": "Response Get Product Plan Entitlements Api V1 Products  Product Slug  Plans  Slug  Entitlements Get",
    "type": "array",
    "items": {
        "$ref": "#/components/schemas/IdNameOrmBase"
    }
}

Response 422 Unprocessable Entity

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string"
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "title": "HTTPValidationError",
    "type": "object",
    "properties": {
        "detail": {
            "title": "Detail",
            "type": "array",
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            }
        }
    }
}

POST /api/v1/products/{product_slug}/plans/{slug}/subscriptions

Create Plan Subscription

Description

Create a subscription to the product plan with given product and plan slugs for the customer described in subscription_customer_in. Organization is determined by the Planship API auth token.

Input parameters

Parameter In Type Default Nullable Description
oAuth2ClientCredentials header string N/A No
product_slug path string No
slug path string No

Request body

{
    "metadata": {},
    "customer_id": "string",
    "is_subscriber": true,
    "max_subscribers": 0,
    "renew_at": "2022-04-13T15:42:05.901Z"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
    "title": "PlanSubscriptionCreate",
    "required": [
        "customer_id"
    ],
    "type": "object",
    "properties": {
        "metadata": {
            "title": "Metadata",
            "type": "object"
        },
        "customer_id": {
            "title": "Customer Id",
            "type": "string"
        },
        "is_subscriber": {
            "title": "Is Subscriber",
            "type": "boolean",
            "default": true
        },
        "max_subscribers": {
            "title": "Max Subscribers",
            "type": "integer",
            "default": 1
        },
        "renew_at": {
            "title": "Renew At",
            "type": "string",
            "format": "date-time"
        }
    }
}

Response 200 OK

{
    "id": "998aa9ca-0a1e-43a3-af8c-0941c5a364f4",
    "auto_renew": true,
    "is_active": true,
    "plan_id": "ce0801e6-887f-42f0-b240-1ee506fd1818",
    "renew_plan_id": "0e81f9c6-a985-48bd-acdc-22296872993e",
    "renew_at": "2022-04-13T15:42:05.901Z",
    "last_renewed_at": "2022-04-13T15:42:05.901Z",
    "max_subscribers": 0,
    "start_at": "2022-04-13T15:42:05.901Z",
    "plan": {
        "id": "67bf3561-1666-4a06-a738-89e56a1e4eff",
        "name": "string",
        "slug": "string"
    },
    "renew_plan": null
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "title": "SubscriptionWithPlan",
    "required": [
        "id",
        "auto_renew",
        "is_active",
        "plan_id",
        "renew_plan_id",
        "renew_at",
        "last_renewed_at",
        "max_subscribers",
        "start_at",
        "plan",
        "renew_plan"
    ],
    "type": "object",
    "properties": {
        "id": {
            "title": "Id",
            "type": "string",
            "format": "uuid"
        },
        "auto_renew": {
            "title": "Auto Renew",
            "type": "boolean"
        },
        "is_active": {
            "title": "Is Active",
            "type": "boolean"
        },
        "plan_id": {
            "title": "Plan Id",
            "type": "string",
            "format": "uuid"
        },
        "renew_plan_id": {
            "title": "Renew Plan Id",
            "type": "string",
            "format": "uuid"
        },
        "renew_at": {
            "title": "Renew At",
            "type": "string",
            "format": "date-time"
        },
        "last_renewed_at": {
            "title": "Last Renewed At",
            "type": "string",
            "format": "date-time"
        },
        "max_subscribers": {
            "title": "Max Subscribers",
            "type": "integer"
        },
        "start_at": {
            "title": "Start At",
            "type": "string",
            "format": "date-time"
        },
        "plan": {
            "$ref": "#/components/schemas/IdNameSlugOrmBase"
        },
        "renew_plan": {
            "$ref": "#/components/schemas/IdNameSlugOrmBase"
        }
    }
}

Response 422 Unprocessable Entity

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string"
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "title": "HTTPValidationError",
    "type": "object",
    "properties": {
        "detail": {
            "title": "Detail",
            "type": "array",
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            }
        }
    }
}

public


GET /api/v1/public/{organization_slug}/{product_slug}/plans

List Public Plans

Input parameters

Parameter In Type Default Nullable Description
organization_slug path string No
product_slug path string No

Response 200 OK

[
    {
        "slug": "string",
        "name": "string",
        "description": "string",
        "order": 0
    }
]
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "title": "Response List Public Plans Api V1 Public  Organization Slug   Product Slug  Plans Get",
    "type": "array",
    "items": {
        "$ref": "#/components/schemas/PlanInList"
    }
}

Response 422 Unprocessable Entity

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string"
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "title": "HTTPValidationError",
    "type": "object",
    "properties": {
        "detail": {
            "title": "Detail",
            "type": "array",
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            }
        }
    }
}

GET /api/v1/public/{organization_slug}/{product_slug}/plans/{plan_slug}

Get Public Plan

Input parameters

Parameter In Type Default Nullable Description
organization_slug path string No
plan_slug path string No
product_slug path string No

Response 200 OK

{
    "slug": "string",
    "name": "string",
    "description": "string",
    "order": 0,
    "entitlements": [
        {
            "value": "string",
            "name": "string",
            "description": "string",
            "order": 0,
            "configuration": {}
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "title": "Plan",
    "required": [
        "slug",
        "name",
        "description",
        "entitlements"
    ],
    "type": "object",
    "properties": {
        "slug": {
            "title": "Slug",
            "type": "string"
        },
        "name": {
            "title": "Name",
            "type": "string",
            "description": "Plan name"
        },
        "description": {
            "title": "Description",
            "type": "string",
            "description": "Plan description"
        },
        "order": {
            "title": "Order",
            "type": "integer",
            "description": "Plan display order"
        },
        "entitlements": {
            "title": "Entitlements",
            "type": "array",
            "items": {
                "$ref": "#/components/schemas/PlanEntitlement"
            }
        }
    }
}

Response 422 Unprocessable Entity

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string"
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "title": "HTTPValidationError",
    "type": "object",
    "properties": {
        "detail": {
            "title": "Detail",
            "type": "array",
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            }
        }
    }
}

customers


POST /api/v1/customers

Create Customer

Description

Create a new customer in the current organization.

Input parameters

Parameter In Type Default Nullable Description
oAuth2ClientCredentials header string N/A No

Request body

{
    "metadata": {},
    "name": "string",
    "email": "string",
    "alternative_id": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
    "title": "OrganizationCustomerCreate",
    "type": "object",
    "properties": {
        "metadata": {
            "title": "Metadata",
            "type": "object"
        },
        "name": {
            "title": "Name",
            "type": "string",
            "default": ""
        },
        "email": {
            "title": "Email",
            "type": "string",
            "default": ""
        },
        "alternative_id": {
            "title": "Alternative Id",
            "type": "string"
        }
    }
}

Response 200 OK

{
    "id": "2d3449a0-2ebc-4970-82a5-96d73518e600",
    "metadata_": {},
    "name": "string",
    "email": "string",
    "alternative_id": "string",
    "organization_id": "8ecc57c3-1068-433d-b4c7-9713d3266e47",
    "subscriptions": [
        {
            "metadata_": {},
            "is_administrator": true,
            "is_subscriber": true,
            "customer_id": "6993d1e2-25ec-4f2d-90ea-57f098edcff9",
            "subscription_id": "a0a18222-5863-4b5f-99b1-9add97d5630c",
            "plan": {
                "slug": "string",
                "display_order": 0,
                "display_name": "string",
                "display_description": "string",
                "display_extra_attributes": {},
                "description": "string",
                "name": "string",
                "max_subscribers": 0,
                "is_self_serve": true,
                "is_public": true,
                "auto_renew": true,
                "duration_period": 0,
                "duration_unit": null,
                "id": "3951f7fd-553e-4830-9e25-763ba6899f8a"
            }
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "title": "Customer",
    "required": [
        "id",
        "organization_id",
        "subscriptions"
    ],
    "type": "object",
    "properties": {
        "id": {
            "title": "Id",
            "type": "string",
            "format": "uuid"
        },
        "metadata_": {
            "title": "Metadata ",
            "type": "object"
        },
        "name": {
            "title": "Name",
            "type": "string",
            "default": ""
        },
        "email": {
            "title": "Email",
            "type": "string",
            "default": ""
        },
        "alternative_id": {
            "title": "Alternative Id",
            "type": "string"
        },
        "organization_id": {
            "title": "Organization Id",
            "type": "string",
            "format": "uuid"
        },
        "subscriptions": {
            "title": "Subscriptions",
            "type": "array",
            "items": {
                "$ref": "#/components/schemas/SubscriptionCustomer"
            }
        }
    }
}

Response 422 Unprocessable Entity

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string"
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "title": "HTTPValidationError",
    "type": "object",
    "properties": {
        "detail": {
            "title": "Detail",
            "type": "array",
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            }
        }
    }
}

DELETE /api/v1/customers/{customer_id}

Delete Customer

Description

Delete the customer with a given id from the current organization.

Input parameters

Parameter In Type Default Nullable Description
oAuth2ClientCredentials header string N/A No
customer_id path string No

Response 200 OK

{
    "id": "adf67b37-040d-4f58-86b4-f56dda181891",
    "metadata_": {},
    "name": "string",
    "email": "string",
    "alternative_id": "string",
    "organization_id": "47412f7d-7a8c-4905-b86d-afa5dbb67387"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "title": "CustomerInDbBase",
    "required": [
        "id",
        "organization_id"
    ],
    "type": "object",
    "properties": {
        "id": {
            "title": "Id",
            "type": "string",
            "format": "uuid"
        },
        "metadata_": {
            "title": "Metadata ",
            "type": "object"
        },
        "name": {
            "title": "Name",
            "type": "string",
            "default": ""
        },
        "email": {
            "title": "Email",
            "type": "string",
            "default": ""
        },
        "alternative_id": {
            "title": "Alternative Id",
            "type": "string"
        },
        "organization_id": {
            "title": "Organization Id",
            "type": "string",
            "format": "uuid"
        }
    }
}

Response 422 Unprocessable Entity

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string"
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "title": "HTTPValidationError",
    "type": "object",
    "properties": {
        "detail": {
            "title": "Detail",
            "type": "array",
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            }
        }
    }
}

customer_subscriptions


GET /api/v1/customers/{customer_id}/subscriptions

List Customer Plan Subscriptions

Input parameters

Parameter In Type Default Nullable Description
oAuth2ClientCredentials header string N/A No
customer_id path string No

Response 200 OK

[
    {
        "metadata_": {},
        "is_administrator": true,
        "is_subscriber": true,
        "customer_id": "a6ef4ec9-bd27-41ff-b2b9-5c47fffea7bc",
        "subscription_id": "903f3e38-0f4b-4f9c-bb80-0c98c735fa5d",
        "max_subscribers": 0,
        "auto_renew": true,
        "is_active": true,
        "renew_at": "2022-04-13T15:42:05.901Z",
        "last_renewed_at": "2022-04-13T15:42:05.901Z",
        "plan": {
            "id": "05909332-fcb4-4058-8a24-5a09c825f02d",
            "name": "string",
            "slug": "string"
        },
        "renew_plan": null
    }
]
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "title": "Response List Customer Plan Subscriptions Api V1 Customers  Customer Id  Subscriptions Get",
    "type": "array",
    "items": {
        "$ref": "#/components/schemas/CustomerSubscriptionWithPlan"
    }
}

Response 422 Unprocessable Entity

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string"
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "title": "HTTPValidationError",
    "type": "object",
    "properties": {
        "detail": {
            "title": "Detail",
            "type": "array",
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            }
        }
    }
}

POST /api/v1/customers/{customer_id}/subscriptions

Create Plan Subscription For Customer

Input parameters

Parameter In Type Default Nullable Description
oAuth2ClientCredentials header string N/A No
customer_id path string No

Request body

{
    "auto_renew": true,
    "is_active": true,
    "plan_id": "0c01848c-172a-4bc9-882f-354427c20749",
    "renew_plan_id": "229055fe-0583-48c3-8a82-41adcdc4dcff",
    "renew_at": "2022-04-13T15:42:05.901Z",
    "last_renewed_at": "2022-04-13T15:42:05.901Z",
    "max_subscribers": 0,
    "start_at": "2022-04-13T15:42:05.901Z"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
    "title": "SubscriptionCreate",
    "required": [
        "auto_renew",
        "is_active",
        "plan_id",
        "renew_plan_id",
        "renew_at",
        "last_renewed_at",
        "start_at"
    ],
    "type": "object",
    "properties": {
        "auto_renew": {
            "title": "Auto Renew",
            "type": "boolean"
        },
        "is_active": {
            "title": "Is Active",
            "type": "boolean"
        },
        "plan_id": {
            "title": "Plan Id",
            "type": "string",
            "format": "uuid"
        },
        "renew_plan_id": {
            "title": "Renew Plan Id",
            "type": "string",
            "format": "uuid"
        },
        "renew_at": {
            "title": "Renew At",
            "type": "string",
            "format": "date-time"
        },
        "last_renewed_at": {
            "title": "Last Renewed At",
            "type": "string",
            "format": "date-time"
        },
        "max_subscribers": {
            "title": "Max Subscribers",
            "type": "integer",
            "default": 1
        },
        "start_at": {
            "title": "Start At",
            "type": "string",
            "format": "date-time"
        }
    }
}

Response 200 OK

{
    "id": "53741c2d-f4ad-41ee-a3b3-ab2e041ac4aa",
    "auto_renew": true,
    "is_active": true,
    "plan_id": "642d4c36-9336-4c65-a33d-9d5ddf3508b1",
    "renew_plan_id": "f7f17735-d496-4a4b-a18d-3c582959b08d",
    "renew_at": "2022-04-13T15:42:05.901Z",
    "last_renewed_at": "2022-04-13T15:42:05.901Z",
    "max_subscribers": 0,
    "start_at": "2022-04-13T15:42:05.901Z",
    "plan": {
        "id": "b40c4d1b-bc96-4895-aee1-2a18c01df657",
        "name": "string",
        "slug": "string"
    },
    "renew_plan": null
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "title": "SubscriptionWithPlan",
    "required": [
        "id",
        "auto_renew",
        "is_active",
        "plan_id",
        "renew_plan_id",
        "renew_at",
        "last_renewed_at",
        "max_subscribers",
        "start_at",
        "plan",
        "renew_plan"
    ],
    "type": "object",
    "properties": {
        "id": {
            "title": "Id",
            "type": "string",
            "format": "uuid"
        },
        "auto_renew": {
            "title": "Auto Renew",
            "type": "boolean"
        },
        "is_active": {
            "title": "Is Active",
            "type": "boolean"
        },
        "plan_id": {
            "title": "Plan Id",
            "type": "string",
            "format": "uuid"
        },
        "renew_plan_id": {
            "title": "Renew Plan Id",
            "type": "string",
            "format": "uuid"
        },
        "renew_at": {
            "title": "Renew At",
            "type": "string",
            "format": "date-time"
        },
        "last_renewed_at": {
            "title": "Last Renewed At",
            "type": "string",
            "format": "date-time"
        },
        "max_subscribers": {
            "title": "Max Subscribers",
            "type": "integer"
        },
        "start_at": {
            "title": "Start At",
            "type": "string",
            "format": "date-time"
        },
        "plan": {
            "$ref": "#/components/schemas/IdNameSlugOrmBase"
        },
        "renew_plan": {
            "$ref": "#/components/schemas/IdNameSlugOrmBase"
        }
    }
}

Response 422 Unprocessable Entity

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string"
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "title": "HTTPValidationError",
    "type": "object",
    "properties": {
        "detail": {
            "title": "Detail",
            "type": "array",
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            }
        }
    }
}

GET /api/v1/customers/{customer_id}/subscriptions/{subscription_id}

Get Customer Plan Subscription

Input parameters

Parameter In Type Default Nullable Description
oAuth2ClientCredentials header string N/A No
customer_id path string No
subscription_id path string No

Response 200 OK

{
    "metadata_": {},
    "is_administrator": true,
    "is_subscriber": true,
    "customer_id": "178abdc5-da36-4aba-9b56-806bc0e6b872",
    "subscription_id": "c417e19f-2d48-40ec-9ed1-c21d3555bf2e",
    "max_subscribers": 0,
    "auto_renew": true,
    "is_active": true,
    "renew_at": "2022-04-13T15:42:05.901Z",
    "last_renewed_at": "2022-04-13T15:42:05.901Z",
    "plan": {
        "id": "755bcc94-97dc-4300-825c-0ccaa9bffebe",
        "name": "string",
        "slug": "string"
    },
    "renew_plan": null
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "title": "CustomerSubscriptionWithPlan",
    "required": [
        "customer_id",
        "subscription_id",
        "auto_renew",
        "is_active",
        "renew_at",
        "last_renewed_at",
        "plan",
        "renew_plan"
    ],
    "type": "object",
    "properties": {
        "metadata_": {
            "title": "Metadata ",
            "type": "object"
        },
        "is_administrator": {
            "title": "Is Administrator",
            "type": "boolean",
            "default": false
        },
        "is_subscriber": {
            "title": "Is Subscriber",
            "type": "boolean",
            "default": true
        },
        "customer_id": {
            "title": "Customer Id",
            "type": "string",
            "format": "uuid"
        },
        "subscription_id": {
            "title": "Subscription Id",
            "type": "string",
            "format": "uuid"
        },
        "max_subscribers": {
            "title": "Max Subscribers",
            "type": "integer",
            "default": 1
        },
        "auto_renew": {
            "title": "Auto Renew",
            "type": "boolean"
        },
        "is_active": {
            "title": "Is Active",
            "type": "boolean"
        },
        "renew_at": {
            "title": "Renew At",
            "type": "string",
            "format": "date-time"
        },
        "last_renewed_at": {
            "title": "Last Renewed At",
            "type": "string",
            "format": "date-time"
        },
        "plan": {
            "$ref": "#/components/schemas/IdNameSlugOrmBase"
        },
        "renew_plan": {
            "$ref": "#/components/schemas/IdNameSlugOrmBase"
        }
    }
}

Response 422 Unprocessable Entity

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string"
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "title": "HTTPValidationError",
    "type": "object",
    "properties": {
        "detail": {
            "title": "Detail",
            "type": "array",
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            }
        }
    }
}

PATCH /api/v1/customers/{customer_id}/subscriptions/{subscription_id}

Modify Customer Plan Subscription

Input parameters

Parameter In Type Default Nullable Description
oAuth2ClientCredentials header string N/A No
customer_id path string No
subscription_id path string No

Request body

{
    "plan_id": "e3f7a32c-616c-4ddc-98f0-a596dac6f71a",
    "renew_plan_id": "bfe0be51-68d4-457c-9b94-90a16a428fd5",
    "plan_slug": "string",
    "renew_plan_slug": "string",
    "max_subscribers": 0,
    "is_active": true
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
    "title": "SubscriptionUpdateWithSlugs",
    "type": "object",
    "properties": {
        "plan_id": {
            "title": "Plan Id",
            "type": "string",
            "format": "uuid"
        },
        "renew_plan_id": {
            "title": "Renew Plan Id",
            "type": "string",
            "format": "uuid"
        },
        "plan_slug": {
            "title": "Plan Slug",
            "type": "string"
        },
        "renew_plan_slug": {
            "title": "Renew Plan Slug",
            "type": "string"
        },
        "max_subscribers": {
            "title": "Max Subscribers",
            "type": "integer",
            "default": 1
        },
        "is_active": {
            "title": "Is Active",
            "type": "boolean",
            "default": true
        }
    }
}

Response 200 OK

{
    "metadata_": {},
    "is_administrator": true,
    "is_subscriber": true,
    "customer_id": "81e3a809-b812-45bb-abac-b1c500bae5c4",
    "subscription_id": "feecf7c2-83f3-4570-9946-01fdbffdb816",
    "max_subscribers": 0,
    "auto_renew": true,
    "is_active": true,
    "renew_at": "2022-04-13T15:42:05.901Z",
    "last_renewed_at": "2022-04-13T15:42:05.901Z",
    "plan": {
        "id": "c75a2dab-8a37-44a1-920d-fbfee3493e01",
        "name": "string",
        "slug": "string"
    },
    "renew_plan": null
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "title": "CustomerSubscriptionWithPlan",
    "required": [
        "customer_id",
        "subscription_id",
        "auto_renew",
        "is_active",
        "renew_at",
        "last_renewed_at",
        "plan",
        "renew_plan"
    ],
    "type": "object",
    "properties": {
        "metadata_": {
            "title": "Metadata ",
            "type": "object"
        },
        "is_administrator": {
            "title": "Is Administrator",
            "type": "boolean",
            "default": false
        },
        "is_subscriber": {
            "title": "Is Subscriber",
            "type": "boolean",
            "default": true
        },
        "customer_id": {
            "title": "Customer Id",
            "type": "string",
            "format": "uuid"
        },
        "subscription_id": {
            "title": "Subscription Id",
            "type": "string",
            "format": "uuid"
        },
        "max_subscribers": {
            "title": "Max Subscribers",
            "type": "integer",
            "default": 1
        },
        "auto_renew": {
            "title": "Auto Renew",
            "type": "boolean"
        },
        "is_active": {
            "title": "Is Active",
            "type": "boolean"
        },
        "renew_at": {
            "title": "Renew At",
            "type": "string",
            "format": "date-time"
        },
        "last_renewed_at": {
            "title": "Last Renewed At",
            "type": "string",
            "format": "date-time"
        },
        "plan": {
            "$ref": "#/components/schemas/IdNameSlugOrmBase"
        },
        "renew_plan": {
            "$ref": "#/components/schemas/IdNameSlugOrmBase"
        }
    }
}

Response 422 Unprocessable Entity

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string"
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "title": "HTTPValidationError",
    "type": "object",
    "properties": {
        "detail": {
            "title": "Detail",
            "type": "array",
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            }
        }
    }
}

subscription_customers


GET /api/v1/customers/{customer_id}/subscriptions/{subscription_id}/customers

List Subscription Customers

Input parameters

Parameter In Type Default Nullable Description
oAuth2ClientCredentials header string N/A No
customer_id path string No
subscription_id path string No

Response 200 OK

[
    {
        "metadata_": {},
        "is_administrator": true,
        "is_subscriber": true,
        "customer_id": "2530d570-01ad-4cfd-98c7-31de76625302",
        "subscription_id": "0ad17a10-cf6e-430f-93f4-5db19d390f7a",
        "plan": {
            "slug": "string",
            "display_order": 0,
            "display_name": "string",
            "display_description": "string",
            "display_extra_attributes": {},
            "description": "string",
            "name": "string",
            "max_subscribers": 0,
            "is_self_serve": true,
            "is_public": true,
            "auto_renew": true,
            "duration_period": 0,
            "duration_unit": null,
            "id": "b7d85049-59a5-4186-9ebe-38b2019d6482"
        }
    }
]
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "title": "Response List Subscription Customers Api V1 Customers  Customer Id  Subscriptions  Subscription Id  Customers Get",
    "type": "array",
    "items": {
        "$ref": "#/components/schemas/SubscriptionCustomer"
    }
}

Response 422 Unprocessable Entity

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string"
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "title": "HTTPValidationError",
    "type": "object",
    "properties": {
        "detail": {
            "title": "Detail",
            "type": "array",
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            }
        }
    }
}

POST /api/v1/customers/{customer_id}/subscriptions/{subscription_id}/customers

Add Customer To Subscription

Input parameters

Parameter In Type Default Nullable Description
oAuth2ClientCredentials header string N/A No
customer_id path string No
subscription_id path string No

Request body

{
    "metadata": {},
    "is_administrator": true,
    "is_subscriber": true,
    "customer_id": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
    "title": "SubscriptionCustomerAdd",
    "required": [
        "customer_id"
    ],
    "type": "object",
    "properties": {
        "metadata": {
            "title": "Metadata",
            "type": "object"
        },
        "is_administrator": {
            "title": "Is Administrator",
            "type": "boolean",
            "default": false
        },
        "is_subscriber": {
            "title": "Is Subscriber",
            "type": "boolean",
            "default": true
        },
        "customer_id": {
            "title": "Customer Id",
            "type": "string"
        }
    }
}

Response 200 OK

{
    "metadata_": {},
    "is_administrator": true,
    "is_subscriber": true,
    "customer_id": "e3d320b5-300a-41f0-81a3-a4ce9fe2f0f7",
    "subscription_id": "9a6ce6e6-8e3d-4d4e-921b-81c10dd4cb7c",
    "plan": {
        "slug": "string",
        "display_order": 0,
        "display_name": "string",
        "display_description": "string",
        "display_extra_attributes": {},
        "description": "string",
        "name": "string",
        "max_subscribers": 0,
        "is_self_serve": true,
        "is_public": true,
        "auto_renew": true,
        "duration_period": 0,
        "duration_unit": null,
        "id": "8a46a1e1-a70a-42bb-97ce-6e137cc4a57a"
    }
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "title": "SubscriptionCustomer",
    "required": [
        "customer_id",
        "subscription_id",
        "plan"
    ],
    "type": "object",
    "properties": {
        "metadata_": {
            "title": "Metadata ",
            "type": "object"
        },
        "is_administrator": {
            "title": "Is Administrator",
            "type": "boolean",
            "default": false
        },
        "is_subscriber": {
            "title": "Is Subscriber",
            "type": "boolean",
            "default": true
        },
        "customer_id": {
            "title": "Customer Id",
            "type": "string",
            "format": "uuid"
        },
        "subscription_id": {
            "title": "Subscription Id",
            "type": "string",
            "format": "uuid"
        },
        "plan": {
            "$ref": "#/components/schemas/PlanInDbBase"
        }
    }
}

Response 422 Unprocessable Entity

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string"
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "title": "HTTPValidationError",
    "type": "object",
    "properties": {
        "detail": {
            "title": "Detail",
            "type": "array",
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            }
        }
    }
}

DELETE /api/v1/customers/{customer_id}/subscriptions/{subscription_id}/customers/{id}

Remove Customer From Subscription

Input parameters

Parameter In Type Default Nullable Description
oAuth2ClientCredentials header string N/A No
customer_id path string No
id path string No
subscription_id path string No

Response 200 OK

{
    "metadata_": {},
    "is_administrator": true,
    "is_subscriber": true,
    "customer_id": "ceabc7c0-6b11-46fd-a2aa-b4d9316daf6f",
    "subscription_id": "4b65c33e-dd83-45db-967a-10fce8c7628b"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "title": "SubscriptionCustomerInDbBase",
    "required": [
        "customer_id",
        "subscription_id"
    ],
    "type": "object",
    "properties": {
        "metadata_": {
            "title": "Metadata ",
            "type": "object"
        },
        "is_administrator": {
            "title": "Is Administrator",
            "type": "boolean",
            "default": false
        },
        "is_subscriber": {
            "title": "Is Subscriber",
            "type": "boolean",
            "default": true
        },
        "customer_id": {
            "title": "Customer Id",
            "type": "string",
            "format": "uuid"
        },
        "subscription_id": {
            "title": "Subscription Id",
            "type": "string",
            "format": "uuid"
        }
    }
}

Response 422 Unprocessable Entity

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string"
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "title": "HTTPValidationError",
    "type": "object",
    "properties": {
        "detail": {
            "title": "Detail",
            "type": "array",
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            }
        }
    }
}

entitlements


GET /api/v1/customers/{customer_id}/products/{product_slug}/entitlements

Get Product Entitlements For Customer

Description

List all entitlements for the customer with a given id and the product with a given slug. Entitlements are returned as a dictionary keyed by lever slugs.

Input parameters

Parameter In Type Default Nullable Description
oAuth2ClientCredentials header string N/A No
customer_id path string No
product_slug path string No

Response 200 OK

Schema of the response body
{
    "title": "EntitlementsResponseSchema",
    "type": "object",
    "properties": {}
}

Response 422 Unprocessable Entity

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string"
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "title": "HTTPValidationError",
    "type": "object",
    "properties": {
        "detail": {
            "title": "Detail",
            "type": "array",
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            }
        }
    }
}

metered_usage


GET /api/v1/customers/{customer_id}/products/{product_slug}/usage/{metering_id}

Get Metering Id Levers Usage For Customer

Input parameters

Parameter In Type Default Nullable Description
oAuth2ClientCredentials header string N/A No
customer_id path string No
metering_id path string No
product_slug path string No

Response 200 OK

Schema of the response body
{
    "title": "Response Get Metering Id Levers Usage For Customer Api V1 Customers  Customer Id  Products  Product Slug  Usage  Metering Id  Get",
    "type": "object",
    "additionalProperties": {
        "$ref": "#/components/schemas/LeverUsage"
    }
}

Response 422 Unprocessable Entity

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string"
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "title": "HTTPValidationError",
    "type": "object",
    "properties": {
        "detail": {
            "title": "Detail",
            "type": "array",
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            }
        }
    }
}

POST /api/v1/customers/{customer_id}/products/{product_slug}/usage/{metering_id}

Report Metered Usage For Customer

Input parameters

Parameter In Type Default Nullable Description
oAuth2ClientCredentials header string N/A No
customer_id path string No
metering_id path string No
product_slug path string No

Request body

{
    "usage": 0,
    "subscription_id": "a3324a69-ab33-47d3-999a-4fe4de347fac",
    "bucket": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
    "title": "MeteredUsageIn",
    "required": [
        "usage"
    ],
    "type": "object",
    "properties": {
        "usage": {
            "title": "Usage",
            "type": "integer"
        },
        "subscription_id": {
            "title": "Subscription Id",
            "type": "string",
            "format": "uuid"
        },
        "bucket": {
            "title": "Bucket",
            "type": "string"
        }
    }
}

Response 200 OK

{
    "id": "a3d01d38-820f-4041-ae66-dabc66c5842b",
    "is_allocated": true,
    "usage": 0,
    "metering_id": "string",
    "customer_id": "73acad43-aa72-45ac-9198-e37e4c116be7",
    "product_id": "f4fc2979-9e41-4063-af4a-68e4d5683b54",
    "subscription_id": "b446899f-f13c-4247-b4e5-9cf34d985747",
    "bucket": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "title": "MeteringRecord",
    "required": [
        "id",
        "usage",
        "metering_id",
        "customer_id",
        "product_id"
    ],
    "type": "object",
    "properties": {
        "id": {
            "title": "Id",
            "type": "string",
            "format": "uuid"
        },
        "is_allocated": {
            "title": "Is Allocated",
            "type": "boolean",
            "default": false
        },
        "usage": {
            "title": "Usage",
            "type": "integer"
        },
        "metering_id": {
            "title": "Metering Id",
            "type": "string"
        },
        "customer_id": {
            "title": "Customer Id",
            "type": "string",
            "format": "uuid"
        },
        "product_id": {
            "title": "Product Id",
            "type": "string",
            "format": "uuid"
        },
        "subscription_id": {
            "title": "Subscription Id",
            "type": "string",
            "format": "uuid"
        },
        "bucket": {
            "title": "Bucket",
            "type": "string"
        }
    }
}

Response 422 Unprocessable Entity

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string"
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "title": "HTTPValidationError",
    "type": "object",
    "properties": {
        "detail": {
            "title": "Detail",
            "type": "array",
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            }
        }
    }
}

GET /api/v1/customers/{customer_id}/products/{product_slug}/levers/{lever_slug}/usage

Get Lever Usage For Customer

Input parameters

Parameter In Type Default Nullable Description
oAuth2ClientCredentials header string N/A No
customer_id path string No
lever_slug path string No
product_slug path string No

Response 200 OK

{
    "total": 0,
    "by_bucket": {},
    "by_subscription": {}
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "title": "LeverUsage",
    "required": [
        "total",
        "by_bucket",
        "by_subscription"
    ],
    "type": "object",
    "properties": {
        "total": {
            "title": "Total",
            "type": "integer"
        },
        "by_bucket": {
            "title": "By Bucket",
            "type": "object",
            "additionalProperties": {
                "type": "integer"
            }
        },
        "by_subscription": {
            "title": "By Subscription",
            "type": "object",
            "additionalProperties": {
                "type": "array",
                "items": {
                    "$ref": "#/components/schemas/BucketUsage"
                }
            }
        }
    }
}

Response 422 Unprocessable Entity

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string"
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "title": "HTTPValidationError",
    "type": "object",
    "properties": {
        "detail": {
            "title": "Detail",
            "type": "array",
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            }
        }
    }
}

subscriptions


POST /api/v1/subscriptions/{subscription_id}/renewals

Force Renew Subscription

Input parameters

Parameter In Type Default Nullable Description
oAuth2ClientCredentials header string N/A No
subscription_id path string No

Response 200 OK

{
    "id": "c236cff0-a25c-49b4-807f-5fbd1a05067d",
    "auto_renew": true,
    "is_active": true,
    "plan_id": "7cf2c52c-3c4e-4f9f-a590-99c1d5f1a9e4",
    "renew_plan_id": "7ae8df3a-20e4-4427-a64b-0a9b4379bc8f",
    "renew_at": "2022-04-13T15:42:05.901Z",
    "last_renewed_at": "2022-04-13T15:42:05.901Z",
    "max_subscribers": 0,
    "start_at": "2022-04-13T15:42:05.901Z",
    "plan": {
        "id": "1d05064f-2adc-42cd-b2af-e687d6554a83",
        "name": "string",
        "slug": "string"
    },
    "renew_plan": null
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "title": "SubscriptionWithPlan",
    "required": [
        "id",
        "auto_renew",
        "is_active",
        "plan_id",
        "renew_plan_id",
        "renew_at",
        "last_renewed_at",
        "max_subscribers",
        "start_at",
        "plan",
        "renew_plan"
    ],
    "type": "object",
    "properties": {
        "id": {
            "title": "Id",
            "type": "string",
            "format": "uuid"
        },
        "auto_renew": {
            "title": "Auto Renew",
            "type": "boolean"
        },
        "is_active": {
            "title": "Is Active",
            "type": "boolean"
        },
        "plan_id": {
            "title": "Plan Id",
            "type": "string",
            "format": "uuid"
        },
        "renew_plan_id": {
            "title": "Renew Plan Id",
            "type": "string",
            "format": "uuid"
        },
        "renew_at": {
            "title": "Renew At",
            "type": "string",
            "format": "date-time"
        },
        "last_renewed_at": {
            "title": "Last Renewed At",
            "type": "string",
            "format": "date-time"
        },
        "max_subscribers": {
            "title": "Max Subscribers",
            "type": "integer"
        },
        "start_at": {
            "title": "Start At",
            "type": "string",
            "format": "date-time"
        },
        "plan": {
            "$ref": "#/components/schemas/IdNameSlugOrmBase"
        },
        "renew_plan": {
            "$ref": "#/components/schemas/IdNameSlugOrmBase"
        }
    }
}

Response 422 Unprocessable Entity

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string"
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "title": "HTTPValidationError",
    "type": "object",
    "properties": {
        "detail": {
            "title": "Detail",
            "type": "array",
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            }
        }
    }
}

Schemas

BucketUsage

Name Type
bucket string
usage integer

Customer

Name Type
alternative_id string
email string
id string(uuid)
metadata_
name string
organization_id string(uuid)
subscriptions Array<SubscriptionCustomer>

CustomerInDbBase

Name Type
alternative_id string
email string
id string(uuid)
metadata_
name string
organization_id string(uuid)

CustomerSubscriptionWithPlan

Name Type
auto_renew boolean
customer_id string(uuid)
is_active boolean
is_administrator boolean
is_subscriber boolean
last_renewed_at string(date-time)
max_subscribers integer
metadata_
plan IdNameSlugOrmBase
renew_at string(date-time)
renew_plan IdNameSlugOrmBase
subscription_id string(uuid)

EntitlementsResponseSchema

HTTPValidationError

Name Type
detail Array<ValidationError>

IdNameOrmBase

Name Type
id string(uuid)
name string

IdNameSlugOrmBase

Name Type
id string(uuid)
name string
slug string

Lever

Name Type
configuration
description string
display_description string
display_extra_attributes
display_name string
display_order integer
entitlement_display_description_template string
entitlement_display_name_template string
entitlement_display_value_template string
entitlement_schema_json
id string(uuid)
lever_type_id string(uuid)
metering_ids Array<string>
name string
product_id string(uuid)
slug string

LeverUsage

Name Type
by_bucket
by_subscription
total integer

MeteredUsageIn

Name Type
bucket string
subscription_id string(uuid)
usage integer

MeteringRecord

Name Type
bucket string
customer_id string(uuid)
id string(uuid)
is_allocated boolean
metering_id string
product_id string(uuid)
subscription_id string(uuid)
usage integer

OrganizationCustomerCreate

Name Type
alternative_id string
email string
metadata
name string

Plan

Name Type
description string
entitlements Array<PlanEntitlement>
name string
order integer
slug string

PlanEntitlement

Name Type
configuration
description string
name string
order integer
value string

PlanInDbBase

Name Type
auto_renew boolean
description string
display_description string
display_extra_attributes
display_name string
display_order integer
duration_period integer
duration_unit
id string(uuid)
is_public boolean
is_self_serve boolean
max_subscribers integer
name string
slug string

PlanInList

Name Type
description string
name string
order integer
slug string

PlanSubscriptionCreate

Name Type
customer_id string
is_subscriber boolean
max_subscribers integer
metadata
renew_at string(date-time)

Product

Name Type
description string
id string(uuid)
name string
organization_id string(uuid)
slug string

SubscriptionCreate

Name Type
auto_renew boolean
is_active boolean
last_renewed_at string(date-time)
max_subscribers integer
plan_id string(uuid)
renew_at string(date-time)
renew_plan_id string(uuid)
start_at string(date-time)

SubscriptionCustomer

Name Type
customer_id string(uuid)
is_administrator boolean
is_subscriber boolean
metadata_
plan PlanInDbBase
subscription_id string(uuid)

SubscriptionCustomerAdd

Name Type
customer_id string
is_administrator boolean
is_subscriber boolean
metadata

SubscriptionCustomerInDbBase

Name Type
customer_id string(uuid)
is_administrator boolean
is_subscriber boolean
metadata_
subscription_id string(uuid)

SubscriptionUpdateWithSlugs

Name Type
is_active boolean
max_subscribers integer
plan_id string(uuid)
plan_slug string
renew_plan_id string(uuid)
renew_plan_slug string

SubscriptionWithPlan

Name Type
auto_renew boolean
id string(uuid)
is_active boolean
last_renewed_at string(date-time)
max_subscribers integer
plan IdNameSlugOrmBase
plan_id string(uuid)
renew_at string(date-time)
renew_plan IdNameSlugOrmBase
renew_plan_id string(uuid)
start_at string(date-time)

TimeUnits

Type: string

TokenResponse

Name Type
access_token string
expires_in integer
token_type string

ValidationError

Name Type
loc Array<>
msg string
type string

Security schemes

Name Type Scheme Description
basic http http
oAuth2ClientCredentials oauth2