Change subscription
Changed onCloses a running subscription and starts a new one according to the specification. Can be used for upgrades, downgrades, and plan changes.
Request
- Base URLhttps://global.api.konghq.com
- Auth
- HTTP bearer
- or HTTP bearer
- or HTTP bearer
- or HTTP bearer
Path parameters
ULID (Universally Unique Lexicographically Sortable Identifier).
Request body
Request for changing a subscription.
Labels store metadata of an entity that can be used for filtering an entity list or for searching across entity types.
Keys must be of length 1-63 characters, and cannot start with "kong", "konnect", "mesh", "kic", or "_".
Settlement mode for billing.
Values:
- credit_then_invoice: Credits are applied first, then any remainder is invoiced.
- credit_only: Usage is settled exclusively against credits.
The customer to create the subscription for.
A reference to a published plan the subscription is created from.
Exactly one of plan or custom_plan must be provided. Use plan to base the subscription on an existing published plan; use custom_plan to define the plan inline.
An inline plan definition to create the subscription from, without referencing a published plan.
Exactly one of plan or custom_plan must be provided. The subscription is not linked to a persisted plan, so the response omits the plan reference.
The key of the phase to start the subscription in. If not provided, the subscription starts in the first phase of the plan.
Only applies when creating from a published plan; custom plans define their own phases inline.
A billing anchor is the fixed point in time that determines the subscription's recurring billing cycle. It affects when charges occur and how prorations are calculated. Common anchors:
- Calendar month (1st of each month): 2025-01-01T00:00:00Z
- Subscription anniversary (day customer signed up)
- Custom date (customer-specified day)
If not provided, the subscription will be created with the subscription's creation time as the billing anchor.
Controls how custom-currency cost bases are selected for the subscription.
Timing configuration for the change, when the change should take effect. For changing a subscription, the accepted values depend on the subscription configuration.
Example request
{
"labels": {
"env": "test"
},
"customer": {
"id": "01G65Z755AFWAKHE12NY0CQ9FH",
"key": "019ae40f-4258-7f15-9491-842f42a7d6ac"
},
"plan": {
"id": "01G65Z755AFWAKHE12NY0CQ9FH",
"key": "resource_key"
},
"custom_plan": {
"labels": {
"env": "test"
},
"currency": "USD",
"billing_cadence": "P1Y",
"phases": [
{
"labels": {
"env": "test"
},
"key": "resource_key",
"duration": "P1Y",
"rate_cards": [
{
"labels": {
"env": "test"
},
"key": "resource_key",
"feature": {
"id": "01G65Z755AFWAKHE12NY0CQ9FH"
},
"currency": "USD",
"billing_cadence": "P1Y",
"tax_config": {
"code": {
"id": "01G65Z755AFWAKHE12NY0CQ9FH"
}
},
"entitlement": {
"usage_period": "P1Y"
}
}
]
}
]
},
"billing_anchor": "2023-01-01T01:01:01.001Z",
"timing": "2023-01-01T01:01:01.001Z"
}Response
The request has succeeded.
Response for changing a subscription.
The current subscription before the change.
The new state of the subscription after the change.
Example response
{
"current": {
"id": "01G65Z755AFWAKHE12NY0CQ9FH",
"labels": {
"env": "test"
},
"created_at": "2023-01-01T01:01:01.001Z",
"updated_at": "2023-01-01T01:01:01.001Z",
"deleted_at": "2023-01-01T01:01:01.001Z",
"active_from": "2023-01-01T01:01:01.001Z",
"active_to": "2023-01-01T01:01:01.001Z",
"customer_id": "01G65Z755AFWAKHE12NY0CQ9FH",
"plan_id": "01G65Z755AFWAKHE12NY0CQ9FH",
"plan": {
"id": "01G65Z755AFWAKHE12NY0CQ9FH",
"key": "resource_key"
},
"invoice_currency": "USD",
"cost_basis_pins": [
{
"custom_currency_id": "01G65Z755AFWAKHE12NY0CQ9FH",
"invoice_currency": "USD",
"cost_basis_id": "01G65Z755AFWAKHE12NY0CQ9FH"
}
],
"billing_cadence": "P1Y",
"billing_anchor": "2023-01-01T01:01:01.001Z",
"current_period": {
"from": "2023-01-01T01:01:01.001Z",
"to": "2023-01-01T01:01:01.001Z"
},
"phases": [
{
"id": "01G65Z755AFWAKHE12NY0CQ9FH",
"labels": {
"env": "test"
},
"created_at": "2023-01-01T01:01:01.001Z",
"updated_at": "2023-01-01T01:01:01.001Z",
"deleted_at": "2023-01-01T01:01:01.001Z",
"key": "resource_key",
"active_from": "2023-01-01T01:01:01.001Z",
"active_to": "2023-01-01T01:01:01.001Z",
"items": [
{
"id": "01G65Z755AFWAKHE12NY0CQ9FH",
"active_from": "2023-01-01T01:01:01.001Z",
"active_to": "2023-01-01T01:01:01.001Z",
"rate_card": {
"labels": {
"env": "test"
},
"key": "resource_key",
"feature": {
"id": "01G65Z755AFWAKHE12NY0CQ9FH"
},
"currency": "USD",
"billing_cadence": "P1Y",
"tax_config": {
"code": {
"id": "01G65Z755AFWAKHE12NY0CQ9FH"
}
},
"entitlement": {
"usage_period": "P1Y"
}
}
}
]
}
]
},
"next": {
"id": "01G65Z755AFWAKHE12NY0CQ9FH",
"labels": {
"env": "test"
},
"created_at": "2023-01-01T01:01:01.001Z",
"updated_at": "2023-01-01T01:01:01.001Z",
"deleted_at": "2023-01-01T01:01:01.001Z",
"active_from": "2023-01-01T01:01:01.001Z",
"active_to": "2023-01-01T01:01:01.001Z",
"customer_id": "01G65Z755AFWAKHE12NY0CQ9FH",
"plan_id": "01G65Z755AFWAKHE12NY0CQ9FH",
"plan": {
"id": "01G65Z755AFWAKHE12NY0CQ9FH",
"key": "resource_key"
},
"invoice_currency": "USD",
"cost_basis_pins": [
{
"custom_currency_id": "01G65Z755AFWAKHE12NY0CQ9FH",
"invoice_currency": "USD",
"cost_basis_id": "01G65Z755AFWAKHE12NY0CQ9FH"
}
],
"billing_cadence": "P1Y",
"billing_anchor": "2023-01-01T01:01:01.001Z",
"current_period": {
"from": "2023-01-01T01:01:01.001Z",
"to": "2023-01-01T01:01:01.001Z"
},
"phases": [
{
"id": "01G65Z755AFWAKHE12NY0CQ9FH",
"labels": {
"env": "test"
},
"created_at": "2023-01-01T01:01:01.001Z",
"updated_at": "2023-01-01T01:01:01.001Z",
"deleted_at": "2023-01-01T01:01:01.001Z",
"key": "resource_key",
"active_from": "2023-01-01T01:01:01.001Z",
"active_to": "2023-01-01T01:01:01.001Z",
"items": [
{
"id": "01G65Z755AFWAKHE12NY0CQ9FH",
"active_from": "2023-01-01T01:01:01.001Z",
"active_to": "2023-01-01T01:01:01.001Z",
"rate_card": {
"labels": {
"env": "test"
},
"key": "resource_key",
"feature": {
"id": "01G65Z755AFWAKHE12NY0CQ9FH"
},
"currency": "USD",
"billing_cadence": "P1Y",
"tax_config": {
"code": {
"id": "01G65Z755AFWAKHE12NY0CQ9FH"
}
},
"entitlement": {
"usage_period": "P1Y"
}
}
}
]
}
]
}
}Changes
- breaking
added to the
invalid_parameters/itemsresponse propertyoneOflist for the response status - warning
added the new
key_invalidenum value to theinvalid_parameters/items/oneOf[#/components/schemas/InvalidParameterStandard]/ruleresponse property for the response status - warning
added the new
uniqueenum value to theinvalid_parameters/items/oneOf[#/components/schemas/InvalidParameterStandard]/ruleresponse property for the response status
- breaking