Edit subscription
Changed onEdits a running subscription by applying an ordered batch of customizations (adding or removing items, adding, removing, or stretching phases, or unscheduling a pending edit). The changes may take effect immediately or at the next billing cycle. Subscriptions that have add-ons cannot be edited.
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 editing a running subscription. Applies an ordered batch of customizations to the subscription's phases and items. A later customization observes the state produced by earlier ones.
The ordered batch of customizations to apply to the running subscription.
When the requested changes should take effect. Defaults to immediate.
Example request
{
"customizations": [
{
"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"
}
}
}
],
"timing": "2023-01-01T01:01:01.001Z"
}Response
Subscription updated response.
Subscription.
ULID (Universally Unique Lexicographically Sortable Identifier).
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 "_".
An ISO-8601 timestamp representation of entity creation date.
An ISO-8601 timestamp representation of entity last update date.
An ISO-8601 timestamp representation of entity deletion date.
Display name of the subscription. Defaults to the plan name when the subscription is created from a plan.
Optional description of the subscription.
An ISO-8601 timestamp representation of when the subscription became (or will become) active.
An ISO-8601 timestamp representation of when the subscription stops being active. Open-ended when not set.
The customer ID of the subscription.
The plan ID of the subscription. Set if subscription is created from a plan.
The plan the subscription was created from, if any. Includes the plan key and version so clients can resolve the exact plan revision.
The fiat currency in which the subscription is invoiced.
Controls whether custom-currency cost bases are resolved dynamically or pinned when their currency pair is introduced to the subscription.
Cost bases pinned to custom-currency pairs for this subscription.
The billing cadence of the subscription in ISO-8601 duration format. Defines how often the customer is billed. Examples: P1M (monthly), P3M (quarterly), P1Y (annually).
The pro-rating configuration of the subscription.
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)
The status of the subscription.
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 current aligned billing period. Present only when the subscription is active and aligned.
The phases of the subscription in chronological order. A phase groups the rate cards that are in effect for a segment of the subscription's lifetime.
Example response
{
"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