Planship API 0.1.1
health
GET /api/v1/health
Health
Description
Basic health check
Response 200 OK
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
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
Response 422 Unprocessable Entity
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": "98a8564d-978a-4f2e-be34-d20596b95156",
"slug": "string",
"id": "2554a861-9307-4c11-8f94-60452f0096d6"
}
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
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
Response 422 Unprocessable Entity
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": "768f3ba6-fb48-443f-93e4-675bb8239fcf",
"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": "bfb57781-3411-4d8c-a031-de2dead782d1",
"product_id": "3593d83d-527e-4b8d-b83c-c44dc6ee0d08",
"metering_ids": [
"string"
],
"entitlement_schema_json": {}
}
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
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
Response 422 Unprocessable Entity
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": {}
}
]
}
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
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
Response 422 Unprocessable Entity
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"
}
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": "e3935fa3-d117-418a-a6a4-1839d827c306",
"auto_renew": true,
"is_active": true,
"plan_id": "9e71655b-7d19-4017-b662-7b77d97da288",
"renew_plan_id": "9e6064de-043e-4509-8321-1d5ba3cde4d2",
"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": "cea8bb33-f480-4036-b543-c5f87bd3db45",
"name": "string",
"slug": "string"
},
"renew_plan": null
}
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
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
Response 422 Unprocessable Entity
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": {}
}
]
}
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
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
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": "46cad97d-2309-4c79-a52e-9fcb8cc6662a",
"metadata_": {},
"name": "string",
"email": "string",
"alternative_id": "string",
"organization_id": "2eb893bd-3281-4370-839b-39375e375d74",
"subscriptions": [
{
"metadata_": {},
"is_administrator": true,
"is_subscriber": true,
"customer_id": "eed40917-467f-419c-88c5-e4fb25973cfd",
"subscription_id": "6e2864e4-61e1-4570-9dde-c50b484d62e9",
"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": "a23ef7ae-af1f-4559-8aa3-e8158e6b30f5"
}
}
]
}
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
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": "76dd829d-19df-49d8-917c-30836888b1df",
"metadata_": {},
"name": "string",
"email": "string",
"alternative_id": "string",
"organization_id": "d01c8245-401d-4e2a-88fc-463a84aa9e0b"
}
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
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": "55988fd1-3453-43a3-ba34-7bee8e4f6d90",
"subscription_id": "32f2bc08-ff2c-44f1-a000-74e996dacd41",
"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": "80a38a68-9bfb-4395-a9dc-7031b94a56f5",
"name": "string",
"slug": "string"
},
"renew_plan": null
}
]
Response 422 Unprocessable Entity
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": "4ac61be8-44f1-445c-948c-e1b4da6efc1b",
"renew_plan_id": "1aa5c949-e12c-4ee2-a4a3-5560a1b7f58f",
"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"
}
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": "419f1c04-5258-46cd-bc36-8d86137eca7f",
"auto_renew": true,
"is_active": true,
"plan_id": "a8976bb7-af56-4af2-9823-9ded970aeb6f",
"renew_plan_id": "fbfe8d8b-cbcf-4171-93f6-df4437f1b00c",
"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": "a36329bc-da7f-43f5-9dbc-5b6cc24187b6",
"name": "string",
"slug": "string"
},
"renew_plan": null
}
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
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": "91d163a9-40f3-45c0-8d5f-f50964f726a2",
"subscription_id": "b02c3cdf-56f5-44d1-9a17-b32eb2714e2c",
"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": "46a7edf7-581c-42ef-ac5b-52c2ed6ea5df",
"name": "string",
"slug": "string"
},
"renew_plan": null
}
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
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": "6986cc1f-3b95-48a5-8115-5963475c8dc3",
"renew_plan_id": "f62eec07-ad1a-4e36-bb85-76a89ce29b13",
"plan_slug": "string",
"renew_plan_slug": "string",
"max_subscribers": 0,
"is_active": true
}
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": "8c017017-9922-4a4b-9507-ce7ab9a72ec9",
"subscription_id": "8595dd29-7a8f-46c1-976a-eec38c72068a",
"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": "3a80567e-6e15-4b05-b059-6c736bc3cfdd",
"name": "string",
"slug": "string"
},
"renew_plan": null
}
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
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": "c4c78b74-12d2-40f0-8fa6-f29e70dcd988",
"subscription_id": "ad114dfe-cafb-4c5d-81c6-07d9ca692ac2",
"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": "0d63fe85-b438-49f9-a688-74aac44f8b90"
}
}
]
Response 422 Unprocessable Entity
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
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": "68b11c4d-2ed0-4c25-9b4d-ec5ec7d08944",
"subscription_id": "74489f3d-ecb2-4c21-a31c-e77321d47d9e",
"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": "97e3e8c2-431c-4729-af7f-d3649dfbd09b"
}
}
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
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": "ed2d9638-6ba4-4e28-afad-69391bc280ef",
"subscription_id": "ce065f38-dd2b-47b9-ab0f-c019ae593688"
}
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
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
Response 422 Unprocessable Entity
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
Response 422 Unprocessable Entity
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
Schema of the request body
Response 200 OK
{
"id": "26bbfb35-f4d8-4b95-ac47-0a0349c8987e",
"is_allocated": true,
"usage": 0,
"metering_id": "string",
"customer_id": "96a7d340-a455-4405-959a-8898e85fc343",
"product_id": "bd5512ce-4ae1-4336-9889-37c387a05fb7",
"subscription_id": "4b84f1ea-13ff-4615-b0fe-b29e44943c3e",
"bucket": "string"
}
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
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
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
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": "7a23cdee-0693-4c72-aa6e-b36e920a0116",
"auto_renew": true,
"is_active": true,
"plan_id": "a0e733de-7585-4471-ad4f-b632d95dae6e",
"renew_plan_id": "d5d44b3e-7e29-4679-9670-06f0b29de0e3",
"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": "a62664fb-8dd4-45a5-9431-7407ff6975bd",
"name": "string",
"slug": "string"
},
"renew_plan": null
}
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
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 |