Get subscription

http
GET /accounts/{account_id}/subscription

Read the plan, billing cycle, seats and add-ons of an account before changing or cancelling its subscription; returns the subscription with its seat usage. Requires account.billing.read.

Servers

JSON
[  {    "url": "https://api.veryfront.com"  }]

Authentication

JSON
[  {    "bearerAuth": []  },  {    "apiKeyAuth": []  }]
JSON
{  "bearerAuth": {    "type": "http",    "scheme": "bearer",    "bearerFormat": "JWT or API Key",    "description": "Use a JWT bearer token or a Veryfront API key in the `Authorization` header."  },  "apiKeyAuth": {    "type": "apiKey",    "in": "header",    "name": "X-API-Key",    "description": "Alternative API key header for `vf_<prefix>_<secret>` tokens."  }}

Parameters

NameLocationRequiredDescription
account_idpathYes

Parameter contracts

JSON
[  {    "schema": {      "type": "string",      "format": "uuid"    },    "required": true,    "name": "account_id",    "in": "path"  }]

Responses

200

Account subscriptions, limits and the selected subscription

JSON
{  "description": "Account subscriptions, limits and the selected subscription",  "content": {    "application/json": {      "schema": {        "type": "object",        "properties": {          "id": {            "type": [              "string",              "null"            ],            "description": "Billing record ID. Null, or absent under external billing, when the account has no stored billing record."          },          "project_id": {            "type": [              "string",              "null"            ],            "description": "Project this subscription is scoped to, when applicable"          },          "line_items": {            "type": "array",            "items": {              "type": "object",              "properties": {                "kind": {                  "type": "string",                  "enum": [                    "plan",                    "seat",                    "server",                    "sandbox"                  ],                  "description": "Subscription line item kind"                },                "quantity": {                  "type": "number",                  "description": "Line item quantity"                },                "recurring_interval": {                  "type": [                    "string",                    "null"                  ],                  "enum": [                    "monthly",                    "yearly",                    null                  ],                  "description": "Line item billing interval when price-classifiable"                },                "unit_amount": {                  "type": [                    "number",                    "null"                  ],                  "description": "Line item unit amount in minor currency units"                },                "currency": {                  "type": [                    "string",                    "null"                  ],                  "description": "Line item currency"                }              },              "required": [                "kind",                "quantity"              ]            },            "description": "Subscription line items. Credits are one-time top-ups and are not included here."          },          "seat_usage": {            "type": [              "object",              "null"            ],            "properties": {              "purchased": {                "type": "integer",                "minimum": 0              },              "active": {                "type": "integer",                "minimum": 0              },              "reserved": {                "type": "integer",                "minimum": 0              },              "available": {                "type": "integer",                "minimum": 0              },              "over_capacity": {                "type": "boolean"              },              "used": {                "type": "integer",                "minimum": 0,                "description": "Seats in use: active plus reserved"              }            },            "required": [              "purchased",              "active",              "reserved",              "available",              "over_capacity"            ],            "description": "Seat usage that seat changes and invitations are checked against, served on every read, including an account without a stored billing record. Null only while the account still has subscriptions without an owning account (migration.legacy_subscriptions above 0)."          },          "status": {            "type": [              "string",              "null"            ],            "description": "Subscription status"          },          "current_period_start": {            "type": [              "string",              "null"            ],            "description": "Current billing period start timestamp"          },          "current_period_end": {            "type": [              "string",              "null"            ],            "description": "Current billing period end timestamp"          },          "expires_at": {            "type": [              "string",              "null"            ],            "description": "Subscription expiration timestamp"          },          "canceled_at": {            "type": [              "string",              "null"            ],            "description": "Subscription cancellation timestamp"          },          "created_at": {            "type": [              "string",              "null"            ],            "description": "Billing record creation time. Null, or absent under external billing, when the account has no stored billing record."          },          "account_id": {            "type": "string",            "format": "uuid"          },          "billing_mode": {            "type": "string",            "enum": [              "stripe",              "external"            ]          },          "tier_id": {            "type": "string"          },          "subscriptions": {            "type": "array",            "items": {              "type": "object",              "properties": {                "id": {                  "type": "string",                  "format": "uuid"                },                "account_id": {                  "type": "string",                  "format": "uuid"                },                "plan_type": {                  "type": "string"                },                "cycle": {                  "type": [                    "string",                    "null"                  ],                  "enum": [                    "monthly",                    "yearly",                    null                  ]                },                "provider_managed": {                  "type": "boolean"                },                "tier_id": {                  "type": "string"                },                "project_id": {                  "type": [                    "string",                    "null"                  ],                  "format": "uuid"                },                "status": {                  "type": "string",                  "enum": [                    "active",                    "canceling",                    "canceled"                  ]                },                "expires_at": {                  "type": [                    "string",                    "null"                  ]                },                "canceled_at": {                  "type": [                    "string",                    "null"                  ]                },                "created_at": {                  "type": "string"                },                "line_items": {                  "type": "array",                  "items": {                    "type": "object",                    "properties": {                      "kind": {                        "type": "string"                      },                      "quantity": {                        "type": "integer"                      },                      "unit_amount": {                        "type": [                          "number",                          "null"                        ]                      },                      "currency": {                        "type": [                          "string",                          "null"                        ]                      }                    },                    "required": [                      "kind",                      "quantity",                      "unit_amount",                      "currency"                    ]                  }                }              },              "required": [                "id",                "account_id",                "plan_type",                "cycle",                "provider_managed",                "tier_id",                "project_id",                "status",                "expires_at",                "canceled_at",                "created_at",                "line_items"              ]            }          },          "limits": {            "type": "object",            "properties": {              "projects": {                "type": [                  "number",                  "null"                ]              },              "collaborators": {                "type": [                  "number",                  "null"                ],                "description": "Effective account seats, including owners, members, and direct project collaborators"              },              "collaborator_feature_max": {                "type": [                  "number",                  "null"                ]              }            },            "required": [              "projects",              "collaborators",              "collaborator_feature_max"            ]          },          "migration": {            "type": "object",            "properties": {              "legacy_subscriptions": {                "type": "integer",                "minimum": 0              },              "legacy_credit_transactions": {                "type": "integer",                "minimum": 0              }            },            "required": [              "legacy_subscriptions",              "legacy_credit_transactions"            ]          },          "plan_type": {            "type": "string",            "enum": [              "free",              "pro",              "enterprise"            ],            "description": "Canonical plan resolved from the configured plan price ID, independent of billed amount"          },          "entitlements": {            "type": "object",            "properties": {              "server_limit": {                "type": "integer",                "minimum": 0,                "maximum": 9007199254740991              },              "seat_limit": {                "type": "integer",                "exclusiveMinimum": 0,                "minimum": -9007199254740991,                "maximum": 9007199254740991              }            },            "required": [              "server_limit",              "seat_limit"            ],            "additionalProperties": false          },          "server_usage": {            "type": "number",            "description": "Active dedicated server records for the account"          },          "sandbox_usage": {            "type": "number",            "description": "Active sandbox records for the account"          },          "server_usage_details": {            "type": "array",            "items": {              "type": "object",              "properties": {                "id": {                  "type": "string",                  "format": "uuid",                  "description": "Server ID"                },                "short_id": {                  "type": "string",                  "description": "Short server identifier"                },                "status": {                  "type": "string",                  "enum": [                    "pending",                    "provisioning",                    "running"                  ],                  "description": "Active server status counted against add-on usage"                },                "environment_ids": {                  "type": "array",                  "items": {                    "type": "string",                    "format": "uuid"                  },                  "description": "Environment IDs linked to the server"                },                "environments": {                  "type": "array",                  "items": {                    "type": "object",                    "properties": {                      "id": {                        "type": "string",                        "format": "uuid",                        "description": "Environment ID linked to the server"                      },                      "name": {                        "type": "string",                        "description": "Environment name"                      },                      "project_id": {                        "type": "string",                        "format": "uuid",                        "description": "Project ID that owns the environment"                      },                      "project_name": {                        "type": "string",                        "description": "Project display name"                      },                      "project_slug": {                        "type": "string",                        "description": "Project slug"                      }                    },                    "required": [                      "id",                      "name",                      "project_id",                      "project_name",                      "project_slug"                    ]                  },                  "description": "Linked environment labels across accessible projects"                }              },              "required": [                "id",                "short_id",                "status",                "environment_ids",                "environments"              ]            },            "description": "Active server add-on usage with linked project and environment labels"          },          "cycle": {            "type": [              "string",              "null"            ],            "enum": [              "monthly",              "yearly",              null            ],            "description": "Billing cycle of the selected subscription. Null without a paid subscription."          }        },        "required": [          "seat_usage",          "account_id",          "billing_mode",          "tier_id",          "subscriptions",          "limits",          "migration"        ]      }    }  }}

