POST
/
v2
/
subscriptions
/
{id}
/
upgrade
Upgrade subscription
curl --request POST \
  --url https://api.hyperline.co/v2/subscriptions/{id}/upgrade \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "previous_subscription_id": "sub_B6ClkdqNqVNBgY",
  "switch_schedule": "immediately",
  "apply_at": "2024-01-15T10:00:00Z"
}'
{
  "id": "sub_B6ClkdqNqVNBgY",
  "invoice_id": "inv_1eTaiytfA0i2Va"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id
string
required

Body

application/json
previous_subscription_id
string
required

The ID of the subscription to upgrade from.

Example:

"sub_B6ClkdqNqVNBgY"

apply_at
string<date-time>
required

The date when the upgrade should be applied.

Example:

"2024-01-15T10:00:00Z"

switch_schedule
enum<string>
default:immediately

When to switch from the old subscription to the new one.

Available options:
immediately,
next_period
Example:

"immediately"

Response

200 - application/json
id
string
required

The ID of the upgraded subscription.

Example:

"sub_B6ClkdqNqVNBgY"

invoice_id
string | null
required

The ID of the invoice created for the upgrade, if any.

Example:

"inv_1eTaiytfA0i2Va"