Skip to main content
PATCH
/
workspaces
/
{workspace_id}
/
billing-accounts
/
{billing_account_id}
/
subscriptions
/
{subscription_id}
Update Subscription
curl --request PATCH \
  --url https://api.altostrat.io/workspaces/{workspace_id}/billing-accounts/{billing_account_id}/subscriptions/{subscription_id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "action": "pause",
  "product_quantities": {},
  "add_products": {},
  "remove_products": [
    "users"
  ],
  "metadata": {}
}'
{
  "id": "<string>",
  "billing_account_id": "<string>",
  "status": "active",
  "currency": "usd",
  "product_quantities": {},
  "plan_id": "<string>",
  "current_period_start": "2023-11-07T05:31:56Z",
  "current_period_end": "2023-11-07T05:31:56Z",
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

Auth0 JWT token for user authentication.

Path Parameters

workspace_id
string
required

The unique identifier for the workspace.

Example:

"ws_abc123"

billing_account_id
string
required

The unique identifier for the billing account (Stripe customer ID).

Example:

"cus_abc123"

subscription_id
string
required

The unique identifier for the subscription (Stripe subscription ID).

Example:

"sub_abc123"

Body

application/json

Only one operation type (action, product_quantities, etc.) is allowed per request.

action
enum<string>
Available options:
pause,
resume,
sync
product_quantities
object
add_products
object
remove_products
enum<string>[]
metadata
object

Response

200 - application/json

Subscription updated successfully.

id
string

Stripe subscription ID (sub_...)

billing_account_id
string
status
enum<string>
Available options:
active,
past_due,
unpaid,
canceled,
incomplete,
incomplete_expired,
trialing,
paused
currency
enum<string>
Available options:
usd,
eur,
gbp,
aud,
zar
product_quantities
object
plan_id
string | null
deprecated
current_period_start
string<date-time> | null
current_period_end
string<date-time> | null
created_at
string<date-time>
updated_at
string<date-time>
I