400

Bad request

JSON
{  "description": "Bad request",  "content": {    "application/problem+json": {      "schema": {        "$ref": "#/components/schemas/Problem"      }    }  }}

401

Unauthorized

JSON
{  "description": "Unauthorized",  "content": {    "application/problem+json": {      "schema": {        "$ref": "#/components/schemas/Problem"      }    }  }}

403

Forbidden

JSON
{  "description": "Forbidden",  "content": {    "application/problem+json": {      "schema": {        "$ref": "#/components/schemas/Problem"      }    }  }}

404

Not found

JSON
{  "description": "Not found",  "content": {    "application/problem+json": {      "schema": {        "$ref": "#/components/schemas/Problem"      }    }  }}

500

Server error

JSON
{  "description": "Server error",  "content": {    "application/problem+json": {      "schema": {        "$ref": "#/components/schemas/Problem"      }    }  }}

Referenced contracts

components/schemas/Problem

JSON
{  "type": "object",  "properties": {    "cause": {      "type": "string",      "enum": [        "schedule_concurrency_forbidden",        "schedule_fire_in_progress",        "schedule_run_limit_reached"      ],      "description": "Schedule admission refusal."    },    "idempotency": {      "type": "object",      "properties": {        "state": {          "type": "string",          "enum": [            "in_progress",            "payload_mismatch",            "outcome_unknown"          ]        },        "operation": {          "type": "string",          "minLength": 1        },        "retryable": {          "type": "boolean"        },        "retry_after_seconds": {          "type": [            "integer",            "null"          ],          "minimum": 0        },        "expires_at": {          "type": [            "string",            "null"          ]        },        "recovery": {          "type": "object",          "properties": {            "available": {              "type": "boolean"            },            "description": {              "type": "string"            },            "resource_url": {              "type": "string"            }          },          "required": [            "available",            "description"          ]        }      },      "required": [        "state",        "operation",        "retryable",        "retry_after_seconds",        "expires_at"      ],      "description": "Replay status, retry timing, and recovery lookup."    },    "type": {      "type": "string",      "description": "URI reference identifying the problem type",      "example": "https://api.veryfront.com/errors/validation-failed"    },    "title": {      "type": "string",      "description": "Short human-readable summary of the problem",      "example": "Validation Failed"    },    "status": {      "type": "integer",      "minimum": 100,      "maximum": 599,      "description": "HTTP status code",      "example": 400    },    "code": {      "type": "string",      "description": "Stable machine-readable error code",      "example": "RUN_INVALID_INPUT"    },    "detail": {      "type": "string",      "description": "Human-readable explanation specific to this occurrence",      "example": "The 'email' field must be a valid email address"    },    "instance": {      "type": "string",      "description": "URI reference identifying the specific occurrence",      "example": "/projects/my-project/members"    },    "slug": {      "type": "string",      "description": "Stable identifier for the problem type",      "example": "validation-failed"    },    "category": {      "type": "string",      "enum": [        "AUTH",        "RESOURCE",        "VALIDATION",        "DATABASE",        "SUBSCRIPTION",        "INTEGRATION",        "INTERNAL"      ],      "description": "API error category",      "example": "VALIDATION"    },    "suggestion": {      "type": "string",      "description": "Suggested action to resolve the problem",      "example": "Check the request body and query parameters against the API documentation."    },    "errors": {      "type": "array",      "items": {        "type": "object",        "properties": {          "field": {            "type": "string",            "description": "Field path that caused the error",            "example": "email"          },          "message": {            "type": "string",            "description": "Error message for this field",            "example": "Invalid email format"          },          "code": {            "type": "string",            "description": "Error code for this field",            "example": "INVALID_FORMAT"          }        },        "required": [          "field",          "message"        ]      },      "description": "Detailed field-level errors for validation failures"    }  },  "required": [    "type",    "title",    "status"  ]}

