POST
/
v2
/
subscriptions
/
{id}
/
preview-upgrade
Preview subscription upgrade
curl --request POST \
  --url https://api.hyperline.co/v2/subscriptions/{id}/preview-upgrade \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "previous_subscription_id": "sub_B6ClkdqNqVNBgY",
  "apply_at": "2024-01-15T10:00:00Z"
}'
{
  "line_items": [
    {
      "name": "Platform access",
      "product_id": "itm_KbLcWt2qm5p1S2",
      "amount_excluding_tax": 20000,
      "usage": 123,
      "period_start": "2024-10-13T00:00:00.000Z",
      "period_end": "2024-11-13T00:00:00.000Z"
    }
  ]
}

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"

Response

200 - application/json
line_items
object[]
required

The invoice line items that will be created for the upgrade.