Cancel subscription

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

post

Path Parameters

subscriptionIdstringrequired

ULID (Universally Unique Lexicographically Sortable Identifier).

Match pattern:^[0-7][0-9A-HJKMNP-TV-Z]{25}$

Example:01G65Z755AFWAKHE12NY0CQ9FH

Body

application/json

BillingSubscriptionCancel

Request for canceling a subscription.

timingOne Of

If not provided the subscription is canceled immediately.

Default:immediate

Example:immediate

BillingSubscriptionEditTimingEnumstring

Subscription edit timing.
When immediate, the requested changes take effect immediately.
When next_billing_cycle, the requested changes take effect at the next billing cycle.

Allowed values:immediatenext_billing_cycle

Response

application/json

Subscription updated response.

BillingSubscription

Subscription.

idstringrequiredread-only

ULID (Universally Unique Lexicographically Sortable Identifier).

Match pattern:^[0-7][0-9A-HJKMNP-TV-Z]{25}$

Example:01G65Z755AFWAKHE12NY0CQ9FH

labelsobject

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 “_”.

Example:{"env":"test"}

created_atstring(date-time)read-only

An ISO-8601 timestamp representation of entity creation date.

Example:2023-01-01T01:01:01.001Z

updated_atstring(date-time)read-only

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

Example:2023-01-01T01:01:01.001Z

deleted_atstring(date-time)read-only

An ISO-8601 timestamp representation of entity deletion date.

Example:2023-01-01T01:01:01.001Z

customer_idstringrequiredread-only

The customer ID of the subscription.

Match pattern:^[0-7][0-9A-HJKMNP-TV-Z]{25}$

Example:01G65Z755AFWAKHE12NY0CQ9FH

plan_idstringread-only

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

Match pattern:^[0-7][0-9A-HJKMNP-TV-Z]{25}$

Example:01G65Z755AFWAKHE12NY0CQ9FH

billing_anchorstring(date-time)requiredread-only

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)

Example:2023-01-01T01:01:01.001Z

statusstringrequiredread-only

The status of the subscription.

Allowed values:activeinactivecanceledscheduled

post/openmeter/subscriptions/{subscriptionId}/cancel

Body

{}
 
application/json

Change subscription

Closes a running subscription and starts a new one according to the specification.
Can be used for upgrades, downgrades, and plan changes.

post

Path Parameters

subscriptionIdstringrequired

ULID (Universally Unique Lexicographically Sortable Identifier).

Match pattern:^[0-7][0-9A-HJKMNP-TV-Z]{25}$

Example:01G65Z755AFWAKHE12NY0CQ9FH

Body

application/json

BillingSubscriptionChange

Request for changing a subscription.

labelsobject

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 “_”.

Example:{"env":"test"}

customerobjectrequired

The customer to create the subscription for.

Show Child Parameters
planobjectrequired

The plan reference of the subscription.

Show Child Parameters
billing_anchorstring(date-time)

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.

Example:2023-01-01T01:01:01.001Z

timingOne Of
required

Timing configuration for the change, when the change should take effect.
For changing a subscription, the accepted values depend on the subscription configuration.

Example:immediate

BillingSubscriptionEditTimingEnumstring

Subscription edit timing.
When immediate, the requested changes take effect immediately.
When next_billing_cycle, the requested changes take effect at the next billing cycle.

Allowed values:immediatenext_billing_cycle

Response

application/json

The request has succeeded.

BillingSubscriptionChangeResponse

Response for changing a subscription.

currentobjectrequired

The current subscription before the change.

Show Child Parameters
nextobjectrequired

The new state of the subscription after the change.

Show Child Parameters
post/openmeter/subscriptions/{subscriptionId}/change

Body

{ "customer": {}, "plan": {}, "timing": {} }
 
application/json

Unschedule subscription cancelation

Unschedules the subscription cancelation.

post

Path Parameters

subscriptionIdstringrequired

ULID (Universally Unique Lexicographically Sortable Identifier).

Match pattern:^[0-7][0-9A-HJKMNP-TV-Z]{25}$

Example:01G65Z755AFWAKHE12NY0CQ9FH

Response

application/json

Subscription updated response.

BillingSubscription

Subscription.

idstringrequiredread-only

