POST
/
v2
/
subscriptions
/
{id}
/
upgrade
Upgrade or downgrade 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_123456789",
  "switch_schedule": "immediately",
  "apply_at": "2024-01-15T10:00:00Z"
}'
{
  "id": "sub_123456789",
  "invoice_id": "inv_123456789"
}

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

Upgrade or downgrade subscription payload.

This will cancel the old subscription and activate the new one with pro-rata calculation. The switch can be immediate or at the next period.

The body is of type object.

Response

200 - application/json

The upgrade result with subscription ID and invoice ID

The response is of type object.