Zum Hauptinhalt springen
POST
/
api
/
customer
/
subscriptions
/
{id}
/
switch-plan-tier
Switch the plan tier
curl --request POST \
  --url https://coreapi.io/api/customer/subscriptions/{id}/switch-plan-tier \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "planTierId": "f5ece259-08ea-77a4-8bd9-9f3a9ed9e246",
  "items": []
}
'
{
  "subscriptionId": "<string>",
  "newPlanTierId": "<string>",
  "amendmentId": "<string>",
  "scheduleEventId": "<string>",
  "warnings": [
    "active_discount_will_be_lost"
  ]
}

Autorisierungen

Authorization
string
header
erforderlich

Customer access token. Send it as Authorization: Bearer . Obtain it server side via POST /customers/{id}/authenticate (use the response accessToken), or from a customer portal session. The token must carry the customer:plan:switch permission.

Pfadparameter

id
string<uuid>
erforderlich

The subscription UUID.

Beispiel:

"1280792f-4e23-793d-8e9c-3a1bf36630bd"

Body

application/json
planTierId
string
erforderlich

UUID of the target tier to switch into.

items
object[]

Optional quantity overrides for editable items of the target tier.

Antwort

The switch result.

subscriptionId
string
newPlanTierId
string
amendmentId
string

Internal reference id of the resulting change.

scheduleEventId
string

Internal reference id of the resulting change.

warnings
string[]
Beispiel:
["active_discount_will_be_lost"]