Billing Endpoints
Get Subscription
GET /v1/workspaces/:workspaceId/billing/subscription
Get the current subscription.
Response:
{
"id": "sub_abc123",
"workspace_id": "ws_xyz789",
"plan": "pro",
"status": "active",
"current_period_start": "2025-01-01T00:00:00Z",
"current_period_end": "2025-02-01T00:00:00Z",
"quantity": 10,
"amount": 12900
}List Features
GET /v1/workspaces/:workspaceId/billing/features
List all features with access status.
Response:
{
"features": [
{
"key": "max_packages",
"type": "limit",
"limit": 50,
"current_usage": 15,
"can_proceed": true
}
]
}Get Usage Summary
GET /v1/workspaces/:workspaceId/billing/usage
Get usage summary for all features.
Change Plan
POST /v1/workspaces/:workspaceId/billing/subscription/change-plan
Change the subscription plan.
Request Body:
{
"plan": "enterprise"
}Update Quantity
POST /v1/workspaces/:workspaceId/billing/subscription/update-quantity
Update member quantity.
Request Body:
{
"quantity": 25
}Cancel Subscription
POST /v1/workspaces/:workspaceId/billing/subscription/cancel
Cancel the subscription.
List Available Addons
GET /v1/billing/addons
List all available addons (global endpoint).
List Active Addons
GET /v1/workspaces/:workspaceId/billing/addons/active
List active addons for workspace.
Activate Addon
POST /v1/workspaces/:workspaceId/billing/addons
Activate an addon.
Request Body:
{
"addon_key": "extra_storage",
"quantity": 5
}Update Addon Quantity
PATCH /v1/workspaces/:workspaceId/billing/addons/:addonId/quantity
Update addon quantity.
Deactivate Addon
DELETE /v1/workspaces/:workspaceId/billing/addons/:addonId
Deactivate an addon.