Skip to main content
PATCH
/
workspaces
/
{workspaceId}
/
billing-accounts
/
{billingAccountId}
/
subscriptions
/
{subscriptionId}
Update a subscription
curl --request PATCH \
  --url https://api.altostrat.io/workspaces/{workspaceId}/billing-accounts/{billingAccountId}/subscriptions/{subscriptionId} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "action": "pause",
  "product_quantities": {
    "locations": 20,
    "users": 100
  },
  "add_products": {
    "sso": 1
  },
  "remove_products": [
    "sso"
  ],
  "metadata": {
    "project_id": "proj_def456"
  }
}'
{
  "id": "sub_a1b2c3d4e5f6g7h8",
  "billing_account_id": "cus_a1b2c3d4e5f6g7h8",
  "status": "active",
  "currency": "usd",
  "product_quantities": {
    "locations": {
      "price_id": "price_123abc",
      "quantity": 10,
      "interval": "month"
    },
    "users": {
      "price_id": "price_456def",
      "quantity": 50,
      "interval": "month"
    }
  },
  "metadata": {
    "order_id": "6735"
  },
  "current_period_start": "2025-10-15T00:00:00Z",
  "current_period_end": "2025-11-15T00:00:00Z",
  "created_at": "2025-10-15T12:30:00Z",
  "updated_at": "2025-10-20T09:00:00Z"
}

Authorizations

Authorization
string
header
required

Enter your JWT in the format: Bearer {token}

Path Parameters

workspaceId
string
required

The ID of the workspace.

Example:

"ws_a1b2c3d4e5f6g7h8"

billingAccountId
string
required

The ID of the billing account, which corresponds to a Stripe Customer ID (cus_...).

Example:

"cus_a1b2c3d4e5f6g7h8"

subscriptionId
string
required

The ID of the Stripe subscription (sub_...).

Example:

"sub_a1b2c3d4e5f6g7h8"

Body

application/json

Specify one of the following operations: action, product_quantities, add_products, or remove_products. metadata can be combined with product_quantities.

action
enum<string>

Perform a state change action on the subscription.

Available options:
pause,
resume,
sync
product_quantities
object

Replace all current product quantities with this new set. To remove a product, omit it from this object. A quantity of 0 is not allowed; omit the key to remove.

Example:
{ "locations": 20, "users": 100 }
add_products
object

Add new products to the subscription or increase the quantity of existing ones.

Example:
{ "sso": 1 }
remove_products
enum<string>[]

A list of product types to remove from the subscription.

Example:
["sso"]
metadata
object

A set of key-value pairs to store with the subscription. Will be merged with existing metadata.

Example:
{ "project_id": "proj_def456" }

Response

The subscription was updated successfully.

id
string

Unique identifier for the subscription (Stripe Subscription ID), prefixed with sub_.

Example:

"sub_a1b2c3d4e5f6g7h8"

billing_account_id
string

The ID of the billing account this subscription belongs to.

Example:

"cus_a1b2c3d4e5f6g7h8"

status
enum<string>

The status of the subscription.

Available options:
active,
past_due,
unpaid,
canceled,
incomplete,
incomplete_expired,
trialing,
paused
Example:

"active"

currency
enum<string>

The three-letter ISO currency code for the subscription.

Available options:
usd,
zar,
eur,
gbp,
aud
Example:

"usd"

product_quantities
object

A map of meterable product types to their subscribed quantities and pricing details.

Example:
{
"locations": {
"price_id": "price_123abc",
"quantity": 10,
"interval": "month"
},
"users": {
"price_id": "price_456def",
"quantity": 50,
"interval": "month"
}
}
metadata
object

A set of key-value pairs that you can attach to an object.

Example:
{ "order_id": "6735" }
current_period_start
string<date-time> | null

The start of the current billing period.

Example:

"2025-10-15T00:00:00Z"

current_period_end
string<date-time> | null

The end of the current billing period.

Example:

"2025-11-15T00:00:00Z"

created_at
string<date-time> | null

The timestamp when the subscription was created.

Example:

"2025-10-15T12:30:00Z"

updated_at
string<date-time> | null

The timestamp when the subscription was last updated in our system.

Example:

"2025-10-20T09:00:00Z"