ULID (Universally Unique Lexicographically Sortable Identifier).

Match pattern:^[0-7][0-9A-HJKMNP-TV-Z]{25}$

Example:01G65Z755AFWAKHE12NY0CQ9FH

labelsobject

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 “_”.

Example:{"env":"test"}

created_atstring(date-time)read-only

An ISO-8601 timestamp representation of entity creation date.

Example:2023-01-01T01:01:01.001Z

updated_atstring(date-time)read-only

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

Example:2023-01-01T01:01:01.001Z

deleted_atstring(date-time)read-only

An ISO-8601 timestamp representation of entity deletion date.

Example:2023-01-01T01:01:01.001Z

customer_idstringrequiredread-only

The customer ID of the subscription.

Match pattern:^[0-7][0-9A-HJKMNP-TV-Z]{25}$

Example:01G65Z755AFWAKHE12NY0CQ9FH

plan_idstringread-only

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

Match pattern:^[0-7][0-9A-HJKMNP-TV-Z]{25}$

Example:01G65Z755AFWAKHE12NY0CQ9FH

billing_anchorstring(date-time)requiredread-only

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)

Example:2023-01-01T01:01:01.001Z

statusstringrequiredread-only

The status of the subscription.

Allowed values:activeinactivecanceledscheduled

post/openmeter/subscriptions/{subscriptionId}/unschedule-cancelation
 
application/json

OpenMeter Customers

Customers are used to track usage of your product or service. Customers can be individuals or organizations that can subscribe to plans and have access to features.

Create customer

post

Body

application/json

CreateCustomerRequest

Customer create request.

namestringrequired

Display name of the resource.

Between 1 and 256 characters.

>= 1 characters<= 256 characters

descriptionstring

Optional description of the resource.

Maximum 1024 characters.

<= 1024 characters

labelsobject

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 “_”.

Example:{"env":"test"}

keystringrequired

ExternalResourceKey is a unique string that is used to identify a resource in an external system.

>= 1 characters<= 256 characters

Example:019ae40f-4258-7f15-9491-842f42a7d6ac

usage_attributionobject

Mapping to attribute metered usage to the customer by the event subject.

Show Child Parameters
primary_emailstring

The primary email address of the customer.

currencystring

Currency of the customer.
Used for billing, tax and invoicing.

Match pattern:^[A-Z]{3}$

>= 3 characters<= 3 characters

Example:USD

billing_addressobject

The billing address of the customer.
Used for tax and invoicing.

Show Child Parameters

Response

application/json

Customer created response.

BillingCustomer

Customers can be individuals or organizations that can subscribe to plans and have access to features.

idstringrequiredread-only

ULID (Universally Unique Lexicographically Sortable Identifier).

Match pattern:^[0-7][0-9A-HJKMNP-TV-Z]{25}$

Example:01G65Z755AFWAKHE12NY0CQ9FH

namestringrequired

Display name of the resource.

Between 1 and 256 characters.

>= 1 characters<= 256 characters

descriptionstring

Optional description of the resource.

Maximum 1024 characters.

<= 1024 characters

labelsobject

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 “_”.

Example:{"env":"test"}

created_atstring(date-time)read-only

An ISO-8601 timestamp representation of entity creation date.

Example:2023-01-01T01:01:01.001Z

updated_atstring(date-time)read-only

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

Example:2023-01-01T01:01:01.001Z

deleted_atstring(date-time)read-only

An ISO-8601 timestamp representation of entity deletion date.

Example:2023-01-01T01:01:01.001Z

keystringrequired

ExternalResourceKey is a unique string that is used to identify a resource in an external system.

>= 1 characters<= 256 characters

Example:019ae40f-4258-7f15-9491-842f42a7d6ac

usage_attributionobject

Mapping to attribute metered usage to the customer by the event subject.

Show Child Parameters
primary_emailstring

The primary email address of the customer.

currencystring

Currency of the customer.
Used for billing, tax and invoicing.

Match pattern:^[A-Z]{3}$

>= 3 characters<= 3 characters

Example:USD

billing_addressobject

The billing address of the customer.
Used for tax and invoicing.

Show Child Parameters
post/openmeter/customers

Body

{ "name": "name", "key": "019ae40f-4258-7f15-9491-842f42a7d6ac" }
 
application/json