Operation contract

JSON
{  "operationId": "getSubscription",  "tags": [    "billing-usage/Subscriptions/Subscription"  ],  "summary": "Get subscription",  "description": "Read the plan, billing cycle, seats and add-ons of an account before changing or cancelling its subscription; returns the subscription with its seat usage. Requires account.billing.read.",  "parameters": [    {      "schema": {        "type": "string",        "format": "uuid"      },      "required": true,      "name": "account_id",      "in": "path"    }  ],  "responses": {    "200": {      "description": "Account subscriptions, limits and the selected subscription",      "content": {        "application/json": {          "schema": {            "type": "object",            "properties": {              "id": {                "type": [                  "string",                  "null"                ],                "description": "Billing record ID. Null, or absent under external billing, when the account has no stored billing record."              },              "project_id": {                "type": [                  "string",                  "null"                ],                "description": "Project this subscription is scoped to, when applicable"              },              "line_items": {                "type": "array",                "items": {                  "type": "object",                  "properties": {                    "kind": {                      "type": "string",                      "enum": [                        "plan",                        "seat",                        "server",                        "sandbox"                      ],                      "description": "Subscription line item kind"                    },                    "quantity": {                      "type": "number",                      "description": "Line item quantity"                    },                    "recurring_interval": {                      "type": [                        "string",                        "null"                      ],                      "enum": [                        "monthly",                        "yearly",                        null                      ],                      "description": "Line item billing interval when price-classifiable"                    },                    "unit_amount": {                      "type": [                        "number",                        "null"                      ],                      "description": "Line item unit amount in minor currency units"                    },                    "currency": {                      "type": [                        "string",                        "null"                      ],                      "description": "Line item currency"                    }                  },                  "required": [                    "kind",                    "quantity"                  ]                },                "description": "Subscription line items. Credits are one-time top-ups and are not included here."              },              "seat_usage": {                "type": [                  "object",                  "null"                ],                "properties": {                  "purchased": {                    "type": "integer",                    "minimum": 0                  },                  "active": {                    "type": "integer",                    "minimum": 0                  },                  "reserved": {                    "type": "integer",                    "minimum": 0                  },                  "available": {                    "type": "integer",                    "minimum": 0                  },                  "over_capacity": {                    "type": "boolean"                  },                  "used": {                    "type": "integer",                    "minimum": 0,                    "description": "Seats in use: active plus reserved"                  }                },                "required": [                  "purchased",                  "active",                  "reserved",                  "available",                  "over_capacity"                ],                "description": "Seat usage that seat changes and invitations are checked against, served on every read, including an account without a stored billing record. Null only while the account still has subscriptions without an owning account (migration.legacy_subscriptions above 0)."              },              "status": {                "type": [                  "string",                  "null"                ],                "description": "Subscription status"              },              "current_period_start": {                "type": [                  "string",                  "null"                ],                "description": "Current billing period start timestamp"              },              "current_period_end": {                "type": [                  "string",                  "null"                ],                "description": "Current billing period end timestamp"              },              "expires_at": {                "type": [                  "string",                  "null"                ],                "description": "Subscription expiration timestamp"              },              "canceled_at": {                "type": [                  "string",                  "null"                ],                "description": "Subscription cancellation timestamp"              },              "created_at": {                "type": [                  "string",                  "null"                ],                "description": "Billing record creation time. Null, or absent under external billing, when the account has no stored billing record."              },              "account_id": {                "type": "string",                "format": "uuid"              },              "billing_mode": {                "type": "string",                "enum": [                  "stripe",                  "external"                ]              },              "tier_id": {                "type": "string"              },              "subscriptions": {                "type": "array",                "items": {                  "type": "object",                  "properties": {                    "id": {                      "type": "string",                      "format": "uuid"                    },                    "account_id": {                      "type": "string",                      "format": "uuid"                    },                    "plan_type": {                      "type": "string"                    },                    "cycle": {                      "type": [                        "string",                        "null"                      ],                      "enum": [                        "monthly",                        "yearly",                        null                      ]                    },                    "provider_managed": {                      "type": "boolean"                    },                    "tier_id": {                      "type": "string"                    },                    "project_id": {                      "type": [                        "string",                        "null"                      ],                      "format": "uuid"                    },                    "status": {                      "type": "string",                      "enum": [                        "active",                        "canceling",                        "canceled"                      ]                    },                    "expires_at": {                      "type": [                        "string",                        "null"                      ]                    },                    "canceled_at": {                      "type": [                        "string",                        "null"                      ]                    },                    "created_at": {                      "type": "string"                    },                    "line_items": {                      "type": "array",                      "items": {                        "type": "object",                        "properties": {                          "kind": {                            "type": "string"                          },                          "quantity": {                            "type": "integer"                          },                          "unit_amount": {                            "type": [                              "number",                              "null"                            ]                          },                          "currency": {                            "type": [                              "string",                              "null"                            ]                          }                        },                        "required": [                          "kind",                          "quantity",                          "unit_amount",                          "currency"                        ]                      }                    }                  },                  "required": [                    "id",                    "account_id",                    "plan_type",                    "cycle",                    "provider_managed",                    "tier_id",                    "project_id",                    "status",                    "expires_at",                    "canceled_at",                    "created_at",                    "line_items"                  ]                }              },              "limits": {                "type": "object",                "properties": {                  "projects": {                    "type": [                      "number",                      "null"                    ]                  },                  "collaborators": {                    "type": [                      "number",                      "null"                    ],                    "description": "Effective account seats, including owners, members, and direct project collaborators"                  },                  "collaborator_feature_max": {                    "type": [                      "number",                      "null"                    ]                  }                },                "required": [                  "projects",                  "collaborators",                  "collaborator_feature_max"                ]              },              "migration": {                "type": "object",                "properties": {                  "legacy_subscriptions": {                    "type": "integer",                    "minimum": 0                  },                  "legacy_credit_transactions": {                    "type": "integer",                    "minimum": 0                  }                },                "required": [                  "legacy_subscriptions",                  "legacy_credit_transactions"                ]              },              "plan_type": {                "type": "string",                "enum": [                  "free",                  "pro",                  "enterprise"                ],                "description": "Canonical plan resolved from the configured plan price ID, independent of billed amount"              },              "entitlements": {                "type": "object",                "properties": {                  "server_limit": {                    "type": "integer",                    "minimum": 0,                    "maximum": 9007199254740991                  },                  "seat_limit": {                    "type": "integer",                    "exclusiveMinimum": 0,                    "minimum": -9007199254740991,                    "maximum": 9007199254740991                  }                },                "required": [                  "server_limit",                  "seat_limit"                ],                "additionalProperties": false              },              "server_usage": {                "type": "number",                "description": "Active dedicated server records for the account"              },              "sandbox_usage": {                "type": "number",                "description": "Active sandbox records for the account"              },              "server_usage_details": {                "type": "array",                "items": {                  "type": "object",                  "properties": {                    "id": {                      "type": "string",                      "format": "uuid",                      "description": "Server ID"                    },                    "short_id": {                      "type": "string",                      "description": "Short server identifier"                    },                    "status": {                      "type": "string",                      "enum": [                        "pending",                        "provisioning",                        "running"                      ],                      "description": "Active server status counted against add-on usage"                    },                    "environment_ids": {                      "type": "array",                      "items": {                        "type": "string",                        "format": "uuid"                      },                      "description": "Environment IDs linked to the server"                    },                    "environments": {                      "type": "array",                      "items": {                        "type": "object",                        "properties": {                          "id": {                            "type": "string",                            "format": "uuid",                            "description": "Environment ID linked to the server"                          },                          "name": {                            "type": "string",                            "description": "Environment name"                          },                          "project_id": {                            "type": "string",                            "format": "uuid",                            "description": "Project ID that owns the environment"                          },                          "project_name": {                            "type": "string",                            "description": "Project display name"                          },                          "project_slug": {                            "type": "string",                            "description": "Project slug"                          }                        },                        "required": [                          "id",                          "name",                          "project_id",                          "project_name",                          "project_slug"                        ]                      },                      "description": "Linked environment labels across accessible projects"                    }                  },                  "required": [                    "id",                    "short_id",                    "status",                    "environment_ids",                    "environments"                  ]                },                "description": "Active server add-on usage with linked project and environment labels"              },              "cycle": {                "type": [                  "string",                  "null"                ],                "enum": [                  "monthly",                  "yearly",                  null                ],                "description": "Billing cycle of the selected subscription. Null without a paid subscription."              }            },            "required": [              "seat_usage",              "account_id",              "billing_mode",              "tier_id",              "subscriptions",              "limits",              "migration"            ]          }        }      }    },    "400": {      "description": "Bad request",      "content": {        "application/problem+json": {          "schema": {            "$ref": "#/components/schemas/Problem"          }        }      }    },    "401": {      "description": "Unauthorized",      "content": {        "application/problem+json": {          "schema": {            "$ref": "#/components/schemas/Problem"          }        }      }    },    "403": {      "description": "Forbidden",      "content": {        "application/problem+json": {          "schema": {            "$ref": "#/components/schemas/Problem"          }        }      }    },    "404": {      "description": "Not found",      "content": {        "application/problem+json": {          "schema": {            "$ref": "#/components/schemas/Problem"          }        }      }    },    "500": {      "description": "Server error",      "content": {        "application/problem+json": {          "schema": {            "$ref": "#/components/schemas/Problem"          }        }      }    }  },  "x-documentation-source-tag": "Account billing",  "x-canonical-documentation": {    "domain": "billing-usage",    "resource": "Subscriptions",    "subgroup": "Subscription",    "name": "Get subscription",    "description": "Read the plan, billing cycle, seats and add-ons of an account before changing or cancelling its subscription; returns the subscription with its seat usage. Requires account.billing.read.",    "operationId": "getSubscription"  },  "x-mint": {    "href": "/cloud/rest/api-reference/billing-usage-subscriptions-subscription/get-subscription"  }}