OpenMeter Subscriptions

Cancel subscription

Cancels the subscription. Will result in a scheduling conflict if there are other subscriptions scheduled to start after the cancelation time.

post/v3/openmeter/subscriptions/{subscriptionId}/cancel

Path parameters

subscriptionIdstring required

ULID (Universally Unique Lexicographically Sortable Identifier).

Example:01G65Z755AFWAKHE12NY0CQ9FH

Request body

Example request

{
  "timing": "2023-01-01T01:01:01.001Z"
}

Response

Subscription updated response.

idstring required

ULID (Universally Unique Lexicographically Sortable Identifier).

labelsLabels

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 "_".

created_atstring date-time required

An ISO-8601 timestamp representation of entity creation date.

updated_atstring date-time required

An ISO-8601 timestamp representation of entity last update date.

deleted_atstring date-time

An ISO-8601 timestamp representation of entity deletion date.

customer_idstring required

The customer ID of the subscription.

plan_idstring

The plan ID of the subscription. Set if subscription is created from a plan.

billing_anchorstring date-time required

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)
status'active' | 'inactive' | 'canceled' | 'scheduled' required

The status of the subscription.

settlement_mode'credit_then_invoice' | 'credit_only'

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.

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",
  "customer_id": "01G65Z755AFWAKHE12NY0CQ9FH",
  "plan_id": "01G65Z755AFWAKHE12NY0CQ9FH",
  "billing_anchor": "2023-01-01T01:01:01.001Z"
}

Changes

Changed in 3 of the 75 revisions of this API.4

    • added the optional property settlement_mode to the response with the 200 status

      response-optional-property-added

    This revision also has 23 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

    • the response property created_at became required for the status 200

      response-property-became-required

    • the response property updated_at became required for the status 200

      response-property-became-required

    This revision also has 1 change that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

    • endpoint added

      endpoint-added

    This revision also has 6 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog